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
1diff --git a/bin/pm_test b/bin/pm_test
2index 42de2d8..395498c 100755
3--- a/bin/pm_test
4+++ b/bin/pm_test
5@@ -202,7 +202,7 @@ class PowerManagementOperation(object):
6 MessageDialog(title, message).run()
7 if self.args.checkbox_respawn_cmd:
8 subprocess.run(
9- r'DISPLAY=:0 gnome-terminal -e "bash -c \"source {}; exec bash\""'.format(
10+ r'DISPLAY=:0 x-terminal-emulator -e "bash -c \"source {}; exec bash\""'.format(
11 self.args.checkbox_respawn_cmd), shell=True)
12
13 def teardown(self):
14diff --git a/jobs/stress.txt.in b/jobs/stress.txt.in
15index 5eae797..37f58f8 100644
16--- a/jobs/stress.txt.in
17+++ b/jobs/stress.txt.in
18@@ -77,6 +77,8 @@ estimated_duration: 5400.0
19 depends:
20 power-management/rtc
21 suspend/suspend_advanced
22+requires:
23+ executable.name == 'x-terminal-emulator'
24 flags: noreturn autorestart
25 user: root
26 command:
27@@ -250,6 +252,7 @@ id: stress/reboot_30
28 requires:
29 package.name == 'upstart'
30 package.name == 'fwts'
31+ executable.name == 'x-terminal-emulator'
32 command: pm_test --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox -r 30 --silent --log-level=notset reboot --log-dir=$PLAINBOX_SESSION_SHARE
33 flags: noreturn autorestart
34 estimated_duration: 2700
35@@ -273,8 +276,9 @@ estimated_duration: 4500.0
36 requires:
37 package.name == 'upstart'
38 package.name == 'fwts'
39-command: pm_test -r 100 --silent --log-level=notset poweroff --log-dir=$PLAINBOX_SESSION_SHARE
40-flags: noreturn
41+ executable.name == 'x-terminal-emulator'
42+command: pm_test --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox --r 100 --silent --log-level=notset poweroff --log-dir=$PLAINBOX_SESSION_SHARE
43+flags: noreturn autorestart
44 user: root
45 environ: PLAINBOX_SESSION_SHARE
46 _description:
47@@ -295,8 +299,9 @@ id: stress/poweroff_30
48 requires:
49 package.name == 'upstart'
50 package.name == 'fwts'
51-command: pm_test -r 30 --silent --log-level=notset poweroff --log-dir=$PLAINBOX_SESSION_SHARE
52-flags: noreturn
53+ executable.name == 'x-terminal-emulator'
54+command: pm_test --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox --r 30 --silent --log-level=notset poweroff --log-dir=$PLAINBOX_SESSION_SHARE
55+flags: noreturn autorestart
56 estimated_duration: 3600
57 user: root
58 environ: PLAINBOX_SESSION_SHARE

Subscribers

People subscribed via source and target branches