From Fedora Project Wiki
Description
This test case tests usbguard
GUI application.
Setup
- This is a GUI application test, therefore you have to execute this test in a graphical session.
- Ensure the
usbguard
andusbguard-applet-qt
packages are installed. - Backup your policy because the testing procedure will modify it.
- To start from a clean state, ensure that the usbguard service is stopped and that the usbguard-applet-qt application is not running either.
- 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.
How to test
- Start the usbguard service:
# systemctl start usbguard
- Start the usbguard-applet-qt application.
- Insert the USB device. Click on the block button to block the device. Check that the device remained blocked and is not usable.
- Re-insert the USB device.
- 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.
- Re-insert the USB device.
- Check the "[ ] Make the decision permanent" option and click on the allow button.
- Re-insert the USB device.
- The device should be automatically allowed. Check whether it's working as expected.
Expected Results
- The application connects to the usbguard-daemon component on start.
- A device dialog appears when the USB device is connected to the system.
- The allow and block buttons work as expected.
- If the "[ ] Make the decision permanent" option is checked, then the action is remembered and no device dialog appears for the device again.