summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRandy Witt <randy.e.witt@linux.intel.com>2017-01-05 15:15:43 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-16 18:05:12 +0000
commitf64e321baf4fdf1dacfa206ed665ade0f8d83812 (patch)
tree78067a8d4704f69a62f6267c2b3be085a4bc608a /meta
parentf7cf740fc40ee7e950db9e41670d15c6a5141f42 (diff)
downloadpoky-f64e321baf4fdf1dacfa206ed665ade0f8d83812.tar.gz
image_typedep.py: Add a test that ensures conversion type deps get added
Add a test that ensures if IMAGE_TYPEDEP_* contains a conversion type, that the corresponding CONVERSION_DEPENDS_ for that type gets added to the dependency tree for do_rootfs. (From OE-Core rev: 9cf9c725f7d534c326ffd95ec539b041f4ad286f) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/image_typedep.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/image_typedep.py b/meta/lib/oeqa/selftest/image_typedep.py
new file mode 100644
index 0000000000..256142d255
--- /dev/null
+++ b/meta/lib/oeqa/selftest/image_typedep.py
@@ -0,0 +1,51 @@
1import os
2
3from oeqa.selftest.base import oeSelfTest
4from oeqa.utils.commands import bitbake
5
6class ImageTypeDepTests(oeSelfTest):
7
8 # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
9 # the conversion type bar gets added as a dep as well
10 def test_conversion_typedep_added(self):
11
12 self.write_recipeinc('emptytest', """
13# Try to empty out the default dependency list
14PACKAGE_INSTALL = ""
15DISTRO_EXTRA_RDEPENDS=""
16
17LICENSE = "MIT"
18IMAGE_FSTYPES = "testfstype"
19
20IMAGE_TYPES_MASKED += "testfstype"
21IMAGE_TYPEDEP_testfstype = "tar.bz2"
22
23inherit image
24
25""")
26 # First get the dependency that should exist for bz2, it will look
27 # like CONVERSION_DEPENDS_bz2="somedep"
28 result = bitbake('-e emptytest')
29
30 for line in result.output.split('\n'):
31 if line.startswith('CONVERSION_DEPENDS_bz2'):
32 dep = line.split('=')[1].strip('"')
33 break
34
35 # Now get the dependency task list and check for the expected task
36 # dependency
37 bitbake('-g emptytest')
38
39 taskdependsfile = os.path.join(self.builddir, 'task-depends.dot')
40 dep = dep + ".do_populate_sysroot"
41 depfound = False
42 expectedline = '"emptytest.do_rootfs" -> "{}"'.format(dep)
43
44 with open(taskdependsfile, "r") as f:
45 for line in f:
46 if line.strip() == expectedline:
47 depfound = True
48 break
49
50 if not depfound:
51 raise AssertionError("\"{}\" not found".format(expectedline))