Merge ~kissiel/plainbox-provider-checkbox:poweroff-autoresume into plainbox-provider-checkbox:master

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Maciej Kisielewski
Approved revision: 45db040f2ebaad3c578534c07ebb2ca457dd66bf
Merged at revision: 6720d13193aa5c2f4f7f587b6d1f0f8eacb46556
Proposed branch: ~kissiel/plainbox-provider-checkbox:poweroff-autoresume
Merge into: plainbox-provider-checkbox:master
Diff against target: 58 lines (+10/-5)
2 files modified
bin/pm_test (+1/-1)
jobs/stress.txt.in (+9/-4)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Maciej Kisielewski Needs Resubmitting
Jonathan Cave (community) Needs Information
Review via email: mp+330148@code.launchpad.net

Description of the change

Make poweroff tests auto-resume checkbox after they're done

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

I'm not in a great position to be able to test the functionality of the test, however I wonder if we should make it a bit more obvious that this is desktop only test.

For instance, given how the checkbox-respawn-cmd flag works, a package.name == 'gnome-terminal' might be appropriate?

review: Needs Information
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

> I'm not in a great position to be able to test the functionality of the test,
> however I wonder if we should make it a bit more obvious that this is desktop
> only test.
>
> For instance, given how the checkbox-respawn-cmd flag works, a package.name ==
> 'gnome-terminal' might be appropriate?

Added packaging meta-data.

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

Maybe I don't understand packaging meta-data, but wont this try and install gnome-terminal on any system that installs the deb of this provider i.e. on server installs too?

review: Needs Information
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

I'd add package.name == 'x-terminal-emulator' as a job requirement and call x-terminal-emulator from pm_test, this way we're not stuck with gnome-term.

But drop the packaging meta-data, it will indeed have undesired side-effect for server-cert packaging.

review: Needs Fixing
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

> I'd add package.name == 'x-terminal-emulator' as a job requirement and call x
> -terminal-emulator from pm_test, this way we're not stuck with gnome-term.
>
> But drop the packaging meta-data, it will indeed have undesired side-effect
> for server-cert packaging.

x-terminal-emulator is a virtual package, which doesn't get reported by package, so I decided to go with 'executable' resource instead.

This, OTOH, requires unreleased version of plainbox-provider-resource, as x-terminal-emulator is a symlink. More info: https://bugs.launchpad.net/plainbox-provider-resource/+bug/1710172

Everything works nicely provided with ppr supplied from master.

review: Needs Resubmitting
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

+1 for the executable resource.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/pm_test b/bin/pm_test
index 42de2d8..395498c 100755
--- a/bin/pm_test
+++ b/bin/pm_test
@@ -202,7 +202,7 @@ class PowerManagementOperation(object):
202 MessageDialog(title, message).run()202 MessageDialog(title, message).run()
203 if self.args.checkbox_respawn_cmd:203 if self.args.checkbox_respawn_cmd:
204 subprocess.run(204 subprocess.run(
205 r'DISPLAY=:0 gnome-terminal -e "bash -c \"source {}; exec bash\""'.format(205 r'DISPLAY=:0 x-terminal-emulator -e "bash -c \"source {}; exec bash\""'.format(
206 self.args.checkbox_respawn_cmd), shell=True)206 self.args.checkbox_respawn_cmd), shell=True)
207207
208 def teardown(self):208 def teardown(self):
diff --git a/jobs/stress.txt.in b/jobs/stress.txt.in
index 5eae797..37f58f8 100644
--- a/jobs/stress.txt.in
+++ b/jobs/stress.txt.in
@@ -77,6 +77,8 @@ estimated_duration: 5400.0
77depends:77depends:
78 power-management/rtc78 power-management/rtc
79 suspend/suspend_advanced79 suspend/suspend_advanced
80requires:
81 executable.name == 'x-terminal-emulator'
80flags: noreturn autorestart82flags: noreturn autorestart
81user: root83user: root
82command:84command:
@@ -250,6 +252,7 @@ id: stress/reboot_30
250requires:252requires:
251 package.name == 'upstart'253 package.name == 'upstart'
252 package.name == 'fwts'254 package.name == 'fwts'
255 executable.name == 'x-terminal-emulator'
253command: pm_test --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox -r 30 --silent --log-level=notset reboot --log-dir=$PLAINBOX_SESSION_SHARE256command: pm_test --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox -r 30 --silent --log-level=notset reboot --log-dir=$PLAINBOX_SESSION_SHARE
254flags: noreturn autorestart257flags: noreturn autorestart
255estimated_duration: 2700258estimated_duration: 2700
@@ -273,8 +276,9 @@ estimated_duration: 4500.0
273requires:276requires:
274 package.name == 'upstart'277 package.name == 'upstart'
275 package.name == 'fwts'278 package.name == 'fwts'
276command: pm_test -r 100 --silent --log-level=notset poweroff --log-dir=$PLAINBOX_SESSION_SHARE279 executable.name == 'x-terminal-emulator'
277flags: noreturn280command: pm_test --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox --r 100 --silent --log-level=notset poweroff --log-dir=$PLAINBOX_SESSION_SHARE
281flags: noreturn autorestart
278user: root282user: root
279environ: PLAINBOX_SESSION_SHARE283environ: PLAINBOX_SESSION_SHARE
280_description:284_description:
@@ -295,8 +299,9 @@ id: stress/poweroff_30
295requires:299requires:
296 package.name == 'upstart'300 package.name == 'upstart'
297 package.name == 'fwts'301 package.name == 'fwts'
298command: pm_test -r 30 --silent --log-level=notset poweroff --log-dir=$PLAINBOX_SESSION_SHARE302 executable.name == 'x-terminal-emulator'
299flags: noreturn303command: pm_test --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox --r 30 --silent --log-level=notset poweroff --log-dir=$PLAINBOX_SESSION_SHARE
304flags: noreturn autorestart
300estimated_duration: 3600305estimated_duration: 3600
301user: root306user: root
302environ: PLAINBOX_SESSION_SHARE307environ: PLAINBOX_SESSION_SHARE

Subscribers

People subscribed via source and target branches