summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/tinfoil.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/tinfoil.py')
-rw-r--r--meta/lib/oeqa/selftest/tinfoil.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/meta/lib/oeqa/selftest/tinfoil.py b/meta/lib/oeqa/selftest/tinfoil.py
index 4f70e0d2f7..c8d635cd05 100644
--- a/meta/lib/oeqa/selftest/tinfoil.py
+++ b/meta/lib/oeqa/selftest/tinfoil.py
@@ -13,7 +13,7 @@ class TinfoilTests(oeSelfTest):
13 def test_getvar(self): 13 def test_getvar(self):
14 with bb.tinfoil.Tinfoil() as tinfoil: 14 with bb.tinfoil.Tinfoil() as tinfoil:
15 tinfoil.prepare(True) 15 tinfoil.prepare(True)
16 machine = tinfoil.config_data.getVar('MACHINE', True) 16 machine = tinfoil.config_data.getVar('MACHINE')
17 if not machine: 17 if not machine:
18 self.fail('Unable to get MACHINE value - returned %s' % machine) 18 self.fail('Unable to get MACHINE value - returned %s' % machine)
19 19
@@ -41,7 +41,7 @@ class TinfoilTests(oeSelfTest):
41 if not best: 41 if not best:
42 self.fail('Unable to find recipe providing %s' % testrecipe) 42 self.fail('Unable to find recipe providing %s' % testrecipe)
43 rd = tinfoil.parse_recipe_file(best[3]) 43 rd = tinfoil.parse_recipe_file(best[3])
44 self.assertEqual(testrecipe, rd.getVar('PN', True)) 44 self.assertEqual(testrecipe, rd.getVar('PN'))
45 45
46 def test_parse_recipe_copy_expand(self): 46 def test_parse_recipe_copy_expand(self):
47 with bb.tinfoil.Tinfoil() as tinfoil: 47 with bb.tinfoil.Tinfoil() as tinfoil:
@@ -52,14 +52,14 @@ class TinfoilTests(oeSelfTest):
52 self.fail('Unable to find recipe providing %s' % testrecipe) 52 self.fail('Unable to find recipe providing %s' % testrecipe)
53 rd = tinfoil.parse_recipe_file(best[3]) 53 rd = tinfoil.parse_recipe_file(best[3])
54 # Check we can get variable values 54 # Check we can get variable values
55 self.assertEqual(testrecipe, rd.getVar('PN', True)) 55 self.assertEqual(testrecipe, rd.getVar('PN'))
56 # Check that expanding a value that includes a variable reference works 56 # Check that expanding a value that includes a variable reference works
57 self.assertEqual(testrecipe, rd.getVar('BPN', True)) 57 self.assertEqual(testrecipe, rd.getVar('BPN'))
58 # Now check that changing the referenced variable's value in a copy gives that 58 # Now check that changing the referenced variable's value in a copy gives that
59 # value when expanding 59 # value when expanding
60 localdata = bb.data.createCopy(rd) 60 localdata = bb.data.createCopy(rd)
61 localdata.setVar('PN', 'hello') 61 localdata.setVar('PN', 'hello')
62 self.assertEqual('hello', localdata.getVar('BPN', True)) 62 self.assertEqual('hello', localdata.getVar('BPN'))
63 63
64 def test_parse_recipe_initial_datastore(self): 64 def test_parse_recipe_initial_datastore(self):
65 with bb.tinfoil.Tinfoil() as tinfoil: 65 with bb.tinfoil.Tinfoil() as tinfoil:
@@ -72,7 +72,7 @@ class TinfoilTests(oeSelfTest):
72 dcopy.setVar('MYVARIABLE', 'somevalue') 72 dcopy.setVar('MYVARIABLE', 'somevalue')
73 rd = tinfoil.parse_recipe_file(best[3], config_data=dcopy) 73 rd = tinfoil.parse_recipe_file(best[3], config_data=dcopy)
74 # Check we can get variable values 74 # Check we can get variable values
75 self.assertEqual('somevalue', rd.getVar('MYVARIABLE', True)) 75 self.assertEqual('somevalue', rd.getVar('MYVARIABLE'))
76 76
77 def test_list_recipes(self): 77 def test_list_recipes(self):
78 with bb.tinfoil.Tinfoil() as tinfoil: 78 with bb.tinfoil.Tinfoil() as tinfoil:
@@ -127,7 +127,7 @@ class TinfoilTests(oeSelfTest):
127 with bb.tinfoil.Tinfoil() as tinfoil: 127 with bb.tinfoil.Tinfoil() as tinfoil:
128 tinfoil.prepare(config_only=True) 128 tinfoil.prepare(config_only=True)
129 tinfoil.run_command('setVariable', 'TESTVAR', 'specialvalue') 129 tinfoil.run_command('setVariable', 'TESTVAR', 'specialvalue')
130 self.assertEqual(tinfoil.config_data.getVar('TESTVAR', True), 'specialvalue', 'Value set using setVariable is not reflected in client-side getVar()') 130 self.assertEqual(tinfoil.config_data.getVar('TESTVAR'), 'specialvalue', 'Value set using setVariable is not reflected in client-side getVar()')
131 131
132 # Now check that the setVariable's effects are no longer present 132 # Now check that the setVariable's effects are no longer present
133 # (this may legitimately break in future if we stop reinitialising 133 # (this may legitimately break in future if we stop reinitialising
@@ -135,7 +135,7 @@ class TinfoilTests(oeSelfTest):
135 # setVariable entirely) 135 # setVariable entirely)
136 with bb.tinfoil.Tinfoil() as tinfoil: 136 with bb.tinfoil.Tinfoil() as tinfoil:
137 tinfoil.prepare(config_only=True) 137 tinfoil.prepare(config_only=True)
138 self.assertNotEqual(tinfoil.config_data.getVar('TESTVAR', True), 'specialvalue', 'Value set using setVariable is still present!') 138 self.assertNotEqual(tinfoil.config_data.getVar('TESTVAR'), 'specialvalue', 'Value set using setVariable is still present!')
139 139
140 # Now check that setVar on the main datastore works (uses setVariable internally) 140 # Now check that setVar on the main datastore works (uses setVariable internally)
141 with bb.tinfoil.Tinfoil() as tinfoil: 141 with bb.tinfoil.Tinfoil() as tinfoil: