Merge lp:~zyga/checkbox/fix-1330359 into lp:checkbox

Proposed by Zygmunt Krynicki
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 3154
Merged at revision: 3150
Proposed branch: lp:~zyga/checkbox/fix-1330359
Merge into: lp:checkbox
Diff against target: 340 lines (+80/-30)
7 files modified
plainbox/plainbox/impl/ctrl.py (+9/-2)
plainbox/plainbox/impl/runner.py (+1/-1)
plainbox/plainbox/impl/session/test_resume.py (+45/-15)
plainbox/plainbox/impl/session/test_state.py (+1/-0)
plainbox/plainbox/impl/session/test_suspend.py (+21/-9)
plainbox/plainbox/impl/test_ctrl.py (+2/-2)
providers/plainbox-provider-checkbox/jobs/suspend.txt.in (+1/-1)
To merge this branch: bzr merge lp:~zyga/checkbox/fix-1330359
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Needs Resubmitting
Sylvain Pineau (community) Approve
Review via email: mp+223521@code.launchpad.net

Description of the change

deafbbd providers:checkbox: fix plugin type of _display_after_suspend_
5ab12f3 plainbox:ctrl: reject invalid generated jobs
f4164c1 plainbox:ctrl: use job.id to log problematic jobs
32004ae plainbox:runner: fix JobRunner._run_command when job.command is None

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

+1, thanks for the new validation step in that particular case

review: Approve
Revision history for this message
Daniel Manrique (roadmr) wrote :
Download full text (10.0 KiB)

The attempt to merge lp:~zkrynicki/checkbox/fix-1330359 into lp:checkbox failed. Below is the output from the failed tests.

[precise] starting container
[precise] (timing) 0.05user 0.02system 0:05.21elapsed 1%CPU (0avgtext+0avgdata 7860maxresident)k
[precise] (timing) 0inputs+32outputs (0major+6069minor)pagefaults 0swaps
[precise] provisioning container
[precise] (timing) 33.28user 10.27system 1:03.99elapsed 68%CPU (0avgtext+0avgdata 50900maxresident)k
[precise] (timing) 0inputs+16248outputs (0major+4242094minor)pagefaults 0swaps
[precise-testing] Starting tests...
Found a test script: ./checkbox-gui/requirements/container-tests-checkbox-gui-build
[precise-testing] container-tests-checkbox-gui-build: PASS
[precise-testing] (timing) 27.89user 2.20system 0:30.47elapsed 98%CPU (0avgtext+0avgdata 116380maxresident)k
[precise-testing] (timing) 0inputs+4224outputs (0major+478240minor)pagefaults 0swaps
Found a test script: ./checkbox-ng/requirements/container-tests-checkbox-ng-unit
[precise-testing] container-tests-checkbox-ng-unit: PASS
[precise-testing] (timing) 0.64user 0.13system 0:00.81elapsed 96%CPU (0avgtext+0avgdata 39060maxresident)k
[precise-testing] (timing) 0inputs+3152outputs (0major+19737minor)pagefaults 0swaps
Found a test script: ./checkbox-support/requirements/container-tests-checkbox-support
[precise-testing] container-tests-checkbox-support: PASS
[precise-testing] (timing) 15.42user 0.17system 0:16.25elapsed 95%CPU (0avgtext+0avgdata 86376maxresident)k
[precise-testing] (timing) 0inputs+664outputs (0major+31491minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/001-container-tests-plainbox-egg-info
[precise-testing] 001-container-tests-plainbox-egg-info: PASS
[precise-testing] (timing) 0.18user 0.01system 0:00.21elapsed 92%CPU (0avgtext+0avgdata 10368maxresident)k
[precise-testing] (timing) 0inputs+80outputs (0major+4957minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox
[precise-testing] container-tests-plainbox: FAIL
[precise-testing] stdout: http://paste.ubuntu.com/7663021/
[precise-testing] stderr: http://paste.ubuntu.com/7663022/
[precise-testing] (timing) Command exited with non-zero status 1
[precise-testing] (timing) 4.62user 0.28system 0:04.96elapsed 98%CPU (0avgtext+0avgdata 46216maxresident)k
[precise-testing] (timing) 0inputs+2320outputs (0major+43811minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox-documentation
[precise-testing] container-tests-plainbox-documentation: PASS
[precise-testing] (timing) 23.15user 0.39system 0:23.69elapsed 99%CPU (0avgtext+0avgdata 83492maxresident)k
[precise-testing] (timing) 0inputs+24024outputs (0major+31272minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox-integration
[precise-testing] container-tests-plainbox-integration: PASS
[precise-testing] (timing) 0.56user 0.18system 0:00.79elapsed 93%CPU (0avgtext+0avgdata 27248maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+25490minor)pagefaults 0swaps
Found a test script: ./providers...

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Ohh. I just ran manual tests, I guess that needs more work

On Wed, Jun 18, 2014 at 12:35 PM, Daniel Manrique <
<email address hidden>> wrote:

> The proposal to merge lp:~zkrynicki/checkbox/fix-1330359 into lp:checkbox
> has been updated.
>
> Status: Approved => Needs review
>
> For more details, see:
> https://code.launchpad.net/~zkrynicki/checkbox/fix-1330359/+merge/223521
> --
> https://code.launchpad.net/~zkrynicki/checkbox/fix-1330359/+merge/223521
> You are the owner of lp:~zkrynicki/checkbox/fix-1330359.
>

Revision history for this message
Daniel Manrique (roadmr) wrote :
Download full text (10.0 KiB)

The attempt to merge lp:~zkrynicki/checkbox/fix-1330359 into lp:checkbox failed. Below is the output from the failed tests.

[precise] starting container
[precise] (timing) 0.06user 0.01system 0:04.20elapsed 1%CPU (0avgtext+0avgdata 7864maxresident)k
[precise] (timing) 0inputs+32outputs (0major+5772minor)pagefaults 0swaps
[precise] provisioning container
[precise] (timing) 35.03user 11.14system 1:09.04elapsed 66%CPU (0avgtext+0avgdata 51180maxresident)k
[precise] (timing) 0inputs+16264outputs (0major+4237469minor)pagefaults 0swaps
[precise-testing] Starting tests...
Found a test script: ./checkbox-gui/requirements/container-tests-checkbox-gui-build
[precise-testing] container-tests-checkbox-gui-build: PASS
[precise-testing] (timing) 28.50user 2.07system 0:31.00elapsed 98%CPU (0avgtext+0avgdata 116380maxresident)k
[precise-testing] (timing) 0inputs+4224outputs (0major+478246minor)pagefaults 0swaps
Found a test script: ./checkbox-ng/requirements/container-tests-checkbox-ng-unit
[precise-testing] container-tests-checkbox-ng-unit: PASS
[precise-testing] (timing) 0.55user 0.12system 0:00.73elapsed 91%CPU (0avgtext+0avgdata 38972maxresident)k
[precise-testing] (timing) 0inputs+3152outputs (0major+19545minor)pagefaults 0swaps
Found a test script: ./checkbox-support/requirements/container-tests-checkbox-support
[precise-testing] container-tests-checkbox-support: PASS
[precise-testing] (timing) 13.33user 0.18system 0:13.57elapsed 99%CPU (0avgtext+0avgdata 82452maxresident)k
[precise-testing] (timing) 0inputs+664outputs (0major+30680minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/001-container-tests-plainbox-egg-info
[precise-testing] 001-container-tests-plainbox-egg-info: PASS
[precise-testing] (timing) 0.13user 0.03system 0:00.17elapsed 91%CPU (0avgtext+0avgdata 10364maxresident)k
[precise-testing] (timing) 0inputs+80outputs (0major+4950minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox
[precise-testing] container-tests-plainbox: FAIL
[precise-testing] stdout: http://paste.ubuntu.com/7742554/
[precise-testing] stderr: http://paste.ubuntu.com/7742555/
[precise-testing] (timing) Command exited with non-zero status 1
[precise-testing] (timing) 4.39user 0.33system 0:04.78elapsed 98%CPU (0avgtext+0avgdata 60712maxresident)k
[precise-testing] (timing) 0inputs+2320outputs (0major+45502minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox-documentation
[precise-testing] container-tests-plainbox-documentation: PASS
[precise-testing] (timing) 19.34user 0.36system 0:19.81elapsed 99%CPU (0avgtext+0avgdata 84200maxresident)k
[precise-testing] (timing) 0inputs+24024outputs (0major+31116minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox-integration
[precise-testing] container-tests-plainbox-integration: PASS
[precise-testing] (timing) 0.53user 0.10system 0:00.68elapsed 93%CPU (0avgtext+0avgdata 23272maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+25479minor)pagefaults 0swaps
Found a test script: ./providers...

lp:~zyga/checkbox/fix-1330359 updated
3102. By Jeff Lane 

"network script now determines max_speed from ethtool and link_speed from sys/class/net/DEV/speed for more accurate results. [r=roadmr][bug=1336320][author=bladernr]"

3103. By Daniel Manrique

"Fixes some problems with the network script (bug 1337537, a small problem with ethtool invocation, some minor string fixes). [r=bladernr][bug=1337537][author=roadmr]"

3104. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

3105. By Daniel Manrique

"checkbox-support:parsers:udevadm: Refine media card heuristics.

Per https://bugs.launchpad.net/checkbox-support/+bug/1337270, some SSD
hard drives have model names which made our card reader regular
expression mistake them for card readers (specifically the string mSATA
looked like a memory stick to our naive regex). This adds a simple
negative lookahead to ensure MS only matches if it's not followed
immediately by "ata". The regex is case-insensitive. [r=zkrynicki][bug=1337270][author=roadmr]"

3106. By Po-Hsu Lin

"automatic merge by tarmac [r=sylvain-pineau][bug=1331302][author=cypressyew]"

3107. By Sylvain Pineau

"automatic merge by tarmac [r=roadmr][bug=][author=sylvain-pineau]"

3108. By Sylvain Pineau

"automatic merge by tarmac [r=sylvain-pineau][bug=1331302][author=checkbox-dev]"

3109. By Daniel Manrique

"Fixes the requirement expression for power-management/tickless_idle. [r=bladernr][bug=1333624][author=roadmr]"

3110. By Chris Gregan

"automatic merge by tarmac [r=roadmr][bug=][author=cgregan]"

3111. By Mike Rushton

"added ipv6 support via bug 1013273 [r=roadmr][bug=1013273][author=leftyfb]"

3112. By Sylvain Pineau

"automatic merge by tarmac [r=sylvain-pineau][bug=][author=sylvain-pineau]"

3113. By Jeff Lane 

"automatic merge by tarmac [r=roadmr][bug=][author=bladernr]"

3114. By Sylvain Pineau

"automatic merge by tarmac [r=sylvain-pineau][bug=][author=sylvain-pineau]"

3115. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

3116. By Daniel Manrique

" checkbox-support:parsers:submission: Be smarter about EFI parsing.

    As seen in
    https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1334131 the
    submission parser blindly invokes the UEFI/BIOS subparser on any
    attachment that contains the string 'UEFI'. This converts the simple "X
    in Y" matching into regular expression matching, then adds a negative
    lookahead to the string for EFI attachments, to ensure we don't parse
    the "uefirtvariable" one by mistake.

    Adding this kind of specificity in the submission parser is somewhat
    kludgy, but the context parser selection is already very hardcoded and
    based on odd heuristics, so in a sense it's consistent.
 [r=zkrynicki][bug=1334131][author=roadmr]"

3117. By Daniel Manrique

" providers:checkbox: Fix template and exception handling in xrandr_cycle

    The script now looks for its template file in several locations, is more
    strict with exception handling, and provides better error messages if
    things don't work as expected.

    Due to bin/lib split in plainbox providers, it needs a bit of
    configuration to be run manually (i.e. from outside checkbox or
    plainbox), but the script will provide guidance on the environment
    variable to set for this to work.
 [r=zkrynicki][bug=1329728][author=roadmr]"

3118. By Daniel Manrique

"providers:plainbox: better output from gputest-based tests (LP: #1340674)
 [r=roadmr,zkrynicki][bug=1340674][author=roadmr]"

3119. By Sylvain Pineau

"automatic merge by tarmac [r=sylvain-pineau][bug=][author=sylvain-pineau]"

3120. By Jeff Lane 

"automatic merge by tarmac [r=roadmr][bug=1341769][author=bladernr]"

3121. By Sylvain Pineau

"automatic merge by tarmac [r=sylvain-pineau][bug=][author=sylvain-pineau]"

3122. By Daniel Manrique

"This implements the "unity disable hack" to properly test 3/4-finger tap gestures using Qt/QML.

bad7a00 providers:checkbox: updated multitouch test definitions to use the management script to disable/reenable Unity.
492741d providers:checkbox: Add manage_compiz_plugin script
 [r=zkrynicki][bug=][author=roadmr]"

3123. By Po-Hsu Lin

"automatic merge by tarmac [r=roadmr][bug=][author=cypressyew]"

3124. By Daniel Manrique

"f2c4dc2 checkbox-support: include and install cputable file
4b788a9 checkbox-support: use io.open in setup.py for compatibility with python 2.7

These allow the tar.gz produced with setup.py sdist for checkbox-support to be used in hexr, in place of checkbox-legacy/old.

 [r=zkrynicki][bug=][author=roadmr]"

3125. By Rod Smith

"automatic merge by tarmac [r=zkrynicki][bug=][author=rodsmith]"

3126. By Taihsiang Ho

"implement a smarter parser to get pci slot names from DEVPATH (LP: #1334991) [r=zkrynicki][bug=1334991][author=taihsiangho]"

3127. By Sylvain Pineau

"Release_2014_Week29 [r=sylvain-pineau][bug=1331302,1341769][author=checkbox-dev]"

3128. By Po-Hsu Lin

"automatic merge by tarmac [r=zkrynicki][bug=1346132][author=cypressyew]"

3129. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

3130. By Daniel Manrique

"providers:checkbox: Change some jobs from user-verify to user-interact-verify [r=apulido][bug=1340621][author=roadmr]"

3131. By Daniel Manrique

" providers:checkbox: Revamp of argument handling for network script.

    - Provide clearer message of where to configure settings.
    - Handle "partial" settings (i.e. test won't mysteriously exit if not
      all 4 values are provided, even if for the current test they're not
      all needed)
    - Remove support for the legacy /etc/checkbox.d files.

    https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1342304
    https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1309640
 [r=zkrynicki][bug=1309640,1342304][author=roadmr]"

3132. By Zygmunt Krynicki

"automatic merge by tarmac [r=roadmr][bug=][author=zkrynicki]"

3133. By Daniel Manrique

"providers:checkbox: Add interactive multitouch rotate test.
providers:checkbox: Add interactive multitouch zoom test. [r=zkrynicki,apulido][bug=][author=roadmr]"

3134. By Daniel Manrique

"This adds a new test (multitouch-rotate) and 3/4-finger autoverified tap testing to certification.
 [r=apulido][bug=][author=roadmr]"

3135. By Zygmunt Krynicki

"automatic merge by tarmac [r=roadmr][bug=][author=zkrynicki]"

3136. By Zygmunt Krynicki

"automatic merge by tarmac [r=sylvain-pineau][bug=][author=zkrynicki]"

3137. By Zygmunt Krynicki

"automatic merge by tarmac [r=sylvain-pineau][bug=][author=zkrynicki]"

3138. By Zygmunt Krynicki

"automatic merge by tarmac [r=roadmr][bug=1296424][author=zkrynicki]"

3139. By Daniel Manrique

"providers:checkbox: Add the missing hdd_parking script from checkbox-legacy. [r=zkrynicki][bug=1347761][author=roadmr]"

3140. By Daniel Manrique

"checkbox-support:xrandr: fix incorrect external function name [r=sylvain-pineau][bug=1348583][author=roadmr]"

3141. By Chris Gregan

"automatic merge by tarmac [r=roadmr][bug=][author=cgregan]"

3142. By Daniel Manrique

"providers:checkbox: Add a simple screen capture job with matching attachment job.

Job uses gnome-screenshot to capture, then a simple base64 encoding to attach the screenshot.

 [r=zkrynicki][bug=1348539][author=roadmr]"

3143. By Daniel Manrique

" providers:checkbox: Added estimated_duration to some tests.

    I also took the opportunity to fix a few minor errors in test
    definitions. Mainly trailing whitespace but also a couple of mistakes in
    the tests themselves.

Tests fixed:
- A couple of user-verify changed to user-verify-interact
- A test for 100 network restarts was doing only 1 iteration.
- A log attachment test depended on its log producer passing, but if the log producer fails, the attacher won't attach the log file (thus no way to debug the problem). [r=zkrynicki][bug=1348289][author=roadmr]"

3144. By Daniel Manrique

"providers:checkbox: Fix a couple of jobs with duplicated estimated-duration

These weren't caught by tarmac tests, I need to figure out why, it would have saved one cycle and about 30 minutes of time :/ [r=roadmr][bug=][author=roadmr]"

3145. By Zygmunt Krynicki

"automatic merge by tarmac [r=roadmr][bug=1349598][author=zkrynicki]"

3146. By Daniel Manrique

"providers:checkbox: Added missing jobs to complete the 30-iteration reboot/poweroff set [r=cgregan][bug=][author=roadmr]"

3147. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I've fixed the tests. All of the required changes are now added to the first two patches (plainbox:session:resume: update resume examples and plainbox:session:resume: update suspend examples) and one minor change has been rolled into (plainbox:ctrl: use job.id to log problematic jobs)

review: Needs Resubmitting
lp:~zyga/checkbox/fix-1330359 updated
3148. By Zygmunt Krynicki

plainbox:session:suspend: update suspend examples

This patch updates suspend tests / example jobs to be valid job
definitions. This changes checksums and serialization data but is
otherwise harmless. It is required for the upcoming change that will
reject invalid generated jobs.

Signed-off-by: Zygmunt Krynicki <email address hidden>

3149. By Zygmunt Krynicki

plainbox:session:resume: update resume examples

This patch updates resume tests / example jobs to be valid job
definitions. It is required for the upcoming change that will reject
invalid generated jobs (on resume).

Signed-off-by: Zygmunt Krynicki <email address hidden>

3150. By Zygmunt Krynicki

plainbox:session:state: update generated job examples

This patch updates one test involving generated jobs handle a valid job
definition. It is required for the upcoming change that will reject
invalid generated jobs.

Signed-off-by: Zygmunt Krynicki <email address hidden>

3151. By Zygmunt Krynicki

providers:checkbox: fix plugin type of _display_after_suspend_

This job has no command so instead of plugin: user-interact-verify it
should be defined as plugin: manual

Signed-off-by: Zygmunt Krynicki <email address hidden>

3152. By Zygmunt Krynicki

plainbox:runner: fix JobRunner._run_command when job.command is None

When a job definition without a command manages to slip through the
validation subsystem and gets to be executed it would trigger an early
error code path where a DiskJobResult with io_log_filename of () (empty
tuple) to be generated. This would prevent such session from being
resumed later. Since this is an error case that should never happen
let's just raise an exception there instead.

Fixes: https://bugs.launchpad.net/plainbox/+bug/1330359

Signed-off-by: Zygmunt Krynicki <email address hidden>

3153. By Zygmunt Krynicki

plainbox:ctrl: reject invalid generated jobs

This patch changes the session state controller to validate all generated
jobs and rejects jobs that don't pass validation. This prevents broken
jobs to be passed to execution where more and more code assumes jobs with
proper data inside.

Signed-off-by: Zygmunt Krynicki <email address hidden>

3154. By Zygmunt Krynicki

plainbox:ctrl: use job.id to log problematic jobs

str(job) is a rather verbose, translated string so it may be difficult
to understand in diagnostic output.

Signed-off-by: Zygmunt Krynicki <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plainbox/plainbox/impl/ctrl.py'
2--- plainbox/plainbox/impl/ctrl.py 2014-06-11 16:21:46 +0000
3+++ plainbox/plainbox/impl/ctrl.py 2014-07-30 09:39:44 +0000
4@@ -59,6 +59,7 @@
5 from plainbox.impl.secure.rfc822 import RFC822SyntaxError
6 from plainbox.impl.secure.rfc822 import gen_rfc822_records
7 from plainbox.impl.session.jobs import JobReadinessInhibitor
8+from plainbox.impl.validation import ValidationError
9 from plainbox.vendor import extcmd
10
11 __all__ = [
12@@ -264,7 +265,13 @@
13 new_job_list = []
14 for record in gen_rfc822_records_from_io_log(job, result):
15 new_job = job.create_child_job_from_record(record)
16- new_job_list.append(new_job)
17+ try:
18+ new_job.validate()
19+ except ValidationError as exc:
20+ logger.error(_("Ignoring invalid generated job %s: %s"),
21+ new_job.id, exc)
22+ else:
23+ new_job_list.append(new_job)
24 # Then for each new job, add it to the job_list, unless it collides
25 # with another job with the same id.
26 for new_job in new_job_list:
27@@ -315,7 +322,7 @@
28 # TRANSLATORS: keep the word "local" untranslated. It is a
29 # special type of job that needs to be distinguished.
30 _("local script %s returned invalid RFC822 data: %s"),
31- job, exc)
32+ job.id, exc)
33
34
35 checkbox_session_state_ctrl = CheckBoxSessionStateController()
36
37=== modified file 'plainbox/plainbox/impl/runner.py'
38--- plainbox/plainbox/impl/runner.py 2014-05-30 01:01:01 +0000
39+++ plainbox/plainbox/impl/runner.py 2014-07-30 09:39:44 +0000
40@@ -716,7 +716,7 @@
41 """
42 # Bail early if there is nothing do do
43 if job.command is None:
44- return None, ()
45+ raise ValueError(_("job {0} has no command to run").format(job.id))
46 # Get an extcmd delegate for observing all the IO the way we need
47 delegate, io_log_gen = self._prepare_io_handling(job, config)
48 # Create a subprocess.Popen() like object that uses the delegate
49
50=== modified file 'plainbox/plainbox/impl/session/test_resume.py'
51--- plainbox/plainbox/impl/session/test_resume.py 2014-04-30 19:23:25 +0000
52+++ plainbox/plainbox/impl/session/test_resume.py 2014-07-30 09:39:44 +0000
53@@ -205,11 +205,11 @@
54 'e2475434e4c0b2c825541430e526fe0565780dfeb67'
55 '050f3b7f3453aa3cc439b'),
56 'generator': (
57- 'b2aa7b7c4298678cebfdbe30f4aae5be97d320910a5'
58- 'b4dd312606099f35c03b6'),
59+ '7015c949ce3ae91f37e10b304212022fdbc4b10acbc'
60+ 'cb78ac58ff10ef7a2c8c8'),
61 'generated': (
62- '57b395e91bb4af94143eb19586bd18e4013efc5e60d'
63- '6050d9ec0bea15dd19489'),
64+ '47dd5e318ef99184e4dee8adf818a7f7548978a9470'
65+ '8114c7b3dd2169b9a7a67')
66 },
67 'results': {
68 '__category__': [{
69@@ -217,7 +217,8 @@
70 'execution_duration': None,
71 'io_log': [
72 [0.0, 'stdout', 'cGx1Z2luOmxvY2FsCg=='],
73- [0.1, 'stdout', 'aWQ6Z2VuZXJhdG9yCg==']],
74+ [0.1, 'stdout', 'aWQ6Z2VuZXJhdG9yCg=='],
75+ [0.2, 'stdout', 'Y29tbWFuZDpmYWtlCg==']],
76 'outcome': None,
77 'return_code': None,
78 }],
79@@ -225,7 +226,9 @@
80 'comments': None,
81 'execution_duration': None,
82 'io_log': [
83- [0.0, 'stdout', 'aWQ6Z2VuZXJhdGVk']],
84+ [0.0, 'stdout', 'aWQ6Z2VuZXJhdGVk'],
85+ [0.1, 'stdout', 'cGx1Z2luOnNoZWxs'],
86+ [0.2, 'stdout', 'Y29tbWFuZDpmYWtl']],
87 'outcome': None,
88 'return_code': None,
89 }],
90@@ -272,7 +275,8 @@
91 # Create a "generator" job
92 self.generator_job = JobDefinition({
93 "plugin": "local",
94- "id": "generator"
95+ "id": "generator",
96+ "command": "fake",
97 })
98 # Keep a variable for the (future) generated job
99 self.generated_job = None
100@@ -282,12 +286,17 @@
101 "io_log": [
102 (0.0, "stdout", b'plugin:local\n'),
103 (0.1, "stdout", b'id:generator\n'),
104+ (0.2, "stdout", b'command:fake\n'),
105 ]
106 })
107 # Create a result for the "generator" job.
108 # It will define the "generated" job
109 self.generator_result = MemoryJobResult({
110- "io_log": [(0.0, 'stdout', b'id:generated')]
111+ "io_log": [
112+ (0.0, 'stdout', b'id:generated'),
113+ (0.1, 'stdout', b'plugin:shell'),
114+ (0.2, 'stdout', b'command:fake'),
115+ ]
116 })
117 self.job_list = [self.category_job, self.generator_job]
118 self.suspend_data = gzip.compress(
119@@ -1416,10 +1425,9 @@
120 """
121 verify that _process_job() recreates generated jobs
122 """
123- # Set the stage for testing. Setup a session with a known
124- # local job, representation of the job (checksum)
125- # and representation of a single result, which has a single line
126- # that defines a 'id': 'generated' job.
127+ # Set the stage for testing. Setup a session with a known local job,
128+ # representation of the job (checksum) and representation of a single
129+ # result, which has a trivial definition for a 'generated' job.
130 job_id = 'local'
131 job = make_job(id=job_id, plugin='local')
132 jobs_repr = {
133@@ -1434,6 +1442,12 @@
134 'io_log': [
135 [0.0, 'stdout', base64.standard_b64encode(
136 b'id: generated'
137+ ).decode('ASCII')],
138+ [0.1, 'stdout', base64.standard_b64encode(
139+ b'plugin: shell'
140+ ).decode('ASCII')],
141+ [0.2, 'stdout', base64.standard_b64encode(
142+ b'command: fake'
143 ).decode('ASCII')]
144 ],
145 }]
146@@ -1529,7 +1543,7 @@
147 # We don't actually introduce it into the resume machinery
148 # caveat: make_job() has a default value for
149 # plugin='dummy' which we don't want here
150- child = make_job(id='child', plugin=None)
151+ child = make_job(id='child', plugin='shell', command='fake')
152 session_repr = {
153 'jobs': {
154 parent.id: parent.checksum,
155@@ -1546,6 +1560,12 @@
156 # to the 'child' job defined above.
157 [0.0, 'stdout', base64.standard_b64encode(
158 b'id: child\n'
159+ ).decode('ASCII')],
160+ [0.1, 'stdout', base64.standard_b64encode(
161+ b'plugin: shell\n'
162+ ).decode('ASCII')],
163+ [0.2, 'stdout', base64.standard_b64encode(
164+ b'command: fake\n'
165 ).decode('ASCII')]
166 ],
167 }],
168@@ -1581,10 +1601,11 @@
169 parent = make_job(id='c_parent', plugin='local')
170 # The child job is only here so that we can get the checksum.
171 # We don't actually introduce it into the resume machinery
172- child = make_job(id='b_child', plugin='local')
173+ child = make_job(id='b_child', plugin='local', command='fake')
174 # caveat: make_job() has a default value for
175 # plugin='dummy' which we don't want here
176- grandchild = make_job(id='a_grandchild', plugin=None)
177+ grandchild = make_job(id='a_grandchild', plugin='shell',
178+ command='fake')
179 session_repr = {
180 'jobs': {
181 parent.id: parent.checksum,
182@@ -1605,6 +1626,9 @@
183 ).decode('ASCII')],
184 [0.1, 'stdout', base64.standard_b64encode(
185 b'plugin: local\n'
186+ ).decode('ASCII')],
187+ [0.2, 'stdout', base64.standard_b64encode(
188+ b'command: fake\n'
189 ).decode('ASCII')]
190
191 ],
192@@ -1619,6 +1643,12 @@
193 # to the 'child' job defined above.
194 [0.0, 'stdout', base64.standard_b64encode(
195 b'id: a_grandchild\n'
196+ ).decode('ASCII')],
197+ [0.1, 'stdout', base64.standard_b64encode(
198+ b'plugin: shell\n'
199+ ).decode('ASCII')],
200+ [0.2, 'stdout', base64.standard_b64encode(
201+ b'command: fake\n'
202 ).decode('ASCII')]
203 ],
204 }],
205
206=== modified file 'plainbox/plainbox/impl/session/test_state.py'
207--- plainbox/plainbox/impl/session/test_state.py 2014-03-26 20:01:03 +0000
208+++ plainbox/plainbox/impl/session/test_state.py 2014-07-30 09:39:44 +0000
209@@ -615,6 +615,7 @@
210 'io_log': [
211 (0, 'stdout', b'id: foo\n'),
212 (1, 'stdout', b'plugin: manual\n'),
213+ (2, 'stdout', b'description: yada yada\n'),
214 ],
215 })
216 # Show this result to the session
217
218=== modified file 'plainbox/plainbox/impl/session/test_suspend.py'
219--- plainbox/plainbox/impl/session/test_suspend.py 2014-03-17 11:15:50 +0000
220+++ plainbox/plainbox/impl/session/test_suspend.py 2014-07-30 09:39:44 +0000
221@@ -326,7 +326,8 @@
222 # Create a "generator" job
223 self.generator_job = JobDefinition({
224 "plugin": "local",
225- "id": "generator"
226+ "id": "generator",
227+ "command": "fake",
228 })
229 # Keep a variable for the (future) generated job
230 self.generated_job = None
231@@ -336,12 +337,17 @@
232 "io_log": [
233 (0.0, "stdout", b'plugin:local\n'),
234 (0.1, "stdout", b'id:generator\n'),
235+ (0.2, "stdout", b'command:fake\n'),
236 ]
237 })
238 # Create a result for the "generator" job.
239 # It will define the "generated" job
240 self.generator_result = MemoryJobResult({
241- "io_log": [(0.0, 'stdout', b'id:generated')]
242+ "io_log": [
243+ (0.0, 'stdout', b'id:generated'),
244+ (0.1, 'stdout', b'plugin:shell'),
245+ (0.2, 'stdout', b'command:fake'),
246+ ]
247 })
248 # Create a session that knows about the two jobs that exist
249 # directly as files (__category__ and generator)
250@@ -405,7 +411,8 @@
251 'return_code': None,
252 'io_log': [
253 [0.0, 'stdout', 'cGx1Z2luOmxvY2FsCg=='],
254- [0.1, 'stdout', 'aWQ6Z2VuZXJhdG9yCg==']
255+ [0.1, 'stdout', 'aWQ6Z2VuZXJhdG9yCg=='],
256+ [0.2, 'stdout', 'Y29tbWFuZDpmYWtlCg==']
257 ]
258 }]
259 )
260@@ -422,6 +429,8 @@
261 'return_code': None,
262 'io_log': [
263 [0.0, 'stdout', 'aWQ6Z2VuZXJhdGVk'],
264+ [0.1, 'stdout', 'cGx1Z2luOnNoZWxs'],
265+ [0.2, 'stdout', 'Y29tbWFuZDpmYWtl'],
266 ]
267 }]
268 )
269@@ -460,11 +469,11 @@
270 'e2475434e4c0b2c825541430e526fe0565780dfeb67'
271 '050f3b7f3453aa3cc439b'),
272 'generator': (
273- 'b2aa7b7c4298678cebfdbe30f4aae5be97d320910a5'
274- 'b4dd312606099f35c03b6'),
275+ '7015c949ce3ae91f37e10b304212022fdbc4b10acbc'
276+ 'cb78ac58ff10ef7a2c8c8'),
277 'generated': (
278- '57b395e91bb4af94143eb19586bd18e4013efc5e60d'
279- '6050d9ec0bea15dd19489'),
280+ '47dd5e318ef99184e4dee8adf818a7f7548978a9470'
281+ '8114c7b3dd2169b9a7a67')
282 },
283 'results': {
284 '__category__': [{
285@@ -472,7 +481,8 @@
286 'execution_duration': None,
287 'io_log': [
288 [0.0, 'stdout', 'cGx1Z2luOmxvY2FsCg=='],
289- [0.1, 'stdout', 'aWQ6Z2VuZXJhdG9yCg==']],
290+ [0.1, 'stdout', 'aWQ6Z2VuZXJhdG9yCg=='],
291+ [0.2, 'stdout', 'Y29tbWFuZDpmYWtlCg==']],
292 'outcome': None,
293 'return_code': None,
294 }],
295@@ -480,7 +490,9 @@
296 'comments': None,
297 'execution_duration': None,
298 'io_log': [
299- [0.0, 'stdout', 'aWQ6Z2VuZXJhdGVk']],
300+ [0.0, 'stdout', 'aWQ6Z2VuZXJhdGVk'],
301+ [0.1, 'stdout', 'cGx1Z2luOnNoZWxs'],
302+ [0.2, 'stdout', 'Y29tbWFuZDpmYWtl']],
303 'outcome': None,
304 'return_code': None,
305 }],
306
307=== modified file 'plainbox/plainbox/impl/test_ctrl.py'
308--- plainbox/plainbox/impl/test_ctrl.py 2014-06-11 16:22:07 +0000
309+++ plainbox/plainbox/impl/test_ctrl.py 2014-07-30 09:39:44 +0000
310@@ -279,7 +279,7 @@
311 # Ensure that a warning was logged
312 mock_logger.warning.assert_called_once_with(
313 "local script %s returned invalid RFC822 data: %s",
314- job, RFC822SyntaxError(
315+ job.id, RFC822SyntaxError(
316 None, 1, "Unexpected non-empty line: 'barf\\n'"))
317
318 @mock.patch('plainbox.impl.ctrl.gen_rfc822_records_from_io_log')
319@@ -457,7 +457,7 @@
320 # Ensure that a warning was logged
321 mock_logger.warning.assert_called_once_with(
322 "local script %s returned invalid RFC822 data: %s",
323- job, RFC822SyntaxError(
324+ job.id, RFC822SyntaxError(
325 None, 3, "Unexpected non-empty line: 'error\\n'"))
326
327
328
329=== modified file 'providers/plainbox-provider-checkbox/jobs/suspend.txt.in'
330--- providers/plainbox-provider-checkbox/jobs/suspend.txt.in 2014-07-21 15:33:35 +0000
331+++ providers/plainbox-provider-checkbox/jobs/suspend.txt.in 2014-07-30 09:39:44 +0000
332@@ -465,7 +465,7 @@
333 plugin: local
334 command:
335 cat <<'EOF' | run_templates -t -s 'graphics_card_resource'
336- plugin: user-interact-verify
337+ plugin: manual
338 id: suspend/`echo ${index}`_display_after_suspend_`echo "${product}" | sed 's/ /_/g;s/[^_a-zA-Z0-9-]//g'`
339 depends: suspend/suspend_advanced
340 _summary: Test display function after suspend for $product

Subscribers

People subscribed via source and target branches