How to test unit template jobs?

Taihsiang Ho taihsiang.ho at canonical.com
Mon Dec 28 09:45:34 UTC 2015


Did you apply "sudo" when you test the job?
If yes, sudo may use a different env so it could not find out the command.

On Mon, Dec 28, 2015 at 10:59 AM, Pierre Equoy <pierre.equoy at canonical.com>
wrote:

> Hi,
>
> I'm trying to migrate local jobs (e.g. from the checkbox provider [1]) to
> unit template jobs [2].
>
> For instance, I replaced the *hdparm* local job [3] with:
>
> unit: template
> template-unit: job
> template-resource: device
> template-filter: device.category == 'DISK'
> plugin: attachment
> category_id: 2013.com.canonical.plainbox::info
> id: info/hdparm_{name}.txt
> estimated_duration: 1.0
> requires:
>  package.name == 'hdparm'
>  device.path == '{path}'
>  block_device.{name}_state != 'removable'
> user: root
> command: hdparm -I /dev/{name}
>
> 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:
>
>     plainbox run -i "^.*info/hdparm.*$"
>
> (however, this command runs fine with current local job version of hdparm)
>
> What am I doing wrong? How to test unit template jobs?
>
> Thanks!
>
> [1] https://launchpad.net/plainbox-provider-checkbox/
> [2]
> http://plainbox.readthedocs.org/en/latest/manpages/plainbox-template-units.html#migrating-from-local-jobs
> [3]
> http://bazaar.launchpad.net/~checkbox-dev/checkbox/trunk/view/head:/providers/plainbox-provider-checkbox/jobs/info.txt.in#L212
>
> --
> Pierre Equoy
> QA & Certification Engineer | Canonical
> www.canonical.com | www.ubuntu.com
>
> --
> Checkbox-devel mailing list
> Checkbox-devel at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/checkbox-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/checkbox-devel/attachments/20151228/8b1da7ff/attachment.html>


More information about the Checkbox-devel mailing list