Merge ~sylvain-pineau/plainbox-provider-checkbox:more_classic_fixes into plainbox-provider-checkbox:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: b3145abea3352ca785abe40556ff8d85160a34cb
Merged at revision: efc8f85948413c7a036c04ffa169ca5fc72f76f1
Proposed branch: ~sylvain-pineau/plainbox-provider-checkbox:more_classic_fixes
Merge into: plainbox-provider-checkbox:master
Diff against target: 504 lines (+84/-68)
4 files modified
bin/keyboard_test (+1/-1)
units/disk/jobs.pxu (+10/-10)
units/mediacard/jobs.pxu (+64/-48)
units/suspend/suspend.pxu (+9/-9)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Paul Larson Approve
Review via email: mp+345762@code.launchpad.net

Description of the change

Few patches required to run p-p-c tests fro ma classic snap

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :
Revision history for this message
Paul Larson (pwlars) wrote :

Cool, I had not seen this __on_ubuntucore__ thing used before. A couple of questions...
1. Was it tested? (I'm assuming yes, but just had to ask)
2. does it make sense, and is it reliable enough, to use journalctl for all cases rather than just on core? we could save the check and just do it consistently everywhere unless there's some added benefit that removable_storage_watcher gives us.

I'm assuming you've already thought of all this (you usually have), so +1 unless one of those questions triggers something for you.

review: Approve
Revision history for this message
Jonathan Cave (jocave) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/keyboard_test b/bin/keyboard_test
2index 3e198db..1615106 100755
3--- a/bin/keyboard_test
4+++ b/bin/keyboard_test
5@@ -34,9 +34,9 @@ def cli_prompt():
6
7 def gtk_prompt():
8 import gi
9- from gi.repository import Gtk, Gdk
10 gi.require_version('Gdk', '3.0')
11 gi.require_version("Gtk", "3.0")
12+ from gi.repository import Gtk, Gdk
13 # create a new window
14 window = Gtk.Window()
15 window.set_type_hint(Gdk.WindowType.TOPLEVEL)
16diff --git a/units/disk/jobs.pxu b/units/disk/jobs.pxu
17index 4eccda3..2ee08d7 100644
18--- a/units/disk/jobs.pxu
19+++ b/units/disk/jobs.pxu
20@@ -21,7 +21,7 @@ flags: deprecated
21 user: root
22 estimated_duration: 10.0
23 command: disk_stats_test {name}
24-_summary: Disk statistics for {product}
25+_summary: Disk statistics for {product_slug}
26 _description:
27 This test checks disk stats, generates some activity and rechecks stats to
28 verify they've changed. It also verifies that disks appear in the various
29@@ -29,7 +29,7 @@ _description:
30 .
31 This test will inspect the following disk:
32 .
33- product name: {product}
34+ product name: {product_slug}
35 sysfs path: {path}
36 device node path: /dev/{name}
37
38@@ -44,9 +44,9 @@ requires:
39 package.name == 'smartmontools' or executable.name == 'smartctl'
40 block_device.smart == 'True' and block_device.name == '{name}'
41 _summary:
42- Test SMART capabilities for {product}
43+ Test SMART capabilities for {product_slug}
44 _description:
45- This tests the SMART capabilities for {product} (Note that this test may not work against hardware RAID)
46+ This tests the SMART capabilities for {product_slug} (Note that this test may not work against hardware RAID)
47 user: root
48 command: disk_smart -b /dev/{name} -s 130 -t 530
49
50@@ -58,7 +58,7 @@ category_id: com.canonical.plainbox::disk
51 id: disk/read_performance_{name}
52 estimated_duration: 65.0
53 requires:
54-_summary: Disk performance test for {product}
55+_summary: Disk performance test for {product_slug}
56 _description: Verify that disk storage performs at or above baseline performance
57 user: root
58 command: disk_read_performance_test {name}
59@@ -72,7 +72,7 @@ id: disk/storage_device_{name}
60 estimated_duration: 375.0
61 user: root
62 requires:
63-_summary: Disk I/O stress test for {product}
64+_summary: Disk I/O stress test for {product_slug}
65 _description: Take the path of the storage device and test is it a block device
66 command: storage_test {name}
67
68@@ -87,8 +87,8 @@ user: root
69 requires:
70 package.name == 'stress-ng' or executable.name == 'stress-ng'
71 package.name == 'uuid-runtime' or executable.name == 'uuidgen'
72-_summary: Disk stress_ng test for {product}
73-_description: Disk stress_ng test for {product}
74+_summary: Disk stress_ng test for {product_slug}
75+_description: Disk stress_ng test for {product_slug}
76 command: disk_stress_ng {name} --base-time 240 --really-run
77
78 unit: template
79@@ -102,8 +102,8 @@ user: root
80 requires:
81 block_device.state != 'removable' and block_device.name == '{name}'
82 package.name == 'bc' or executable.name == 'bc'
83-_summary: Check of CPU load imposed by {product}
84-_description: Check to ensure CPU load of {product} is not too high
85+_summary: Check of CPU load imposed by {product_slug}
86+_description: Check to ensure CPU load of {product_slug} is not too high
87 command: disk_cpu_load {name}
88
89 plugin: shell
90diff --git a/units/mediacard/jobs.pxu b/units/mediacard/jobs.pxu
91index ab00396..0599e0c 100644
92--- a/units/mediacard/jobs.pxu
93+++ b/units/mediacard/jobs.pxu
94@@ -1,13 +1,14 @@
95 plugin: user-interact
96+template-engine: jinja2
97 category_id: com.canonical.plainbox::mediacard
98 id: mediacard/mmc-insert
99 estimated_duration: 30.0
100 command:
101- if [[ -v SNAP ]]; then
102+ {%- if __on_ubuntucore__ %}
103 timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
104- else
105+ {%- else %}
106 removable_storage_watcher --memorycard insert sdio usb scsi
107- fi
108+ {% endif -%}
109 imports: from com.canonical.plainbox import manifest
110 requires:
111 package.name == 'udisks2' or snap.name == 'udisks2'
112@@ -40,16 +41,17 @@ _description:
113 test is run. It tests reading and writing to the MMC card.
114
115 plugin: user-interact
116+template-engine: jinja2
117 category_id: com.canonical.plainbox::mediacard
118 id: mediacard/mmc-remove
119 estimated_duration: 30.0
120 depends: mediacard/mmc-insert
121 command:
122- if [[ -v SNAP ]]; then
123+ {%- if __on_ubuntucore__ %}
124 timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
125- else
126+ {%- else %}
127 removable_storage_watcher --memorycard remove sdio usb scsi
128- fi
129+ {% endif -%}
130 user: root
131 _description:
132 PURPOSE:
133@@ -63,15 +65,16 @@ _description:
134 automatically selected result.
135
136 plugin: user-interact
137+template-engine: jinja2
138 category_id: com.canonical.plainbox::mediacard
139 id: mediacard/sd-insert
140 estimated_duration: 30.0
141 command:
142- if [[ -v SNAP ]]; then
143+ {%- if __on_ubuntucore__ %}
144 timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
145- else
146+ {%- else %}
147 removable_storage_watcher --memorycard insert sdio usb scsi
148- fi
149+ {% endif -%}
150 imports: from com.canonical.plainbox import manifest
151 requires:
152 package.name == 'udisks2' or snap.name == 'udisks2'
153@@ -104,16 +107,17 @@ _description:
154 test is run. It tests reading and writing to the SD card.
155
156 plugin: user-interact
157+template-engine: jinja2
158 category_id: com.canonical.plainbox::mediacard
159 id: mediacard/sd-remove
160 estimated_duration: 30.0
161 depends: mediacard/sd-insert
162 command:
163- if [[ -v SNAP ]]; then
164+ {%- if __on_ubuntucore__ %}
165 timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
166- else
167+ {%- else %}
168 removable_storage_watcher --memorycard remove sdio usb scsi
169- fi
170+ {% endif -%}
171 user: root
172 _description:
173 PURPOSE:
174@@ -144,15 +148,16 @@ _description:
175 It is intended for SRU automated testing.
176
177 plugin: user-interact
178+template-engine: jinja2
179 category_id: com.canonical.plainbox::mediacard
180 id: mediacard/sdhc-insert
181 estimated_duration: 30.0
182 command:
183- if [[ -v SNAP ]]; then
184+ {%- if __on_ubuntucore__ %}
185 timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
186- else
187+ {%- else %}
188 removable_storage_watcher --memorycard insert sdio usb scsi
189- fi
190+ {% endif -%}
191 imports: from com.canonical.plainbox import manifest
192 requires:
193 package.name == 'udisks2' or snap.name == 'udisks2'
194@@ -186,16 +191,17 @@ _description:
195 test is run. It tests reading and writing to the SDHC card.
196
197 plugin: user-interact
198+template-engine: jinja2
199 category_id: com.canonical.plainbox::mediacard
200 id: mediacard/sdhc-remove
201 estimated_duration: 30.0
202 depends: mediacard/sdhc-insert
203 command:
204- if [[ -v SNAP ]]; then
205+ {%- if __on_ubuntucore__ %}
206 timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
207- else
208+ {%- else %}
209 removable_storage_watcher --memorycard remove sdio usb scsi
210- fi
211+ {% endif -%}
212 user: root
213 _description:
214 PURPOSE:
215@@ -209,15 +215,16 @@ _description:
216 automatically selected result.
217
218 plugin: user-interact
219+template-engine: jinja2
220 category_id: com.canonical.plainbox::mediacard
221 id: mediacard/cf-insert
222 estimated_duration: 30.0
223 command:
224- if [[ -v SNAP ]]; then
225+ {%- if __on_ubuntucore__ %}
226 timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
227- else
228+ {%- else %}
229 removable_storage_watcher --memorycard insert sdio usb scsi
230- fi
231+ {% endif -%}
232 imports: from com.canonical.plainbox import manifest
233 requires:
234 package.name == 'udisks2' or snap.name == 'udisks2'
235@@ -249,16 +256,17 @@ _description:
236 test is run. It tests reading and writing to the CF card.
237
238 plugin: user-interact
239+template-engine: jinja2
240 category_id: com.canonical.plainbox::mediacard
241 id: mediacard/cf-remove
242 depends: mediacard/cf-storage
243 estimated_duration: 30.0
244 command:
245- if [[ -v SNAP ]]; then
246+ {%- if __on_ubuntucore__ %}
247 timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
248- else
249+ {%- else %}
250 removable_storage_watcher --memorycard remove sdio usb scsi
251- fi
252+ {% endif -%}
253 user: root
254 _description:
255 PURPOSE:
256@@ -272,15 +280,16 @@ _description:
257 automatically selected result.
258
259 plugin: user-interact
260+template-engine: jinja2
261 category_id: com.canonical.plainbox::mediacard
262 id: mediacard/sdxc-insert
263 estimated_duration: 30.0
264 command:
265- if [[ -v SNAP ]]; then
266+ {%- if __on_ubuntucore__ %}
267 timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
268- else
269+ {%- else %}
270 removable_storage_watcher --memorycard insert sdio usb scsi
271- fi
272+ {% endif -%}
273 imports: from com.canonical.plainbox import manifest
274 requires:
275 package.name == 'udisks2' or snap.name == 'udisks2'
276@@ -312,16 +321,17 @@ _description:
277 test is run. It tests reading and writing to the SDXC card.
278
279 plugin: user-interact
280+template-engine: jinja2
281 category_id: com.canonical.plainbox::mediacard
282 id: mediacard/sdxc-remove
283 estimated_duration: 30.0
284 depends: mediacard/sdxc-insert
285 command:
286- if [[ -v SNAP ]]; then
287+ {%- if __on_ubuntucore__ %}
288 timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
289- else
290+ {%- else %}
291 removable_storage_watcher --memorycard remove sdio usb scsi
292- fi
293+ {% endif -%}
294 user: root
295 _description:
296 PURPOSE:
297@@ -335,15 +345,16 @@ _description:
298 automatically selected result.
299
300 plugin: user-interact
301+template-engine: jinja2
302 category_id: com.canonical.plainbox::mediacard
303 id: mediacard/ms-insert
304 estimated_duration: 30.0
305 command:
306- if [[ -v SNAP ]]; then
307+ {%- if __on_ubuntucore__ %}
308 timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
309- else
310+ {%- else %}
311 removable_storage_watcher --memorycard insert sdio usb scsi
312- fi
313+ {% endif -%}
314 imports: from com.canonical.plainbox import manifest
315 requires:
316 package.name == 'udisks2' or snap.name == 'udisks2'
317@@ -375,16 +386,17 @@ _description:
318 test is run. It tests reading and writing to the MS card.
319
320 plugin: user-interact
321+template-engine: jinja2
322 category_id: com.canonical.plainbox::mediacard
323 id: mediacard/ms-remove
324 estimated_duration: 30.0
325 depends: mediacard/ms-insert
326 command:
327- if [[ -v SNAP ]]; then
328+ {%- if __on_ubuntucore__ %}
329 timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
330- else
331+ {%- else %}
332 removable_storage_watcher --memorycard remove sdio usb scsi
333- fi
334+ {% endif -%}
335 user: root
336 _description:
337 PURPOSE:
338@@ -398,15 +410,16 @@ _description:
339 automatically selected result.
340
341 plugin: user-interact
342+template-engine: jinja2
343 category_id: com.canonical.plainbox::mediacard
344 id: mediacard/msp-insert
345 estimated_duration: 30.0
346 command:
347- if [[ -v SNAP ]]; then
348+ {%- if __on_ubuntucore__ %}
349 timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
350- else
351+ {%- else %}
352 removable_storage_watcher --memorycard insert sdio usb scsi
353- fi
354+ {% endif -%}
355 user: root
356 imports: from com.canonical.plainbox import manifest
357 requires:
358@@ -438,16 +451,17 @@ _description:
359 test is run. It tests reading and writing to the MSP card.
360
361 plugin: user-interact
362+template-engine: jinja2
363 category_id: com.canonical.plainbox::mediacard
364 id: mediacard/msp-remove
365 estimated_duration: 30.0
366 depends: mediacard/msp-insert
367 command:
368- if [[ -v SNAP ]]; then
369+ {%- if __on_ubuntucore__ %}
370 timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
371- else
372+ {%- else %}
373 removable_storage_watcher --memorycard remove sdio usb scsi
374- fi
375+ {% endif -%}
376 user: root
377 _description:
378 PURPOSE:
379@@ -461,15 +475,16 @@ _description:
380 automatically selected result.
381
382 plugin: user-interact
383+template-engine: jinja2
384 category_id: com.canonical.plainbox::mediacard
385 id: mediacard/xd-insert
386 estimated_duration: 30.0
387 command:
388- if [[ -v SNAP ]]; then
389+ {%- if __on_ubuntucore__ %}
390 timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
391- else
392+ {%- else %}
393 removable_storage_watcher --memorycard insert sdio usb scsi
394- fi
395+ {% endif -%}
396 imports: from com.canonical.plainbox import manifest
397 requires:
398 package.name == 'udisks2' or snap.name == 'udisks2'
399@@ -501,16 +516,17 @@ _description:
400 test is run. It tests reading and writing to the xD card.
401
402 plugin: user-interact
403+template-engine: jinja2
404 category_id: com.canonical.plainbox::mediacard
405 id: mediacard/xd-remove
406 estimated_duration: 30.0
407 depends: mediacard/xd-insert
408 command:
409- if [[ -v SNAP ]]; then
410+ {%- if __on_ubuntucore__ %}
411 timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
412- else
413+ {%- else %}
414 removable_storage_watcher --memorycard remove sdio usb scsi
415- fi
416+ {% endif -%}
417 user: root
418 _description:
419 PURPOSE:
420diff --git a/units/suspend/suspend.pxu b/units/suspend/suspend.pxu
421index 64fba45..c989f77 100644
422--- a/units/suspend/suspend.pxu
423+++ b/units/suspend/suspend.pxu
424@@ -104,7 +104,7 @@ requires:
425 command:
426 if [ -z "$BTDEVADDR" ]
427 then
428- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
429+ echo "btdevaddr option not set to device address of Bluetooth target in checkbox.conf"
430 exit 1
431 fi
432 if rfkill list bluetooth | grep -q 'Hard blocked: yes'
433@@ -132,7 +132,7 @@ requires:
434 command:
435 if [ -z "$BTDEVADDR" ]
436 then
437- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
438+ echo "btdevaddr option not set to device address of Bluetooth target in checkbox.conf"
439 exit 1
440 fi
441 if rfkill list bluetooth | grep -q 'Hard blocked: yes'
442@@ -160,7 +160,7 @@ requires:
443 command:
444 if [ -z "$BTDEVADDR" ]
445 then
446- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
447+ echo "btdevaddr option not set to device address of Bluetooth target in checkbox.conf"
448 exit 1
449 fi
450 if rfkill list bluetooth | grep -q 'Hard blocked: yes'
451@@ -941,7 +941,7 @@ requires:
452 command:
453 if [ -z "$BTDEVADDR" ]
454 then
455- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
456+ echo "btdevaddr option not set to device address of Bluetooth target in checkbox.conf"
457 exit 1
458 fi
459 if rfkill list bluetooth | grep -q 'Hard blocked: yes'
460@@ -970,7 +970,7 @@ requires:
461 command:
462 if [ -z "$BTDEVADDR" ]
463 then
464- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
465+ echo "btdevaddr option not set to device address of Bluetooth target in checkbox.conf"
466 exit 1
467 fi
468 if rfkill list bluetooth | grep -q 'Hard blocked: yes'
469@@ -999,7 +999,7 @@ requires:
470 command:
471 if [ -z "$BTDEVADDR" ]
472 then
473- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
474+ echo "btdevaddr option not set to device address of Bluetooth target in checkbox.conf"
475 exit 1
476 fi
477 if rfkill list bluetooth | grep -q 'Hard blocked: yes'
478@@ -1028,7 +1028,7 @@ requires:
479 command:
480 if [ -z "$BTDEVADDR" ]
481 then
482- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
483+ echo "btdevaddr option not set to device address of Bluetooth target in checkbox.conf"
484 exit 1
485 fi
486 if rfkill list bluetooth | grep -q 'Hard blocked: yes'
487@@ -1057,7 +1057,7 @@ requires:
488 command:
489 if [ -z "$BTDEVADDR" ]
490 then
491- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
492+ echo "btdevaddr option not set to device address of Bluetooth target in checkbox.conf"
493 exit 1
494 fi
495 if rfkill list bluetooth | grep -q 'Hard blocked: yes'
496@@ -1086,7 +1086,7 @@ requires:
497 command:
498 if [ -z "$BTDEVADDR" ]
499 then
500- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
501+ echo "btdevaddr option not set to device address of Bluetooth target in checkbox.conf"
502 exit 1
503 fi
504 if rfkill list bluetooth | grep -q 'Hard blocked: yes'

Subscribers

People subscribed via source and target branches