[oe-commits] [openembedded-core] 22/22: oeqa/selftest/kernel.py: Add new file destined for kernel related tests

git at git.openembedded.org git at git.openembedded.org
Sun Oct 30 10:25:01 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit ba547cd7ec24f0deaf0cd104772ec2f938e3d06b
Author: Costin Constantin <costin.c.constantin at intel.com>
AuthorDate: Mon Feb 29 12:38:02 2016 +0200

    oeqa/selftest/kernel.py: Add new file destined for kernel related tests
    
    [YP#7202]:  Test for linux-dummy
    The new kernel.py file is intended for kernel related test cases.
    The test for linux-dummy will ensure it is in good shape and can
    be used as a kernel replacement at build time. To do this, the
    test will first clean sstate for linux-dummy target, ensuring no
    file is present in the stamps directory. After, core-image-minimal
    is built, ensuring linux-dummy can be used as a kernel substitute.
    
    Signed-off-by: Costin Constantin <costin.c.constantin at intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/lib/oeqa/selftest/kernel.py | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/meta/lib/oeqa/selftest/kernel.py b/meta/lib/oeqa/selftest/kernel.py
new file mode 100644
index 0000000..3fe3517
--- /dev/null
+++ b/meta/lib/oeqa/selftest/kernel.py
@@ -0,0 +1,29 @@
+import os
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
+
+class KernelTests(oeSelfTest):
+    def  test_dummy_kernel(self):
+        """
+        [YP#7202]
+        - test that linux-dummy target can be used as kernel provider for an image
+        - check no "multiple providers are available for" message is received while building the image
+        """
+        config_param = 'PREFERRED_PROVIDER_virtual/kernel = "linux-dummy"'
+        self.append_config(config_param)
+        arch_dir = get_bb_var('MULTIMACH_TARGET_SYS', target='linux-dummy')
+        stamps_dir = os.path.join(os.getenv('BUILDDIR'), "tmp/stamps")
+        lnx_dmy_stamps_dir = os.path.join(stamps_dir, arch_dir, 'linux-dummy')
+        res = bitbake("linux-dummy -ccleansstate") # ensure we have nothing related to linux-dummy in stamps dir.
+        self.assertFalse(os.listdir(lnx_dmy_stamps_dir), msg='linux-dummy stamps dir. should have been cleaned. Something \
+                         happened with bitbake linux-dummy -ccleansstate')
+        res = bitbake("core-image-minimal")# testing linux-dummy is both buildable and usable within an image
+        self.remove_config(config_param)
+        self.assertEqual(res.status, 0, msg="core-image-minimal failed to build. Please check logs. ")
+        self.assertNotIn("multiple providers are available for", res.output, msg="'multiple providers are available for\
+                        linux-dummy' message received during buildtime.")
+        self.assertTrue(os.listdir(lnx_dmy_stamps_dir), msg="linux-dummy didn't build correctly. No stamp present in stamps \
+                        dir. %s" % lnx_dmy_stamps_dir)
+         

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list