diff options
-rw-r--r-- | meta/lib/oeqa/selftest/cases/tinfoil.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/tinfoil.py b/meta/lib/oeqa/selftest/cases/tinfoil.py index dd13c20402..21c8686b2a 100644 --- a/meta/lib/oeqa/selftest/cases/tinfoil.py +++ b/meta/lib/oeqa/selftest/cases/tinfoil.py | |||
@@ -48,6 +48,17 @@ class TinfoilTests(OESelftestTestCase): | |||
48 | rd = tinfoil.parse_recipe_file(best[3]) | 48 | rd = tinfoil.parse_recipe_file(best[3]) |
49 | self.assertEqual(testrecipe, rd.getVar('PN')) | 49 | self.assertEqual(testrecipe, rd.getVar('PN')) |
50 | 50 | ||
51 | def test_parse_virtual_recipe(self): | ||
52 | with bb.tinfoil.Tinfoil() as tinfoil: | ||
53 | tinfoil.prepare(config_only=False, quiet=2) | ||
54 | testrecipe = 'nativesdk-gcc' | ||
55 | best = tinfoil.find_best_provider(testrecipe) | ||
56 | if not best: | ||
57 | self.fail('Unable to find recipe providing %s' % testrecipe) | ||
58 | rd = tinfoil.parse_recipe_file(best[3]) | ||
59 | self.assertEqual(testrecipe, rd.getVar('PN')) | ||
60 | self.assertIsNotNone(rd.getVar('FILE_LAYERNAME')) | ||
61 | |||
51 | def test_parse_recipe_copy_expand(self): | 62 | def test_parse_recipe_copy_expand(self): |
52 | with bb.tinfoil.Tinfoil() as tinfoil: | 63 | with bb.tinfoil.Tinfoil() as tinfoil: |
53 | tinfoil.prepare(config_only=False, quiet=2) | 64 | tinfoil.prepare(config_only=False, quiet=2) |
@@ -66,7 +77,7 @@ class TinfoilTests(OESelftestTestCase): | |||
66 | localdata.setVar('PN', 'hello') | 77 | localdata.setVar('PN', 'hello') |
67 | self.assertEqual('hello', localdata.getVar('BPN')) | 78 | self.assertEqual('hello', localdata.getVar('BPN')) |
68 | 79 | ||
69 | # The config_data API tp parse_recipe_file is used by: | 80 | # The config_data API to parse_recipe_file is used by: |
70 | # layerindex-web layerindex/update_layer.py | 81 | # layerindex-web layerindex/update_layer.py |
71 | def test_parse_recipe_custom_data(self): | 82 | def test_parse_recipe_custom_data(self): |
72 | with bb.tinfoil.Tinfoil() as tinfoil: | 83 | with bb.tinfoil.Tinfoil() as tinfoil: |
@@ -80,6 +91,18 @@ class TinfoilTests(OESelftestTestCase): | |||
80 | rd = tinfoil.parse_recipe_file(best[3], config_data=localdata) | 91 | rd = tinfoil.parse_recipe_file(best[3], config_data=localdata) |
81 | self.assertEqual("testval", rd.getVar('TESTVAR')) | 92 | self.assertEqual("testval", rd.getVar('TESTVAR')) |
82 | 93 | ||
94 | def test_parse_virtual_recipe_custom_data(self): | ||
95 | with bb.tinfoil.Tinfoil() as tinfoil: | ||
96 | tinfoil.prepare(config_only=False, quiet=2) | ||
97 | localdata = bb.data.createCopy(tinfoil.config_data) | ||
98 | localdata.setVar("TESTVAR", "testval") | ||
99 | testrecipe = 'nativesdk-gcc' | ||
100 | best = tinfoil.find_best_provider(testrecipe) | ||
101 | if not best: | ||
102 | self.fail('Unable to find recipe providing %s' % testrecipe) | ||
103 | rd = tinfoil.parse_recipe_file(best[3], config_data=localdata) | ||
104 | self.assertEqual("testval", rd.getVar('TESTVAR')) | ||
105 | |||
83 | def test_list_recipes(self): | 106 | def test_list_recipes(self): |
84 | with bb.tinfoil.Tinfoil() as tinfoil: | 107 | with bb.tinfoil.Tinfoil() as tinfoil: |
85 | tinfoil.prepare(config_only=False, quiet=2) | 108 | tinfoil.prepare(config_only=False, quiet=2) |