<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hello,<br>
<br>
To test template jobs using the "plainbox run" command you have to
select the resource job that generates the new jobs.<br>
<br>
for example: plainbox run -i .*<span>block_device -i </span>"^.*info/hdparm.*$"<br>
<br>
Sylvain<br>
<br>
On 29/12/2015 07:22, Pierre Equoy wrote:<br>
</div>
<blockquote
cite="mid:CAOVkrr-QboSG-NDALbMfb=9EeZw_zF8F1YjUO5Pj7hUTfakfvA@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<div dir="ltr">Hey Tai,<br>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Dec 28, 2015 at 5:45 PM,
Taihsiang Ho <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:taihsiang.ho@canonical.com"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:taihsiang.ho@canonical.com">taihsiang.ho@canonical.com</a></a>></span>
wrote:<br>
<blockquote class="gmail_quote">
<div dir="ltr">Did you apply "sudo" when you test the
job?
<div>If yes, sudo may use a different env so it could
not find out the command.</div>
</div>
</blockquote>
<div><br>
</div>
<div>No, I'm not using sudo to run plainbox.<br>
<br>
</div>
<div>To provide a bit more info, here is the output I get
when I run<br>
<br>
plainbox run -i "^.*info/hdparm.*$"<br>
<br>
</div>
<div>with the current local job:<br>
<br>
<span>===============================[ Analyzing Jobs
]===============================<br>
=============================[ Session Statistics
]=============================<br>
This session is about 0.00% complete<br>
Estimated duration is 2.64 for automated jobs.<br>
Estimated duration cannot be determined for manual
jobs.<br>
Size of the desired job list: 1<br>
Size of the effective execution plan: 3<br>
===========================[ Running Selected Jobs
]============================<br>
--------------[ Running job 1 / 3. Estimated time
left: 0:00:03 ]---------------<br>
-----------[ Collect information about installed
software packages ]------------<br>
ID: 2013.com.canonical.certification::package<br>
Category: 2013.com.canonical.plainbox::uncategorised<br>
(Command output hidden)<br>
Outcome: job passed<br>
--------------[ Running job 2 / 3. Estimated time
left: 0:00:01 ]---------------<br>
-------------[ Collect information about hardware
devices (udev) ]--------------<br>
ID: 2013.com.canonical.certification::device<br>
Category: 2013.com.canonical.plainbox::uncategorised<br>
(Command output hidden)<br>
Outcome: job passed<br>
--------------[ Running job 3 / 3. Estimated time
left: 0:00:01 ]---------------<br>
------------------------[ SATA/IDE device information.
]------------------------<br>
ID: 2013.com.canonical.certification::info/hdparm<br>
Category: 2013.com.canonical.plainbox::uncategorised<br>
(Command output hidden)<br>
Outcome: job passed<br>
--------------[ Running job 1 / 3. Estimated time
left: 0:00:02 ]---------------<br>
--------------------------------[ block_device
]--------------------------------<br>
ID: 2013.com.canonical.certification::block_device<br>
Category: 2013.com.canonical.plainbox::uncategorised<br>
(Command output hidden)<br>
Outcome: job passed<br>
--------------[ Running job 2 / 3. Estimated time
left: 0:00:02 ]---------------<br>
----------------------------[ info/hdparm_sda.txt
]-----------------------------<br>
ID:
2013.com.canonical.certification::info/hdparm_sda.txt<br>
Category: 2013.com.canonical.plainbox::info<br>
(Command output hidden)<br>
Outcome: job passed<br>
--------------[ Running job 3 / 3. Estimated time
left: 0:00:01 ]---------------<br>
----------------------------[ info/hdparm_sdb.txt
]-----------------------------<br>
ID:
2013.com.canonical.certification::info/hdparm_sdb.txt<br>
Category: 2013.com.canonical.plainbox::info<br>
(Command output hidden)<br>
Outcome: job passed<br>
==================================[ Results
]===================================<br>
 ☑ : Collect information about installed software
packages<br>
 ☑ : Collect information about hardware devices (udev)<br>
 ☑ : SATA/IDE device information.<br>
 ☑ : block_device<br>
 ☑ : info/hdparm_sda.txt<br>
 ☑ : info/hdparm_sdb.txt</span><br>
<br>
<br>
</div>
<div>And here is the output I get when I try to run the
same command with the new template unit I created to
replace the existing info/hdparm local job:<br>
<br>
<span>% plainbox run -i "^.*info/hdparm.*$"<br>
===============================[ Analyzing Jobs
]===============================<br>
=============================[ Session Statistics
]=============================<br>
This session is about 0.00% complete<br>
Estimated duration cannot be determined for automated
jobs.<br>
Estimated duration cannot be determined for manual
jobs.<br>
Size of the desired job list: 0<br>
Size of the effective execution plan: 0<br>
===========================[ Running Selected Jobs
]============================<br>
==================================[ Results
]===================================</span><br>
</div>
<div><br>
<br>
</div>
<div><br>
</div>
<div>Â </div>
<blockquote class="gmail_quote">
<div class="gmail_extra"><br>
<div class="gmail_quote">
<div>
<div class="h5">On Mon, Dec 28, 2015 at 10:59 AM,
Pierre Equoy <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:pierre.equoy@canonical.com"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:pierre.equoy@canonical.com">pierre.equoy@canonical.com</a></a>></span>
wrote:<br>
</div>
</div>
<blockquote class="gmail_quote">
<div>
<div class="h5">
<div dir="ltr">
<div>
<div>Hi,<br>
<br>
</div>
I'm trying to migrate local jobs (e.g.
from the checkbox provider [1]) to unit
template jobs [2].<br>
<br>
</div>
For instance, I replaced the <b><i>hdparm</i></b>
local job [3] with:<br>
<div><br>
<span>unit: template<br>
template-unit: job<br>
template-resource: device<br>
template-filter: device.category ==
'DISK'<br>
plugin: attachment<br>
category_id:
2013.com.canonical.plainbox::info<br>
id: info/hdparm_{name}.txt<br>
estimated_duration: 1.0<br>
requires:<br>
 <a moz-do-not-send="true"
href="http://package.name"
target="_blank">package.name</a> ==
'hdparm'<br>
 device.path == '{path}'<br>
 block_device.{name}_state !=
'removable'<br>
user: root<br>
command: hdparm -I /dev/{name}</span><br>
<br>
</div>
<div>My problem is I cannot find this job
afterwards! When I try to run plainbox to
run this job, it tells me there are no job
with the given pattern:<br>
<br>
<span>Â Â Â plainbox run -i
"^.*info/hdparm.*$"</span><br>
</div>
<div><br>
</div>
<div>(however, this command runs fine with
current local job version of hdparm)<br>
<br>
</div>
<div>What am I doing wrong? How to test unit
template jobs?<br>
<br>
</div>
<div>Thanks!<br>
</div>
<div><br>
[1] <a moz-do-not-send="true"
href="https://launchpad.net/plainbox-provider-checkbox/"
target="_blank">https://launchpad.net/plainbox-provider-checkbox/</a><br>
[2] <a moz-do-not-send="true"
href="http://plainbox.readthedocs.org/en/latest/manpages/plainbox-template-units.html#migrating-from-local-jobs"
target="_blank">http://plainbox.readthedocs.org/en/latest/manpages/plainbox-template-units.html#migrating-from-local-jobs</a><br>
[3] <a moz-do-not-send="true"
href="http://bazaar.launchpad.net/%7Echeckbox-dev/checkbox/trunk/view/head:/providers/plainbox-provider-checkbox/jobs/info.txt.in#L212"
target="_blank">http://bazaar.launchpad.net/~checkbox-dev/checkbox/trunk/view/head:/providers/plainbox-provider-checkbox/jobs/info.txt.in#L212</a><span><br>
<div>
<div><br>
-- <br>
<div>
<div dir="ltr">
<div>
<div dir="ltr"><span>Pierre
Equoy<br>
QA & Certification
Engineer | Canonical<br>
<a moz-do-not-send="true"
href="http://www.canonical.com" target="_blank">www.canonical.com</a> |
<a moz-do-not-send="true"
href="http://www.ubuntu.com" target="_blank">www.ubuntu.com</a></span></div>
</div>
</div>
</div>
</div>
</div>
</span></div>
</div>
<br>
</div>
</div>
<span class="">--<br>
Checkbox-devel mailing list<br>
<a moz-do-not-send="true"
href="mailto:Checkbox-devel@lists.ubuntu.com"
target="_blank">Checkbox-devel@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a
moz-do-not-send="true"
href="https://lists.ubuntu.com/mailman/listinfo/checkbox-devel"
rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="https://lists.ubuntu.com/mailman/listinfo/checkbox-devel">https://lists.ubuntu.com/mailman/listinfo/checkbox-devel</a></a><br>
<br>
</span></blockquote>
</div>
<br>
</div>
</blockquote>
</div>
<br>
<br>
<br>
-- <br>
<div class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr"><span>Pierre Equoy<br>
QA & Certification Engineer | Canonical<br>
<a moz-do-not-send="true"
href="http://www.canonical.com" target="_blank">www.canonical.com</a>
| <a moz-do-not-send="true"
href="http://www.ubuntu.com" target="_blank">www.ubuntu.com</a></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>