<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 04/01/2016 10:45, Pierre Equoy
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAOVkrr-FLbzOY6AoprmTURxS-f-kTY4aEBQ5s5a2SPRx1Xro1w@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Mon, Jan 4, 2016 at 4:43 PM,
            Sylvain Pineau <span dir="ltr"><<a
                moz-do-not-send="true"
                href="mailto:sylvain.pineau@canonical.com"
                target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:sylvain.pineau@canonical.com">sylvain.pineau@canonical.com</a></a>></span>
            wrote:<br>
            <blockquote class="gmail_quote">
              <div>
                <div>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.*$"<span
                    class="HOEnZb"><br>
                  </span></div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>Thanks for this, it should help a lot!<br>
              <br>
            </div>
            <div>Generally speaking, how to know what resource job
              generates what template job(s)?<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    Juts look at the job definition, the resource job is mentioned in
    the field <code class="docutils literal"><span class="pre"><span
          class="highlighted">template</span>-resource<br>
        <br>
        More info here:<br>
      </span></code><a class="moz-txt-link-freetext" href="http://plainbox.readthedocs.org/en/latest/manpages/plainbox-template-units.html?highlight=template#template-specific-fields">http://plainbox.readthedocs.org/en/latest/manpages/plainbox-template-units.html?highlight=template#template-specific-fields</a><br>
    <blockquote
cite="mid:CAOVkrr-FLbzOY6AoprmTURxS-f-kTY4aEBQ5s5a2SPRx1Xro1w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div><br>
               </div>
            <blockquote class="gmail_quote">
              <div>
                <div><span class="HOEnZb"> <br>
                    Sylvain</span>
                  <div>
                    <div class="h5"><br>
                      <br>
                      On 29/12/2015 07:22, Pierre Equoy wrote:<br>
                    </div>
                  </div>
                </div>
                <div>
                  <div class="h5">
                    <blockquote type="cite">
                      <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">taihsiang.ho@canonical.com</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>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>
                                          <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"><a class="moz-txt-link-freetext" href="https://launchpad.net/plainbox-provider-checkbox/">https://launchpad.net/plainbox-provider-checkbox/</a></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"><a class="moz-txt-link-freetext" href="http://plainbox.readthedocs.org/en/latest/manpages/plainbox-template-units.html#migrating-from-local-jobs">http://plainbox.readthedocs.org/en/latest/manpages/plainbox-template-units.html#migrating-from-local-jobs</a></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"><a class="moz-txt-link-freetext" href="http://bazaar.launchpad.net/~checkbox-dev/checkbox/trunk/view/head:/providers/plainbox-provider-checkbox/jobs/info.txt.in#L212">http://bazaar.launchpad.net/~checkbox-dev/checkbox/trunk/view/head:/providers/plainbox-provider-checkbox/jobs/info.txt.in#L212</a></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"><a class="moz-txt-link-abbreviated" href="http://www.canonical.com">www.canonical.com</a></a> |
                                                          <a
                                                          moz-do-not-send="true"
href="http://www.ubuntu.com" target="_blank"><a class="moz-txt-link-abbreviated" href="http://www.ubuntu.com">www.ubuntu.com</a></a></span></div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </span></div>
                                          </div>
                                          <br>
                                        </div>
                                      </div>
                                      <span>--<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"
                                          target="_blank">https://lists.ubuntu.com/mailman/listinfo/checkbox-devel</a><br>
                                        <br>
                                      </span></blockquote>
                                  </div>
                                  <br>
                                </div>
                              </blockquote>
                            </div>
                            <br>
                            <br>
                            <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>
                      </div>
                      <br>
                      <fieldset></fieldset>
                      <br>
                    </blockquote>
                    <br>
                  </div>
                </div>
              </div>
              <br>
              --<br>
              Checkbox-devel mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:Checkbox-devel@lists.ubuntu.com">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>
            </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>
    </blockquote>
    <br>
  </body>
</html>