From Fedora Project Wiki

No edit summary
No edit summary
Line 6: Line 6:
# 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.
# 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.
# Prepare a USB device which is not connected to the system. For example a USB flash drive.
{{admon/tip|How to get to a clean state|As root, run <code>systemctl stop usbguard</code> and <code>rm -f /etc/usbguard/rules.conf</code>. '''This will remove your policy, so make a backup if you don't want to lose it'''.}}
{{admon/tip|How to get to a clean state|As root, run {{command|systemctl stop usbguard}} and {{command|rm -f /etc/usbguard/rules.conf}}. '''This will remove your policy, so make a backup if you don't want to lose it'''.}}
|actions=
|actions=
# As root, generate an initial policy using the following command: <code>usbguard generate-policy -P > /etc/usbguard/rules.conf</code>
# As root, generate an initial policy using the following command: {{command|usbguard generate-policy -P > /etc/usbguard/rules.conf}}
# Start the usbguard service: <code>systemctl start usbguard</code>
# Start the usbguard service: {{command|systemctl start usbguard}}
# Check that your connected USB devices are still working. Try to reconnect some of them and check that they are still working.
# Check that your connected USB devices are still working. Try to reconnect some of them and check that they are still working.
# Connect the new device to the system and try whether it's working.
# Connect the new device to the system and try whether it's working.

Revision as of 15:18, 7 August 2016

Description

This test case tests Package-x-generic-16.pngusbguard initial setup procedure.

Setup

  1. Ensure the Package-x-generic-16.pngusbguard package is installed
  2. To start from a clean state, ensure that the usbguard service is stopped and that there's no existing policy.
  3. 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.
  4. Prepare a USB device which is not connected to the system. For example a USB flash drive.
Idea.png
How to get to a clean state
As root, run systemctl stop usbguard and rm -f /etc/usbguard/rules.conf. This will remove your policy, so make a backup if you don't want to lose it.

How to test

  1. As root, generate an initial policy using the following command: usbguard generate-policy -P > /etc/usbguard/rules.conf
  2. Start the usbguard service: systemctl start usbguard
  3. Check that your connected USB devices are still working. Try to reconnect some of them and check that they are still working.
  4. Connect the new device to the system and try whether it's working.
Note.png
The -P option in usbguard generate-policy
The option causes the command not to generate port-specific rules. You can leave it out if you'll use the same port when reconnecting a device in a later step.

Expected Results

  1. USB devices work after the usbguard service start.
  2. Reconnected USB devices work.
  3. Newly connected USB devices do not work.