diff options
| -rw-r--r-- | meta/lib/oeqa/runtime/cases/usb_hid.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/usb_hid.py b/meta/lib/oeqa/runtime/cases/usb_hid.py new file mode 100644 index 0000000000..3c292cf661 --- /dev/null +++ b/meta/lib/oeqa/runtime/cases/usb_hid.py | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | from oeqa.runtime.case import OERuntimeTestCase | ||
| 2 | from oeqa.core.decorator.depends import OETestDepends | ||
| 3 | from oeqa.core.decorator.data import skipIfQemu | ||
| 4 | from oeqa.runtime.decorator.package import OEHasPackage | ||
| 5 | |||
| 6 | class USB_HID_Test(OERuntimeTestCase): | ||
| 7 | |||
| 8 | def keyboard_mouse_simulation(self): | ||
| 9 | (status, output) = self.target.run('export DISPLAY=:0 && xdotool key F2 && xdotool mousemove 100 100') | ||
| 10 | return self.assertEqual(status, 0, msg = 'Failed to simulate keyboard/mouse input event, output : %s' % output) | ||
| 11 | |||
| 12 | def set_suspend(self): | ||
| 13 | (status, output) = self.target.run('sudo rtcwake -m mem -s 10') | ||
| 14 | return self.assertEqual(status, 0, msg = 'Failed to suspends your system to RAM, output : %s' % output) | ||
| 15 | |||
| 16 | @OEHasPackage(['xdotool']) | ||
| 17 | @skipIfQemu('qemuall', 'Test only runs on real hardware') | ||
| 18 | @OETestDepends(['ssh.SSHTest.test_ssh']) | ||
| 19 | def test_USB_Hid_input(self): | ||
| 20 | self.keyboard_mouse_simulation() | ||
| 21 | self.set_suspend() | ||
| 22 | self.keyboard_mouse_simulation() | ||
