diff options
author | Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> | 2017-05-12 14:40:21 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-06 19:02:43 +0100 |
commit | 157c3be2ca93f076033f725ec1ee912df91f7488 (patch) | |
tree | 8ef896ff7adf78d63b34059cd5b017a4f0a3419a /meta/lib/oeqa/selftest/cases/image_typedep.py | |
parent | 10c512b60d1167122b5fe778b93838dca3def717 (diff) | |
download | poky-157c3be2ca93f076033f725ec1ee912df91f7488.tar.gz |
oeqa/selftest/cases: Migrate test cases into the new oe-qa framework
New framework has different classes/decorators so adapt current test cases to
support these. Changes include changes on base classes and decorators.
Also include paths in selftest/__init__.py isn't needed because the
loader is the standard unittest one.
(From OE-Core rev: ddbbefdd124604d10bd47dd0266b55a764fcc0ab)
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/image_typedep.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/image_typedep.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/image_typedep.py b/meta/lib/oeqa/selftest/cases/image_typedep.py new file mode 100644 index 0000000000..0614c765b4 --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/image_typedep.py | |||
@@ -0,0 +1,51 @@ | |||
1 | import os | ||
2 | |||
3 | from oeqa.selftest.case import OESelftestTestCase | ||
4 | from oeqa.utils.commands import bitbake | ||
5 | |||
6 | class ImageTypeDepTests(OESelftestTestCase): | ||
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 | ||
14 | PACKAGE_INSTALL = "" | ||
15 | DISTRO_EXTRA_RDEPENDS="" | ||
16 | |||
17 | LICENSE = "MIT" | ||
18 | IMAGE_FSTYPES = "testfstype" | ||
19 | |||
20 | IMAGE_TYPES_MASKED += "testfstype" | ||
21 | IMAGE_TYPEDEP_testfstype = "tar.bz2" | ||
22 | |||
23 | inherit 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)) | ||