-
Notifications
You must be signed in to change notification settings - Fork 64
A test case for randomly generated input events (New) #1775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f91857b
to
ec60fac
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1775 +/- ##
==========================================
+ Coverage 49.63% 50.39% +0.75%
==========================================
Files 377 382 +5
Lines 40630 40960 +330
Branches 6830 7497 +667
==========================================
+ Hits 20168 20641 +473
+ Misses 19740 19588 -152
- Partials 722 731 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some comments in the code of the script.
Other than that, please also update the packaging for the snaps and the debian package recipes to pull python3-evdev
. Hopefully this works on Xenial (I just checked and there is a python3-evdev
package there, albeit a very old one, so fingers crossed!)
(side comment: I didn't really understand the connection between what's explained in the description about gnome-randr and this script, could you provide more information?) |
Hi Pierre, I have updated the description and all story text. I guess it could fix your concern. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked and the python3-evdev
package should be available everywhere we need it, so it's good. That said, you need to add the packaging information for Debian and Snaps (for all the series. See for instance the snapcraft.yaml for series24; you would probably need to add this dependency in the stage-packages
section of the base provider).
I saw that in 7031c05 you added this for Debian, but then you removed it in b9b3606. Not sure why?
Other than that, I tried running the script with $ ./mouse_keyboard.py
on my 24.04 laptop. Out of 5 runs, it failed twice with the following error:
Traceback (most recent call last):
File "/home/pieq/dev/work/checkbox/providers/base/bin/./mouse_keyboard.py", line 159, in <module>
main()
File "/home/pieq/dev/work/checkbox/providers/base/bin/./mouse_keyboard.py", line 150, in main
rand_mouse_moves(device) # Simulate mouse movement
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pieq/dev/work/checkbox/providers/base/bin/./mouse_keyboard.py", line 134, in rand_mouse_moves
rest_x = x % steps
~~^~~~~~~
ZeroDivisionError: integer modulo by zero
Can you look into that?
|
52ca2d0 add the package; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Use python3-evdev to generate random input events (mouse movements, keyboard typing) in order to detect potential issues during screen rotation testing. Fix OEMQA-5102 Fix lp:2045249
Description
We discovered this problem during last year's testing: https://bugs.launchpad.net/sutton/+bug/2045249 . We found this bug by manually coordinating the random use of the mouse and keyboard during screen rotation. Now I use this C code to implement the random automatic behavior of the mouse and keyboard. It can be used in conjunction with another PR #1576 submitted by my colleague Hanhsuan to complete the random movement of the mouse and keyboard at different resolutions while rotating the screen.
Note: The keyboard and mouse random C code needs to execute via 'sudo'. We have also tried to use Python's uinput to avoid using sudo permissions, but by looking up the document https://python-evdev.readthedocs.io/en/latest/tutorial.html#injecting-input, Python cannot avoid sudo either, and C code is available for the rotation test case without introducing external dependence. So I choose C code, it is more suitable for the rotation test case.
Resolved issues
https://warthogs.atlassian.net/browse/OEMQA-5102
https://bugs.launchpad.net/sutton/+bug/2045249
Documentation
Tests
$ providers/base/bin/mouse_keyboard.py
The demo file works as design
Run the test case mouse_keyboard.py without any errors