Skip to contentSkip to conversation

oe-selftest: Build wic runtime requirements and images before testing

PATCH Superseded Ed Bartosh 2 participants 3 messages May 21, 2015

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 oe-selftest: Build wic runtime requirements and images before testing

Some native tools (syslinux, parted, mtools, etc) are required by wic to produce images. Unit tests fail if the tools are not available.

Baked tools and image-core-minimal used by wic before running tests.

[YOCTO #7730]

---
 meta/lib/oeqa/selftest/wic.py | 6 ++++++
 1 file changed, 6 insertions(+)
meta/lib/oeqa/selftest/wic.py +6 -0
index c628b59..817685d 100644
@@ -36,6 +36,12 @@ class Wic(oeSelfTest):
 
     resultdir = "/var/tmp/wic/build/"
 
+    @classmethod
+    def setUpClass(cls):
+        """Build wic runtime dependencies and images used in the tests."""
+        runCmd('bitbake syslinux syslinux-native parted-native '
+               'dosfstools-native mtools-native core-image-minimal')
+
     def setUp(self):
         """This code is executed before each test method."""
         rmtree(self.resultdir, ignore_errors=True)
Signature · 1 line
2.1.4
#1 lore raw

Hi Ed,

Quoted 20 lines · On Thursday 21 May 2015 11:07:58 Ed Bartosh wrote:

Some native tools (syslinux, parted, mtools, etc) are required by wic to produce images. Unit tests fail if the tools are not available.

Baked tools and image-core-minimal used by wic before running tests.

[YOCTO #7730]

---
 meta/lib/oeqa/selftest/wic.py | 6 ++++++
 1 file changed, 6 insertions(+)
meta/lib/oeqa/selftest/wic.py +0 -0
index c628b59..817685d 100644
@@ -36,6 +36,12 @@ class Wic(oeSelfTest):
 
     resultdir = "/var/tmp/wic/build/"

meta/lib/oeqa/selftest/wic.py class Wic(oeSelfTest): · line 47

Quoted 10 lines
meta/lib/oeqa/selftest/wic.py +6 -0
 
+    @classmethod
+    def setUpClass(cls):
+        """Build wic runtime dependencies and images used in the tests."""
+        runCmd('bitbake syslinux syslinux-native parted-native '
+               'dosfstools-native mtools-native core-image-minimal')
+
     def setUp(self):
         """This code is executed before each test method."""
         rmtree(self.resultdir, ignore_errors=True)

FYI there is a bitbake() function in meta/lib/oeqa/utils/commands.py that I'd recomment using rather than runCmd() directly. Ultimately it ends up doing the same thing, but at least it keeps the details of how bitbake is invoked isolated from what your test needs to build.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
author
#2 lore raw

PATCH v2 1/1 oe-selftest: Build wic runtime requirements and images before testing

Some native tools (syslinux, parted, mtools, etc) are required by wic to produce images. Unit tests fail if the tools are not available.

Baked tools and image-core-minimal used by wic before running tests.

[YOCTO #7730]

---
 meta/lib/oeqa/selftest/wic.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/wic.py +7 -1
index c628b59..a2ce2cb 100644
@@ -29,13 +29,19 @@ from glob import glob
 from shutil import rmtree
 
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import runCmd
+from oeqa.utils.commands import runCmd, bitbake
 
 class Wic(oeSelfTest):
     """Wic test class."""
 
     resultdir = "/var/tmp/wic/build/"
 
+    @classmethod
+    def setUpClass(cls):
+        """Build wic runtime dependencies and images used in the tests."""
+        bitbake('syslinux syslinux-native parted-native '
+                'dosfstools-native mtools-native core-image-minimal')
+
     def setUp(self):
         """This code is executed before each test method."""
         rmtree(self.resultdir, ignore_errors=True)
Signature · 1 line
2.1.4