From: Joshua Lock <joshua.g.lock@linux.intel.com>
To: "Aníbal Limón" <anibal.limon@linux.intel.com>, yocto@yoctoproject.org
Cc: edwin.plauchu.camacho@linux.intel.com,
monserratx.sedeno.bustos@intel.com
Subject: Re: [yocto-autobuilder][PATCHv2 4/5] autobuilder/buildsteps: Add DAFTFlash buildstep
Date: Mon, 03 Jul 2017 15:03:20 +0100 [thread overview]
Message-ID: <1499090600.3470.12.camel@linux.intel.com> (raw)
In-Reply-To: <1496764011-3595-4-git-send-email-anibal.limon@linux.intel.com>
On Tue, 2017-06-06 at 10:46 -0500, Aníbal Limón wrote:
> This will execute daft flash cycle without reboot and prepare the dut
> for sanity tests.
>
> [YOCTO #10604]
>
> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
> Signed-off-by: Monserrat Sedeno <monserratx.sedeno.bustos.intel.com>
Typo in the email address here.
> Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>
> ---
> config/autobuilder.conf.example | 1 +
> .../autobuilder/buildsteps/DaftFlash.py | 42
> ++++++++++++++++++++++
> lib/python2.7/site-packages/autobuilder/config.py | 1 +
> 3 files changed, 44 insertions(+)
> create mode 100644 lib/python2.7/site-
> packages/autobuilder/buildsteps/DaftFlash.py
>
> diff --git a/config/autobuilder.conf.example
> b/config/autobuilder.conf.example
> index e5ec16b..2e992cf 100644
> --- a/config/autobuilder.conf.example
> +++ b/config/autobuilder.conf.example
> @@ -98,3 +98,4 @@ PERFORMANCE_MAIL_SIG = "Multiline\nSig\nLine"
>
> [Daft]
> DAFT_WORKER_DEVICES_CFG = "/etc/daft/devices.cfg"
> +DAFT_WORKER_WORKSPACE = "/home/ab/workspace"
> diff --git a/lib/python2.7/site-
> packages/autobuilder/buildsteps/DaftFlash.py b/lib/python2.7/site-
> packages/autobuilder/buildsteps/DaftFlash.py
> new file mode 100644
> index 0000000..d5f6de8
> --- /dev/null
> +++ b/lib/python2.7/site-packages/autobuilder/buildsteps/DaftFlash.py
> @@ -0,0 +1,42 @@
> +import os
> +
> +from autobuilder.config import DAFT_WORKER_WORKSPACE
> +from buildbot.steps.shell import ShellCommand
> +
> +class DaftFlash(ShellCommand):
> + haltOnFailure = True
> +
> + name = "DaftFlash"
> +
> + def __init__(self, factory, argdict=None, **kwargs):
> + self.tests = None
> + self.factory = factory
> + for k, v in argdict.iteritems():
> + setattr(self, k, v)
> + self.description = "DUT Flashing"
> + self.timeout = 100000
> + kwargs['timeout']=self.timeout
> + ShellCommand.__init__(self, **kwargs)
> +
> + def start(self):
> + workspace_dir = DAFT_WORKER_WORKSPACE
> +
> + dut_name = self.getProperty('dut_name')
> + workdir = self.getProperty('workdir')
> + image = self.getProperty('BUILDIMAGES')
Remember to fix this when you rename the property.
> + machine = self.getProperty('MACHINE')
> +
> + image_path = os.path.join(workdir, 'build', 'build', 'tmp',
> 'deploy',
> + 'images', machine, '%s-%s.hddimg' % (image,
> machine))
> + image_name = os.path.basename(image_path)
> +
> + # XXX: DAFT needs to have the image in a shared workspace
> + self.command = "cp %s %s; " % (image_path, workspace_dir)
> +
> + self.command += "cd %s; " % (workspace_dir)
> +
> + # XXX: DAFT needs to be executed by root user
Why's that? Is that an intrinsic requirement of DAFT or is it because
DAFT wants to use certain devices that are typically owned by root? Can
we instead make the requirement that the user running daft has
permissions and groups correctly configured to access these devices?
> + daft_cmd = "daft --setout %s %s" % (dut_name, image_name)
> + self.command += "sudo su -l -c 'cd {} && {}';
> ".format(workspace_dir, daft_cmd)
> +
> + ShellCommand.start(self)
> diff --git a/lib/python2.7/site-packages/autobuilder/config.py
> b/lib/python2.7/site-packages/autobuilder/config.py
> index 5bcf6c6..fcc08f0 100644
> --- a/lib/python2.7/site-packages/autobuilder/config.py
> +++ b/lib/python2.7/site-packages/autobuilder/config.py
> @@ -24,3 +24,4 @@ IPK_PUBLISH_DIR = os.environ.get("IPK_PUBLISH_DIR")
> DEB_PUBLISH_DIR = os.environ.get("DEB_PUBLISH_DIR")
> PERFORMANCE_PUBLISH_DIR = os.environ.get("PERFORMANCE_PUBLISH_DIR")
> DAFT_WORKER_DEVICES_CFG = os.environ.get("DAFT_WORKER_DEVICES_CFG")
> +DAFT_WORKER_WORKSPACE = os.environ.get("DAFT_WORKER_WORKSPACE")
next prev parent reply other threads:[~2017-07-03 14:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-06 15:46 [yocto-autobuilder][PATCHv2 1/5] buildsteps/BuildImages: Setproperty BUILDIMAGES Aníbal Limón
2017-06-06 15:46 ` [yocto-autobuilder][PATCHv2 2/5] buildsteps/RunSanityTests: Add support for simpleremote target Aníbal Limón
2017-06-06 15:46 ` [yocto-autobuilder][PATCHv2 3/5] autobuilder/buildsteps: Add DaftGetDevices step Aníbal Limón
2017-07-03 14:03 ` Joshua Lock
2017-07-03 16:34 ` Aníbal Limón
2017-06-06 15:46 ` [yocto-autobuilder][PATCHv2 4/5] autobuilder/buildsteps: Add DAFTFlash buildstep Aníbal Limón
2017-06-06 15:48 ` Aníbal Limón
2017-07-03 14:03 ` Joshua Lock [this message]
2017-07-03 16:37 ` Aníbal Limón
2017-07-03 18:23 ` Ylinen, Mikko
2017-07-03 19:14 ` Gonzalez Plascencia, Jair De Jesus
2017-06-06 15:46 ` [yocto-autobuilder][PATCHv2 5/5] buildset-config.yocto-qa: Add intel-corei7-64-daft buildset Aníbal Limón
2017-07-03 14:02 ` [yocto-autobuilder][PATCHv2 1/5] buildsteps/BuildImages: Setproperty BUILDIMAGES Joshua Lock
2017-07-03 16:34 ` Aníbal Limón
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1499090600.3470.12.camel@linux.intel.com \
--to=joshua.g.lock@linux.intel.com \
--cc=anibal.limon@linux.intel.com \
--cc=edwin.plauchu.camacho@linux.intel.com \
--cc=monserratx.sedeno.bustos@intel.com \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.