summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorTeoh Jay Shen <jay.shen.teoh@intel.com>2021-02-01 10:56:29 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-03 21:45:49 +0000
commiteedd8033e0046707b84d829c7537acad0c156705 (patch)
tree88938badc24cd746b849cff8639fa6446eefbdf8 /meta/lib/oeqa
parent899514c477aaf1681f9d18a022721410a36c5a8c (diff)
downloadpoky-eedd8033e0046707b84d829c7537acad0c156705.tar.gz
oeqa/usb_hid.py : add test to check the usb/human interface device status after suspend state
This test mimic the Test_if_usb_hid_device_works_well_after_resume_from_suspend_state manual test case from oeqa/manual/bsp-hw.json. (From OE-Core rev: 23a3dc370a52907ee3261746405fb9b2af9e9a11) Signed-off-by: Teoh Jay Shen <jay.shen.teoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/runtime/cases/usb_hid.py22
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 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.core.decorator.depends import OETestDepends
3from oeqa.core.decorator.data import skipIfQemu
4from oeqa.runtime.decorator.package import OEHasPackage
5
6class 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()