summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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))