blob: 6f23d2ff518ccdb77eaf6c214f6e38386e9aa867 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
Andrew Geisslerd1e89492021-02-12 15:35:20 -06006from oeqa.runtime.case import OERuntimeTestCase
7from oeqa.core.decorator.depends import OETestDepends
8from oeqa.core.decorator.data import skipIfQemu
9from oeqa.runtime.decorator.package import OEHasPackage
10
11class USB_HID_Test(OERuntimeTestCase):
12
13 def keyboard_mouse_simulation(self):
14 (status, output) = self.target.run('export DISPLAY=:0 && xdotool key F2 && xdotool mousemove 100 100')
15 return self.assertEqual(status, 0, msg = 'Failed to simulate keyboard/mouse input event, output : %s' % output)
16
17 def set_suspend(self):
18 (status, output) = self.target.run('sudo rtcwake -m mem -s 10')
19 return self.assertEqual(status, 0, msg = 'Failed to suspends your system to RAM, output : %s' % output)
20
21 @OEHasPackage(['xdotool'])
Patrick Williams45852732022-04-02 08:58:32 -050022 @skipIfQemu()
Andrew Geisslerd1e89492021-02-12 15:35:20 -060023 @OETestDepends(['ssh.SSHTest.test_ssh'])
24 def test_USB_Hid_input(self):
25 self.keyboard_mouse_simulation()
26 self.set_suspend()
27 self.keyboard_mouse_simulation()