All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: yocto@yoctoproject.org
Subject: [[PATCHv2][autobuilder] 2/4] autobuilder/buildsteps: Add Toaster buildsteps.
Date: Mon, 22 Feb 2016 09:15:01 -0600	[thread overview]
Message-ID: <1456154103-13478-2-git-send-email-anibal.limon@linux.intel.com> (raw)
In-Reply-To: <1456154103-13478-1-git-send-email-anibal.limon@linux.intel.com>

Adds Toaster buildsteps for setup toaster environment (installs
requirements), start/stop a toaster instance and run tests.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
 .../autobuilder/buildsteps/ToasterRunTests.py      | 31 ++++++++++++++++++++
 .../autobuilder/buildsteps/ToasterSetupVenv.py     | 31 ++++++++++++++++++++
 .../autobuilder/buildsteps/ToasterStart.py         | 32 +++++++++++++++++++++
 .../autobuilder/buildsteps/ToasterStop.py          | 33 ++++++++++++++++++++++
 4 files changed, 127 insertions(+)
 create mode 100644 lib/python2.7/site-packages/autobuilder/buildsteps/ToasterRunTests.py
 create mode 100644 lib/python2.7/site-packages/autobuilder/buildsteps/ToasterSetupVenv.py
 create mode 100644 lib/python2.7/site-packages/autobuilder/buildsteps/ToasterStart.py
 create mode 100644 lib/python2.7/site-packages/autobuilder/buildsteps/ToasterStop.py

diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterRunTests.py b/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterRunTests.py
new file mode 100644
index 0000000..141768c
--- /dev/null
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterRunTests.py
@@ -0,0 +1,31 @@
+'''
+Created on Feb 15, 2016
+
+__author__ = "Anibal (alimon) Limon"
+__copyright__ = "Copyright 2016, Intel Corp."
+__credits__ = ["Anibal Limon"]
+__license__ = "GPL"
+__version__ = "2.0"
+__maintainer__ = "Anibal Limon"
+__email__ = "anibal.limon@linux.intel.com"
+'''
+
+from lib.buildsteps import ShellCommandCleanEnv
+import os
+
+class ToasterRunTests(ShellCommandCleanEnv):
+    haltOnFailure = True
+    flunkOnFailure = True
+    name = "ToasterRunTests"
+
+    def __init__(self, factory, argdict=None, **kwargs):
+        self.factory = factory
+        self.description = "Running toaster tests..."
+
+        oe_cmd = "source ./oe-init-build-env;"
+        venv_cmd = "source venv/bin/activate;"
+        cmd = "DISPLAY=:1 toaster-test --run-all-tests --verbose"
+
+        self.command = oe_cmd + venv_cmd + cmd
+
+        ShellCommandCleanEnv.__init__(self, factory, argdict, **kwargs)
diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterSetupVenv.py b/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterSetupVenv.py
new file mode 100644
index 0000000..54cf1e7
--- /dev/null
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterSetupVenv.py
@@ -0,0 +1,31 @@
+'''
+Created on Feb 15, 2016
+
+__author__ = "Anibal (alimon) Limon"
+__copyright__ = "Copyright 2016, Intel Corp."
+__credits__ = ["Anibal Limon"]
+__license__ = "GPL"
+__version__ = "2.0"
+__maintainer__ = "Anibal Limon"
+__email__ = "anibal.limon@linux.intel.com"
+'''
+
+from lib.buildsteps import ShellCommandCleanEnv
+
+class ToasterSetupVenv(ShellCommandCleanEnv):
+    haltOnFailure = True
+    flunkOnFailure = True
+    name = "ToasterSetupVenv"
+
+    def __init__(self, factory, argdict=None, **kwargs):
+        self.factory = factory
+        self.description = "Creating virtualenv..."
+
+        oe_cmd = "source ./oe-init-build-env;"
+        venv_cmd = "virtualenv venv; source venv/bin/activate;"
+        install_cmd = "pip install -r ../bitbake/toaster-requirements.txt;"
+        install_tests_cmd = "pip install -r ../bitbake/toaster-tests-requirements.txt;"
+
+        self.command = oe_cmd + venv_cmd + install_cmd + install_tests_cmd 
+
+        ShellCommandCleanEnv.__init__(self, factory, argdict, **kwargs)
diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterStart.py b/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterStart.py
new file mode 100644
index 0000000..14cf9db3
--- /dev/null
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterStart.py
@@ -0,0 +1,32 @@
+'''
+Created on Feb 15, 2016
+
+__author__ = "Anibal (alimon) Limon"
+__copyright__ = "Copyright 2016, Intel Corp."
+__credits__ = ["Anibal Limon"]
+__license__ = "GPL"
+__version__ = "2.0"
+__maintainer__ = "Anibal Limon"
+__email__ = "anibal.limon@linux.intel.com"
+'''
+
+from lib.buildsteps import ShellCommandCleanEnv
+import os
+
+class ToasterStart(ShellCommandCleanEnv):
+    haltOnFailure = True
+    flunkOnFailure = True
+    name = "ToasterStart"
+
+    def __init__(self, factory, argdict=None, **kwargs):
+        self.factory = factory
+        self.description = "Starting toaster..."
+
+        oe_cmd = "source ./oe-init-build-env;"
+        venv_cmd = "source venv/bin/activate;"
+        start_cmd = "../bitbake/lib/toaster/tests/helpers.py -a start" \
+            " -d $(readlink -e ../)"
+
+        self.command = oe_cmd + venv_cmd + start_cmd
+
+        ShellCommandCleanEnv.__init__(self, factory, argdict, **kwargs)
diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterStop.py b/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterStop.py
new file mode 100644
index 0000000..6fda0e8
--- /dev/null
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/ToasterStop.py
@@ -0,0 +1,33 @@
+'''
+Created on Feb 15, 2016
+
+__author__ = "Anibal (alimon) Limon"
+__copyright__ = "Copyright 2016, Intel Corp."
+__credits__ = ["Anibal Limon"]
+__license__ = "GPL"
+__version__ = "2.0"
+__maintainer__ = "Anibal Limon"
+__email__ = "anibal.limon@linux.intel.com"
+'''
+
+from lib.buildsteps import ShellCommandCleanEnv
+import os
+
+class ToasterStop(ShellCommandCleanEnv):
+    alwaysRun = True
+    haltOnFailure = True
+    flunkOnFailure = True
+    name = "ToasterStop"
+
+    def __init__(self, factory, argdict=None, **kwargs):
+        self.factory = factory
+        self.description = "Stopping toaster..."
+
+        oe_cmd = "source ./oe-init-build-env;"
+        venv_cmd = "source venv/bin/activate;"
+        start_cmd = "../bitbake/lib/toaster/tests/helpers.py -a stop" \
+            " -d $(readlink -e ../)"
+
+        self.command = oe_cmd + venv_cmd + start_cmd
+
+        ShellCommandCleanEnv.__init__(self, factory, argdict, **kwargs)
-- 
2.1.4



  reply	other threads:[~2016-02-22 15:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22 15:15 [[PATCHv2][autobuilder] 1/4] autobuilder/lib: Add buildsteps module for provide helpers Aníbal Limón
2016-02-22 15:15 ` Aníbal Limón [this message]
2016-02-22 15:15 ` [[PATCHv2][autobuilder] 3/4] buildset-config.toaster: Add toaster-tests.conf buildset Aníbal Limón
2016-02-22 15:15 ` [[PATCHv2][autobuilder] 4/4] buildset-config.toaster: Remove unused template toaster-build Aníbal Limón
2016-02-22 15:37   ` Flanagan, Elizabeth
2016-02-22 15:47     ` 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=1456154103-13478-2-git-send-email-anibal.limon@linux.intel.com \
    --to=anibal.limon@linux.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.