From Fedora Project Wiki

(Created page with "{{QA/Test_Case |description=This test case tests {{package|usbguard}} GUI application. |setup= # This is a GUI application test, therefore you have to execute this test in a g...")
 
No edit summary
Line 8: Line 8:
# Prepare a USB device which is not connected to the system and for which there's no rule in your USBGuard policy.
# Prepare a USB device which is not connected to the system and for which there's no rule in your USBGuard policy.
# Make sure that the user under whom you'll be testing the GUI application is a member of the wheel group. Otherwise the application won't have permissions to talk to the usbguard-daemon component.
# Make sure that the user under whom you'll be testing the GUI application is a member of the wheel group. Otherwise the application won't have permissions to talk to the usbguard-daemon component.
{{admon/tip|How to get to a clean state|As root, run <code>systemctl stop usbguard</code> and <code>killall usbguard-applet-qt</code> and restore your policy from a backup.}}
{{admon/tip|How to get to a clean state|As root, run {{command|systemctl stop usbguard}} and {{command|killall usbguard-applet-qt}} and restore your policy from a backup.}}
{{admon/tip|Where is my policy stored?|The USBGuard policy is stored in the file /etc/usbguard/rules.conf. Just copy the file somewhere else to make a backup. Copy it back and restart the usbguard service to restore the policy from the backup.}}
{{admon/tip|Where is my policy stored?|The USBGuard policy is stored in the file /etc/usbguard/rules.conf. Just copy the file somewhere else to make a backup. Copy it back and restart the usbguard service to restore the policy from the backup.}}
|actions=
|actions=
# Start the usbguard service: <code>systemctl start usbguard</code>
# Start the usbguard service: {{command|systemctl start usbguard}}
# Start the usbguard-applet-qt application.
# Start the usbguard-applet-qt application.
# Insert the USB device.
# Insert the USB device.

Revision as of 15:22, 7 August 2016

Description

This test case tests usbguard GUI application.

Setup

  1. This is a GUI application test, therefore you have to execute this test in a graphical session.
  2. Ensure the usbguard and usbguard-applet-qt packages are installed.
  3. Backup your policy because the testing procedure will modify it.
  4. To start from a clean state, ensure that the usbguard service is stopped and that the usbguard-applet-qt application is not running either.
  5. Prepare a USB device which is not connected to the system and for which there's no rule in your USBGuard policy.
  6. Make sure that the user under whom you'll be testing the GUI application is a member of the wheel group. Otherwise the application won't have permissions to talk to the usbguard-daemon component.
How to get to a clean state
As root, run systemctl stop usbguard and killall usbguard-applet-qt and restore your policy from a backup.
Where is my policy stored?
The USBGuard policy is stored in the file /etc/usbguard/rules.conf. Just copy the file somewhere else to make a backup. Copy it back and restart the usbguard service to restore the policy from the backup.

How to test

  1. Start the usbguard service: systemctl start usbguard
  2. Start the usbguard-applet-qt application.
  3. Insert the USB device.
  4. Click on the block button to block the device. Check that the device remained blocked and is not usable.
  5. Re-insert the USB device.
  6. Click on the allow button to allow the device. Check that the device is working as expected, e.g. if it's a USB mouse, then you can move the cursor with it.
  7. Re-insert the USB device.
  8. Check the "[ ] Make the decision permanent" option and click on the allow button.
  9. Re-insert the USB device.
  10. The device should be automatically allowed. Check whether it's working as expected.

Expected Results

  1. The application connects to the usbguard-daemon component on start.
  2. A device dialog appears when the USB device is connected to the system.
  3. The allow and block buttons work as expected.
  4. If the "[ ] Make the decision permanent" option is checked, then the action is remembered and no device dialog appears for the device again.