<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 href="mailto:taihsiang.ho@canonical.com" target="_blank">taihsiang.ho@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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><font size="1"><span style="font-family:monospace,monospace">===============================[ 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></font><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><font size="1"><span style="font-family:monospace,monospace">% 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></font><br></div><div><br><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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 href="mailto:pierre.equoy@canonical.com" target="_blank">pierre.equoy@canonical.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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 style="font-family:monospace,monospace">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 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 style="font-family:monospace,monospace"> 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 href="https://launchpad.net/plainbox-provider-checkbox/" target="_blank">https://launchpad.net/plainbox-provider-checkbox/</a><br>[2] <a 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 href="http://bazaar.launchpad.net/~checkbox-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><font color="#888888"><br clear="all"><div><div><br>-- <br><div><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(102,102,102)">Pierre Equoy<br>QA & Certification Engineer | Canonical<br><a href="http://www.canonical.com" target="_blank">www.canonical.com</a> | <a href="http://www.ubuntu.com" target="_blank">www.ubuntu.com</a></span></div></div></div></div>
</div></div></font></span></div></div>
<br></div></div><span class=""><font color="#888888">--<br>
Checkbox-devel mailing list<br>
<a href="mailto:Checkbox-devel@lists.ubuntu.com" target="_blank">Checkbox-devel@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/checkbox-devel" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/checkbox-devel</a><br>
<br></font></span></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(102,102,102)">Pierre Equoy<br>QA & Certification Engineer | Canonical<br><a href="http://www.canonical.com" target="_blank">www.canonical.com</a> | <a href="http://www.ubuntu.com" target="_blank">www.ubuntu.com</a></span></div></div></div></div>
</div></div></div>