summaryrefslogtreecommitdiff
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:01:51 +0000
commit9cf9c725f7d534c326ffd95ec539b041f4ad286f (patch)
tree3e7ebddedcbf144d81e7dd456717c15e8fb7b6ee /meta
parent3428a3d1b4d250b82582d472907fb202efe25d40 (diff)
downloadopenembedded-core-9cf9c725f7d534c326ffd95ec539b041f4ad286f.tar.gz
openembedded-core-9cf9c725f7d534c326ffd95ec539b041f4ad286f.tar.bz2
openembedded-core-9cf9c725f7d534c326ffd95ec539b041f4ad286f.zip
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. Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
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 @@
+import os
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import bitbake
+
+class ImageTypeDepTests(oeSelfTest):
+
+ # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
+ # the conversion type bar gets added as a dep as well
+ def test_conversion_typedep_added(self):
+
+ self.write_recipeinc('emptytest', """
+# Try to empty out the default dependency list
+PACKAGE_INSTALL = ""
+DISTRO_EXTRA_RDEPENDS=""
+
+LICENSE = "MIT"
+IMAGE_FSTYPES = "testfstype"
+
+IMAGE_TYPES_MASKED += "testfstype"
+IMAGE_TYPEDEP_testfstype = "tar.bz2"
+
+inherit image
+
+""")
+ # First get the dependency that should exist for bz2, it will look
+ # like CONVERSION_DEPENDS_bz2="somedep"
+ result = bitbake('-e emptytest')
+
+ for line in result.output.split('\n'):
+ if line.startswith('CONVERSION_DEPENDS_bz2'):
+ dep = line.split('=')[1].strip('"')
+ break
+
+ # Now get the dependency task list and check for the expected task
+ # dependency
+ bitbake('-g emptytest')
+
+ taskdependsfile = os.path.join(self.builddir, 'task-depends.dot')
+ dep = dep + ".do_populate_sysroot"
+ depfound = False
+ expectedline = '"emptytest.do_rootfs" -> "{}"'.format(dep)
+
+ with open(taskdependsfile, "r") as f:
+ for line in f:
+ if line.strip() == expectedline:
+ depfound = True
+ break
+
+ if not depfound:
+ raise AssertionError("\"{}\" not found".format(expectedline))