From Fedora Project Wiki

No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
# 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 {{command|systemctl stop usbguard}} and {{command|killall usbguard-applet-qt}} 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: {{command|systemctl start usbguard}}
<ol type="l">
# Start the usbguard-applet-qt application.
<li>Start the usbguard service: <pre># systemctl start usbguard</pre></li>
# Insert the USB device.
<li>Start the usbguard-applet-qt application.</li>
# Click on the '''block''' button to block the device. Check that the device remained blocked and is '''not''' usable.
<li>Insert the USB device.</li>
# Re-insert the USB device.
</li>Click on the '''block''' button to block the device. Check that the device remained blocked and is '''not''' usable.<br>
# 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.
[[File:usbguard-applet-qt-dialog-block.png|usbguard-applet-qt dialog]]
# Re-insert the USB device.
</li>
# Check the "'''[ ] Make the decision permanent'''" option and click on the '''allow''' button.
<li>Re-insert the USB device.</li>
# Re-insert the USB device.
<li>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.<br>
# The device should be automatically allowed. Check whether it's working as expected.
[[File:usbguard-applet-qt-dialog-allow.png|usbguard-applet-qt dialog]]
</li>
<li>Re-insert the USB device.</li>
<li>Check the "'''[ ] Make the decision permanent'''" option and click on the '''allow''' button.<br>
[[File:usbguard-applet-qt-dialog-permanent.png|usbguard-applet-qt dialog]]
</li>
<li>Re-insert the USB device.</li>
<li>The device should be automatically allowed. Check whether it's working as expected.</li>
</ol>
|results=
|results=
# The application connects to the usbguard-daemon component on start.
# The application connects to the usbguard-daemon component on start.

Latest revision as of 11:30, 22 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.
    usbguard-applet-qt dialog
  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.
    usbguard-applet-qt dialog
  7. Re-insert the USB device.
  8. Check the "[ ] Make the decision permanent" option and click on the allow button.
    usbguard-applet-qt dialog
  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.