[yocto] [yocto-autobuilder][PATCH 1/3] RunSanityTests: add support for the new testimage class

Stefan Stanacar stefanx.stanacar at intel.com
Wed Jul 10 10:32:35 PDT 2013


Now that the new qemu testimage class has been merged in master,
we should use it instead of the old one.
We use "suites" keyword to overwrite the default tests (which are
defined in the class) and "suitesappend" to append to the default list
for special cases (like systemd images)

[YOCTO #4838]

Signed-off-by: Stefan Stanacar <stefanx.stanacar at intel.com>
---
 .../autobuilder/buildsteps/RunSanityTests.py       | 27 ++++++++++++++++------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/RunSanityTests.py b/lib/python2.7/site-packages/autobuilder/buildsteps/RunSanityTests.py
index 82fb044..a8948d7 100644
--- a/lib/python2.7/site-packages/autobuilder/buildsteps/RunSanityTests.py
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/RunSanityTests.py
@@ -24,23 +24,36 @@ class RunSanityTests(ShellCommand):
         self.factory = factory
         self.images=""
         self.scene=None
+        self.suites=None
+        self.suitesappend=None
         # the default of 1200 seconds is enough for running sanity tests in most cases
         self.timeout = 1200
         for k, v in argdict.iteritems():
             setattr(self, k, v)
         self.description = "Running Sanity Tests"
+        kwargs['timeout']=self.timeout
+        ShellCommand.__init__(self, **kwargs)
+
+    def start(self):
+        branch = self.getProperty("branch_poky")
         command = ""
         command = command + ". ./oe-init-build-env; "
         command = command + "(echo > /dev/tcp/localhost/5901) 2> /dev/null;"
         command = command + 'if [ $? -ne 0 ]; then echo "Starting a VNC server on :1"; vncserver :1; else echo "Will use a VNC server already running on :1"; fi;'
-        command = command + "echo 'IMAGETEST = \"qemu\"' >> ./conf/auto.conf;"
-        if self.scene:
-            command = command + "echo 'TEST_SCEN = \"" + self.scene + "\"'" + " >> ./conf/auto.conf;"
-        command = command + "DISPLAY=localhost:1 bitbake " + self.images + " -c qemuimagetest_standalone"
-        # Timeout needs to be passed to LoggingBuildStep as a kwarg
-        kwargs['timeout']=self.timeout
+        if "danny" not in branch and "dylan" not in branch:
+            command = command + "echo 'INHERIT += \"testimage\"' >> ./conf/auto.conf;"
+            if self.suites:
+                command = command + "echo 'TEST_SUITES = \"" + self.suites + "\"'" + " >> ./conf/auto.conf;"
+            if self.suitesappend:
+                command = command + "echo 'TEST_SUITES_append = \" " + self.suitesappend + "\"'" + " >> ./conf/auto.conf;"
+            command = command + "DISPLAY=:1 bitbake " + self.images + " -c testimage"
+        else:
+            command = command + "echo 'IMAGETEST = \"qemu\"' >> ./conf/auto.conf;"
+            if self.scene:
+                command = command + "echo 'TEST_SCEN = \"" + self.scene + "\"'" + " >> ./conf/auto.conf;"
+            command = command + "DISPLAY=localhost:1 bitbake " + self.images + " -c qemuimagetest_standalone"
         self.command = command
-        ShellCommand.__init__(self, **kwargs)
+        ShellCommand.start(self)
 
     def describe(self, done=False):
         description = ShellCommand.describe(self,done)
-- 
1.8.1.4




More information about the yocto mailing list