[yocto] [[PATCH][autobuilder] 5/8] buildsteps/ToasterRunTests.py: Add step for run toaster tests. buildset-config.toaster/toaster-tests.conf: Add ToasterRunTests step.

Aníbal Limón anibal.limon at linux.intel.com
Fri Feb 19 08:14:46 PST 2016


Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
---
 buildset-config.toaster/toaster-tests.conf         |  1 +
 .../autobuilder/buildsteps/ToasterRunTests.py      | 31 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 lib/python2.7/site-packages/autobuilder/buildsteps/ToasterRunTests.py

diff --git a/buildset-config.toaster/toaster-tests.conf b/buildset-config.toaster/toaster-tests.conf
index 22ac176..c471c92 100644
--- a/buildset-config.toaster/toaster-tests.conf
+++ b/buildset-config.toaster/toaster-tests.conf
@@ -15,5 +15,6 @@ steps: [{'SetDest':{}},
         {'GetBitbakeVersion': {}},
 	{'ToasterSetupVenv': {}},
 	{'ToasterStart': {}},
+	{'ToasterRunTests': {}},
 	{'ToasterStop': {}},
        ]
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..392b600
--- /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 at 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;"
+
+        self.command = oe_cmd + venv_cmd + cmd
+
+        ShellCommandCleanEnv.__init__(self, factory, argdict, **kwargs)
-- 
2.1.4




More information about the yocto mailing list