From Fedora Project Wiki
Description
This test case tests usbguard
CLI device management.
Setup
- Ensure the
usbguard
package is installed - To start from a clean state, ensure that the usbguard service is stopped and that there's no existing policy.
- Ensure that there's at least one USB device connected to your system which can be disconnected and connected again. For example a USB keyboard or mouse.
- Prepare a USB device which is not connected to the system. For example a USB flash drive.
How to test
- Start the usbguard service:
# systemctl start usbguard
- Check that your connected USB devices are still working.
- List devices using the usbguard tool and check that all connected USB devices are listed:
# usbguard list-devices
- Connect the new device to the system. The device should be blocked -- not working.
- List blocked device using the usbguard tool:
# usbguard list-devices -b
- Allow the new device using the usbguard tool:
# usbguard allow-device <id>
- Check that the new device is working.
- List blocked device and check that the list is empty:
# usbguard list-devices -b
Expected Results
- USB devices work after the usbguard service start.
- Newly connected USB devices do not work.
- Blocked devices work after allowing them using the usbguard tool.