Skip to content

Commit b30c2c3

Browse files
committed
migrate to use the new randr_cycle.py for resolution and rotation test
1 parent 79c7c03 commit b30c2c3

File tree

4 files changed

+34
-15
lines changed

4 files changed

+34
-15
lines changed

checkbox-ng/plainbox/impl/session/remote_assistant.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ def _prepare_display_without_psutil(self):
305305
"WAYLAND_DISPLAY": self._set_envvar_from_proc("WAYLAND_DISPLAY"),
306306
"XAUTHORITY": self._set_envvar_from_proc("XAUTHORITY"),
307307
"XDG_SESSION_TYPE": self._set_envvar_from_proc("XDG_SESSION_TYPE"),
308+
"XDG_CURRENT_DESKTOP": self._set_envvar_from_proc(
309+
"XDG_CURRENT_DESKTOP"
310+
),
308311
"XDG_RUNTIME_DIR": "/run/user/{}".format(uid),
309312
"DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/{}/bus".format(
310313
uid
@@ -321,6 +324,7 @@ def prepare_extra_env(self):
321324
"DISPLAY",
322325
"XAUTHORITY",
323326
"XDG_SESSION_TYPE",
327+
"XDG_CURRENT_DESKTOP",
324328
"XDG_RUNTIME_DIR",
325329
"DBUS_SESSION_BUS_ADDRESS",
326330
"WAYLAND_DISPLAY",

providers/base/units/graphics/jobs.pxu

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,13 @@ template-id: graphics/index_cycle_resolution_product_slug
222222
flags: also-after-suspend
223223
requires: package.name == 'xorg'
224224
depends: graphics/VESA_drivers_not_in_use
225+
environ: XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
225226
command:
226227
# shellcheck disable=SC1091
227228
source graphics_env.sh {driver} {index}
228-
if [[ $XDG_SESSION_TYPE == "wayland" ]]
229+
if [[ $XDG_CURRENT_DESKTOP == *"GNOME"* ]]
229230
then
230-
gnome_randr_cycle.py --screenshot-dir="$PLAINBOX_SESSION_SHARE"
231+
randr_cycle.py -c resolution --prefix {index} --screenshot_dir="$PLAINBOX_SESSION_SHARE"
231232
else
232233
xrandr_cycle.py --screenshot-dir="$PLAINBOX_SESSION_SHARE"
233234
fi
@@ -249,10 +250,16 @@ category_id: com.canonical.plainbox::graphics
249250
id: graphics/{index}_rotation_{product_slug}
250251
template-id: graphics/index_rotation_product_slug
251252
flags: also-after-suspend
253+
environ: XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
252254
command:
253255
# shellcheck disable=SC1091
254256
source graphics_env.sh {driver} {index}
255-
rotation_test.py
257+
if [[ $XDG_CURRENT_DESKTOP == *"GNOME"* ]]
258+
then
259+
randr_cycle.py -c transform --prefix {index} --screenshot_dir="$PLAINBOX_SESSION_SHARE"
260+
else
261+
rotation_test.py
262+
fi
256263
estimated_duration: 20.000
257264
_summary: Test rotation for {vendor} {product}
258265
_purpose:

providers/base/units/suspend/suspend-graphics.pxu

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,13 @@ depends:
9797
suspend/suspend_advanced_auto
9898
{%- endif %}
9999
estimated_duration: 120.0
100+
environ: XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
100101
command:
101-
# shellcheck disable=SC1091
102+
# shellcheck disable=SC1091,SC1083
102103
source graphics_env.sh {{ driver }} {{ index }}
103-
if [[ $XDG_SESSION_TYPE == "wayland" ]]
104+
if [[ $XDG_CURRENT_DESKTOP == *"GNOME"* ]]
104105
then
105-
gnome_randr_cycle.py --keyword={{ index }}_after_suspend --screenshot-dir="$PLAINBOX_SESSION_SHARE"
106+
randr_cycle.py -c resolution --prefix {index} --screenshot_dir="$PLAINBOX_SESSION_SHARE"
106107
else
107108
xrandr_cycle.py --keyword={{ index }}_after_suspend --screenshot-dir="$PLAINBOX_SESSION_SHARE"
108109
fi
@@ -122,7 +123,7 @@ category_id: com.canonical.plainbox::suspend
122123
id: suspend/{index}_xrandr_screens_after_suspend.tar.gz_auto
123124
template-id: suspend/index_xrandr_screens_after_suspend.tar.gz_auto
124125
depends: after-suspend-graphics/{index}_cycle_resolution_{product_slug}
125-
command: [ -f "$PLAINBOX_SESSION_SHARE"/xrandr_screens_{index}_after_suspend.tgz ] && cat "$PLAINBOX_SESSION_SHARE"/xrandr_screens_{index}_after_suspend.tgz
126+
command: [ -f "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz ] && cat "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz
126127
_purpose: This attaches screenshots from the suspend/cycle_resolutions_after_suspend test to the results submission.
127128
_summary: Attach screenshots from suspend/cycle resolutions after suspend test to results.
128129

providers/base/units/suspend/suspend.pxu

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,10 +1151,11 @@ id: suspend/cycle_resolutions_after_suspend
11511151
estimated_duration: 120.0
11521152
requires: package.name == 'xorg'
11531153
depends: suspend/suspend_advanced_auto
1154+
environ: XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
11541155
command:
1155-
if [[ $XDG_SESSION_TYPE == "wayland" ]]
1156+
if [[ $XDG_CURRENT_DESKTOP == *"GNOME"* ]]
11561157
then
1157-
gnome_randr_cycle.py --keyword=after_suspend --screenshot-dir="$PLAINBOX_SESSION_SHARE"
1158+
randr_cycle.py -c resolution --screenshot_dir="$PLAINBOX_SESSION_SHARE"
11581159
else
11591160
xrandr_cycle.py --keyword=after_suspend --screenshot-dir="$PLAINBOX_SESSION_SHARE"
11601161
fi
@@ -1175,11 +1176,12 @@ id: suspend/{index}_cycle_resolutions_after_suspend_{product_slug}
11751176
template-id: suspend/index_cycle_resolutions_after_suspend_product_slug
11761177
requires: package.name == 'xorg'
11771178
depends: suspend/{index}_suspend_after_switch_to_card_{product_slug}
1179+
environ: XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
11781180
estimated_duration: 120.0
11791181
command:
1180-
if [[ $XDG_SESSION_TYPE == "wayland" ]]
1182+
if [[ $XDG_CURRENT_DESKTOP == *"GNOME"* ]]
11811183
then
1182-
gnome_randr_cycle.py --keyword={index}_after_suspend --screenshot-dir="$PLAINBOX_SESSION_SHARE"
1184+
randr_cycle.py -c resolution --prefix {index} --screenshot_dir="$PLAINBOX_SESSION_SHARE"
11831185
else
11841186
xrandr_cycle.py --keyword={index}_after_suspend --screenshot-dir="$PLAINBOX_SESSION_SHARE"
11851187
fi
@@ -1197,13 +1199,14 @@ id: suspend/cycle_resolutions_after_suspend_auto
11971199
estimated_duration: 1.2
11981200
requires: package.name == 'xorg'
11991201
depends: suspend/suspend_advanced_auto
1202+
environ: XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
12001203
_purpose:
12011204
This test will check to make sure supported video modes work after a suspend and resume.
12021205
This is done automatically by taking screenshots and uploading them as an attachment.
12031206
command:
1204-
if [[ $XDG_SESSION_TYPE == "wayland" ]]
1207+
if [[ $XDG_CURRENT_DESKTOP == *"GNOME"* ]]
12051208
then
1206-
gnome_randr_cycle.py --keyword=after_suspend --screenshot-dir="$PLAINBOX_SESSION_SHARE"
1209+
randr_cycle.py -c resolution --screenshot_dir="$PLAINBOX_SESSION_SHARE"
12071210
else
12081211
xrandr_cycle.py --keyword=after_suspend --screenshot-dir="$PLAINBOX_SESSION_SHARE"
12091212
fi
@@ -1213,7 +1216,9 @@ plugin: attachment
12131216
category_id: com.canonical.plainbox::suspend
12141217
id: suspend/xrandr_screens_after_suspend.tar.gz
12151218
depends: suspend/cycle_resolutions_after_suspend
1216-
command: [ -f "$PLAINBOX_SESSION_SHARE"/xrandr_screens_after_suspend.tgz ] && cat "$PLAINBOX_SESSION_SHARE"/xrandr_screens_after_suspend.tgz
1219+
command:
1220+
# shellcheck disable=SC1091,SC1083
1221+
[ -f "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz ] && cat "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz
12171222
_purpose: This attaches screenshots from the suspend/cycle_resolutions_after_suspend test to the results submission.
12181223
_summary: Attach screenshots from the suspend/cycle_resolutions_after_suspend test to results.
12191224

@@ -1225,7 +1230,9 @@ category_id: com.canonical.plainbox::suspend
12251230
id: suspend/{index}_xrandr_screens_after_suspend.tar.gz
12261231
template-id: suspend/index_xrandr_screens_after_suspend.tar.gz
12271232
depends: suspend/{index}_cycle_resolutions_after_suspend_{product_slug}
1228-
command: [ -f "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz ] && cat "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz
1233+
command:
1234+
# shellcheck disable=SC1091,SC1083
1235+
[ -f "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz ] && cat "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz
12291236
_purpose: This attaches screenshots from the suspend/cycle_resolutions_after_suspend test to the results submission.
12301237
_summary: Attach screenshots from suspend/cycle_resolutions_after_suspend test to the results.
12311238

0 commit comments

Comments
 (0)