summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorCostin Constantin <costin.c.constantin@intel.com>2016-02-29 12:38:02 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-01 10:05:46 +0000
commitc3d2df883a9d6d5036277114339673656d89a728 (patch)
treec0e73ed303f547f4bcd53aa93f4ba7dc9dc281f0 /meta/lib
parent60a9930989c5d88d1b87ecb398788e0b9a60aa09 (diff)
downloadpoky-c3d2df883a9d6d5036277114339673656d89a728.tar.gz
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. (From OE-Core rev: 98c6ebf1e05158c689e01b785d32757847cdb10c) Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/kernel.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/kernel.py b/meta/lib/oeqa/selftest/kernel.py
new file mode 100644
index 0000000000..3fe3517f91
--- /dev/null
+++ b/meta/lib/oeqa/selftest/kernel.py
@@ -0,0 +1,29 @@
1import os
2import oeqa.utils.ftools as ftools
3from oeqa.selftest.base import oeSelfTest
4from oeqa.utils.commands import runCmd, bitbake, get_bb_var
5from oeqa.utils.decorators import testcase
6
7class KernelTests(oeSelfTest):
8 def test_dummy_kernel(self):
9 """
10 [YP#7202]
11 - test that linux-dummy target can be used as kernel provider for an image
12 - check no "multiple providers are available for" message is received while building the image
13 """
14 config_param = 'PREFERRED_PROVIDER_virtual/kernel = "linux-dummy"'
15 self.append_config(config_param)
16 arch_dir = get_bb_var('MULTIMACH_TARGET_SYS', target='linux-dummy')
17 stamps_dir = os.path.join(os.getenv('BUILDDIR'), "tmp/stamps")
18 lnx_dmy_stamps_dir = os.path.join(stamps_dir, arch_dir, 'linux-dummy')
19 res = bitbake("linux-dummy -ccleansstate") # ensure we have nothing related to linux-dummy in stamps dir.
20 self.assertFalse(os.listdir(lnx_dmy_stamps_dir), msg='linux-dummy stamps dir. should have been cleaned. Something \
21 happened with bitbake linux-dummy -ccleansstate')
22 res = bitbake("core-image-minimal")# testing linux-dummy is both buildable and usable within an image
23 self.remove_config(config_param)
24 self.assertEqual(res.status, 0, msg="core-image-minimal failed to build. Please check logs. ")
25 self.assertNotIn("multiple providers are available for", res.output, msg="'multiple providers are available for\
26 linux-dummy' message received during buildtime.")
27 self.assertTrue(os.listdir(lnx_dmy_stamps_dir), msg="linux-dummy didn't build correctly. No stamp present in stamps \
28 dir. %s" % lnx_dmy_stamps_dir)
29