Skip to content

Commit

Permalink
Add manifest entries for special key jobs (BugFix) (#1387)
Browse files Browse the repository at this point in the history
Add manifest entries for special key jobs

Instead of relying on the generic `has_special_keys` manifest entry,
create a manifest entry for each of the dedicated keys test present in
Checkbox (for instance volume up/down, audio mute, microphone mute,
video out, etc.)

Use this manifest entries in the related `keys/*` jobs.

Remove the unused `has_special_keys` manifest entry.

Delete mentions to "manually skip that test" for the `keys/*` jobs,
since this is now controlled by a manifest entry.
  • Loading branch information
pieqq authored Sep 3, 2024
1 parent d3078dd commit c3ab17b
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 26 deletions.
43 changes: 19 additions & 24 deletions providers/base/units/keys/jobs.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ category_id: com.canonical.plainbox::keys
id: keys/lock-screen
estimated_duration: 30.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_lock_screen == 'True'
flags: also-after-suspend
command: lock_screen_watcher.py
_purpose:
This test will test the screen lock key
_steps:
1. Commence the test. If there is no such key, please skip this test.
2. Press the lock screen button on the keyboard in 30 seconds.
3. If the screen is locked, move the mouse or press any key to activate the prompt.
4. Input the password to unlock the screen.
1. Press the lock screen button on the keyboard in 30 seconds.
2. If the screen is locked, move the mouse or press any key to activate the prompt.
3. Input the password to unlock the screen.
_verification:
The verification of this test is automated. Do not change the
automatically selected result.
Expand All @@ -23,7 +22,7 @@ category_id: com.canonical.plainbox::keys
id: keys/brightness
estimated_duration: 30.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_brightness == 'True'
flags: also-after-suspend
_purpose:
This test will test the brightness keys
Expand All @@ -38,14 +37,13 @@ category_id: com.canonical.plainbox::keys
id: keys/volume
estimated_duration: 30.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_volume == 'True'
flags: also-after-suspend
user: root
command: key_test.py -s '0xe02e,0xe0ae:Volume Down' '0xe030,0xe0b0:Volume Up'
_purpose:
This test will test the volume keys of your keyboard
_steps:
Skip this test if your computer has no volume keys.
1. Click test to open a window on which to test the volume keys.
2. If all the keys work, the test will be marked as passed.
_verification:
Expand All @@ -57,7 +55,7 @@ category_id: com.canonical.plainbox::keys
id: keys/mute
estimated_duration: 30.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_audio_mute == 'True'
flags: also-after-suspend
user: root
command: key_test.py -s '0xe020,0xe0a0:Mute'
Expand All @@ -76,7 +74,7 @@ category_id: com.canonical.plainbox::keys
id: keys/sleep
estimated_duration: 90.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_sleep == 'True'
flags: also-after-suspend
_purpose:
This test will test the sleep key
Expand All @@ -92,14 +90,13 @@ category_id: com.canonical.plainbox::keys
id: keys/battery-info
estimated_duration: 30.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_battery_info == 'True'
flags: also-after-suspend
user: root
command: key_test.py -s '0xe071,0xef1:Battery Info'
_purpose:
This test will test the battery information key
_steps:
Skip this test if you do not have a Battery Button.
1. Click Test to begin
2. Press the Battery Info button (or combo like Fn+F3)
3. Close the Power Statistics tool if it opens
Expand All @@ -112,7 +109,7 @@ category_id: com.canonical.plainbox::keys
id: keys/wireless
estimated_duration: 90.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_wireless == 'True'
flags: also-after-suspend
_purpose:
This test will test the wireless key
Expand All @@ -134,14 +131,13 @@ category_id: com.canonical.plainbox::keys
id: keys/media-control
estimated_duration: 30.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_media_control == 'True'
flags: also-after-suspend
user: root
command: key_test.py -s 0xe010,0xe090:Previous 0xe024,0xe0a4:Stop 0xe019,0xe099:Next 0xe022,0xe0a2:Play
_purpose:
This test will test the media keys of your keyboard
_steps:
Skip this test if your computer has no media keys.
1. Click test to open a window on which to test the media keys.
2. If all the keys work, the test will be marked as passed.
_verification:
Expand All @@ -153,7 +149,7 @@ category_id: com.canonical.plainbox::keys
id: keys/super
estimated_duration: 30.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_super == 'True'
flags: also-after-suspend
user: root
command: key_test.py -s '0xe05b,0xe0db:Left Super Key'
Expand All @@ -172,7 +168,7 @@ category_id: com.canonical.plainbox::keys
id: keys/video-out
estimated_duration: 120.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_video_out == 'True'
flags: also-after-suspend
_purpose:
Validate that the External Video hot key is working as expected
Expand All @@ -188,7 +184,7 @@ category_id: com.canonical.plainbox::keys
id: keys/touchpad
estimated_duration: 30.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_touchpad == 'True'
flags: also-after-suspend
_description:
_purpose:
Expand All @@ -206,7 +202,7 @@ category_id: com.canonical.plainbox::keys
id: keys/keyboard-backlight
estimated_duration: 30.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_keyboard_backlight == 'True'
flags: also-after-suspend
_purpose:
Verify that the keyboard backlight toggle key works properly
Expand All @@ -225,7 +221,7 @@ id: keys/microphone-mute
estimated_duration: 60.0
imports: from com.canonical.plainbox import manifest
requires:
manifest.has_special_keys == 'True'
manifest.has_key_microphone_mute == 'True'
manifest.has_audio_playback == 'True'
package.name == 'alsa-base'
package.name in ['pulseaudio-utils', 'pipewire']
Expand Down Expand Up @@ -260,7 +256,7 @@ category_id: com.canonical.plainbox::keys
id: keys/hibernate
estimated_duration: 120.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_hibernate == 'True'
_description:
_purpose:
This test will test the hibernate key
Expand All @@ -277,7 +273,7 @@ category_id: com.canonical.plainbox::keys
id: keys/keyboard-overhead-light
estimated_duration: 30.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_keyboard_overhead_light == 'True'
_description:
_purpose:
This test will test the keyboard overhead light key or switch
Expand Down Expand Up @@ -333,12 +329,11 @@ category_id: com.canonical.plainbox::keys
id: keys/fn-lock
estimated_duration: 30.0
imports: from com.canonical.plainbox import manifest
requires: manifest.has_special_keys == 'True'
requires: manifest.has_key_fn_lock == 'True'
flags: also-after-suspend
_purpose:
This test will test the Fn Lock key
_steps:
Skip this test if your system does not have Fn Lock key.
1. Press the Fn+Fn Lock key.
2. Press the Fn+any hotkey.
_verification:
Expand Down
96 changes: 94 additions & 2 deletions providers/base/units/keys/manifest.pxu
Original file line number Diff line number Diff line change
@@ -1,4 +1,96 @@
unit: manifest entry
id: has_special_keys
_name: Special keys Support
id: has_key_battery_info
_name: Battery Info
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_brightness
_name: Screen brightness up/down
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_fn_lock
_name: Function lock (Fn lock)
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_hibernate
_name: Hibernate
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_keyboard_backlight
_name: Keyboard backlight
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_keyboard_overhead_light
_name: Keyboard overhead light
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_lock_screen
_name: Lock screen
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_media_control
_name: Media control (Play, Next, etc.)
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_microphone_mute
_name: Microphone mute
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_audio_mute
_name: Audio mute
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_sleep
_name: Sleep
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_super
_name: Super (usually the key with the Windows logo)
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_touchpad
_name: Touchpad on/off
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_video_out
_name: Video out (to toggle video output)
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_volume
_name: Volume up/down
_prompt: Does this machine have the following special keys?
value-type: bool

unit: manifest entry
id: has_key_wireless
_name: Wireless on/off
_prompt: Does this machine have the following special keys?
value-type: bool

0 comments on commit c3ab17b

Please sign in to comment.