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.li...@linux.intel.com> Signed-off-by: Edwin Plauchu <edwin.plauchu.cama...@intel.com> --- config/autobuilder.conf.example | 1 + .../autobuilder/buildsteps/DaftFlash.py | 39 ++++++++++++++++++++++ lib/python2.7/site-packages/autobuilder/config.py | 1 + 3 files changed, 41 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 565a1a31b30..2bda57add83 100644 --- a/config/autobuilder.conf.example +++ b/config/autobuilder.conf.example @@ -99,3 +99,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 00000000000..daf9c374398 --- /dev/null +++ b/lib/python2.7/site-packages/autobuilder/buildsteps/DaftFlash.py @@ -0,0 +1,39 @@ +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') + 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) + daft_cmd = "daft --setout %s %s" % (dut_name, image_name) + self.command += "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 5bcf6c6ff9d..fcc08f0a591 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") -- 2.11.0 -- _______________________________________________ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto