* [PATCH 0/2] OE-Core fixes relating to tinfoil2 refactoring
@ 2017-03-20 4:16 Paul Eggleton
2017-03-20 4:16 ` [PATCH 1/2] oe-selftest: tinfoil: add tests for recently enabled datastore operations Paul Eggleton
2017-03-20 4:16 ` [PATCH 2/2] devtool: tidy up handling of parse failures Paul Eggleton
0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-03-20 4:16 UTC (permalink / raw)
To: openembedded-core
Add some tests and fix parse failure handling in devtool after the
tinfoil2 refactoring.
NOTE: the bitbake patches I just sent should be applied first in order
to ensure the oe-selftest tests that the first patch introduces to pass.
The following changes since commit f43290f6e302dbacf5581d1fe1c6c991dd387779:
neard: Fix parallel build issue (2017-03-17 16:56:02 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/tinfoil2-fixes-oecore
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=paule/tinfoil2-fixes-oecore
Paul Eggleton (2):
oe-selftest: tinfoil: add tests for recently enabled datastore operations
devtool: tidy up handling of parse failures
meta/lib/oeqa/selftest/tinfoil.py | 35 +++++++++++++++++++++++++++++++++++
scripts/lib/devtool/__init__.py | 11 +++++++++--
2 files changed, 44 insertions(+), 2 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] oe-selftest: tinfoil: add tests for recently enabled datastore operations
2017-03-20 4:16 [PATCH 0/2] OE-Core fixes relating to tinfoil2 refactoring Paul Eggleton
@ 2017-03-20 4:16 ` Paul Eggleton
2017-03-20 4:16 ` [PATCH 2/2] devtool: tidy up handling of parse failures Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-03-20 4:16 UTC (permalink / raw)
To: openembedded-core
A recent patch to bitbake fixes these datastore operations so that they
actually affect the server end, so we should test that they work.
(For full disclosure, some of these tests would probably pass without
those fixes, since the operation would be done on the client side
instead - but we are at least exercising the code paths.)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/lib/oeqa/selftest/tinfoil.py | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/meta/lib/oeqa/selftest/tinfoil.py b/meta/lib/oeqa/selftest/tinfoil.py
index 38ec7a3..73a0c3b 100644
--- a/meta/lib/oeqa/selftest/tinfoil.py
+++ b/meta/lib/oeqa/selftest/tinfoil.py
@@ -153,3 +153,38 @@ class TinfoilTests(oeSelfTest):
value = tinfoil.run_command('getVariable', 'TESTVAR')
self.assertEqual(value, 'specialvalue', 'Value set using config_data.setVar() is not reflected in config_data.getVar()')
+ def test_datastore_operations(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+ # Test setVarFlag() / getVarFlag()
+ tinfoil.config_data.setVarFlag('TESTVAR', 'flagname', 'flagval')
+ value = tinfoil.config_data.getVarFlag('TESTVAR', 'flagname')
+ self.assertEqual(value, 'flagval', 'Value set using config_data.setVarFlag() is not reflected in config_data.getVarFlag()')
+ # Test delVarFlag()
+ tinfoil.config_data.setVarFlag('TESTVAR', 'otherflag', 'othervalue')
+ tinfoil.config_data.delVarFlag('TESTVAR', 'flagname')
+ value = tinfoil.config_data.getVarFlag('TESTVAR', 'flagname')
+ self.assertEqual(value, None, 'Varflag deleted using config_data.delVarFlag() is not reflected in config_data.getVarFlag()')
+ value = tinfoil.config_data.getVarFlag('TESTVAR', 'otherflag')
+ self.assertEqual(value, 'othervalue', 'Varflag deleted using config_data.delVarFlag() caused unrelated flag to be removed')
+ # Test delVar()
+ tinfoil.config_data.setVar('TESTVAR', 'varvalue')
+ value = tinfoil.config_data.getVar('TESTVAR')
+ self.assertEqual(value, 'varvalue', 'Value set using config_data.setVar() is not reflected in config_data.getVar()')
+ tinfoil.config_data.delVar('TESTVAR')
+ value = tinfoil.config_data.getVar('TESTVAR')
+ self.assertEqual(value, None, 'Variable deleted using config_data.delVar() appears to still have a value')
+ # Test renameVar()
+ tinfoil.config_data.setVar('TESTVAROLD', 'origvalue')
+ tinfoil.config_data.renameVar('TESTVAROLD', 'TESTVARNEW')
+ value = tinfoil.config_data.getVar('TESTVAROLD')
+ self.assertEqual(value, None, 'Variable renamed using config_data.renameVar() still seems to exist')
+ value = tinfoil.config_data.getVar('TESTVARNEW')
+ self.assertEqual(value, 'origvalue', 'Variable renamed using config_data.renameVar() does not appear with new name')
+ # Test overrides
+ tinfoil.config_data.setVar('TESTVAR', 'original')
+ tinfoil.config_data.setVar('TESTVAR_overrideone', 'one')
+ tinfoil.config_data.setVar('TESTVAR_overridetwo', 'two')
+ tinfoil.config_data.appendVar('OVERRIDES', ':overrideone')
+ value = tinfoil.config_data.getVar('TESTVAR')
+ self.assertEqual(value, 'one', 'Variable overrides not functioning correctly')
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] devtool: tidy up handling of parse failures
2017-03-20 4:16 [PATCH 0/2] OE-Core fixes relating to tinfoil2 refactoring Paul Eggleton
2017-03-20 4:16 ` [PATCH 1/2] oe-selftest: tinfoil: add tests for recently enabled datastore operations Paul Eggleton
@ 2017-03-20 4:16 ` Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-03-20 4:16 UTC (permalink / raw)
To: openembedded-core
Since the tinfoil2 refactoring, if an error occurred during parsing, we
were showing a traceback and not correctly exiting (since we weren't
calling shutdown()). Fix both of these issues.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/lib/devtool/__init__.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 91111e1..8c385be 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -114,8 +114,15 @@ def setup_tinfoil(config_only=False, basepath=None, tracking=False):
import bb.tinfoil
tinfoil = bb.tinfoil.Tinfoil(tracking=tracking)
- tinfoil.prepare(config_only)
- tinfoil.logger.setLevel(logger.getEffectiveLevel())
+ try:
+ tinfoil.prepare(config_only)
+ tinfoil.logger.setLevel(logger.getEffectiveLevel())
+ except bb.tinfoil.TinfoilUIException:
+ tinfoil.shutdown()
+ raise DevtoolError('Failed to start bitbake environment')
+ except:
+ tinfoil.shutdown()
+ raise
finally:
os.chdir(orig_cwd)
return tinfoil
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-20 4:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-20 4:16 [PATCH 0/2] OE-Core fixes relating to tinfoil2 refactoring Paul Eggleton
2017-03-20 4:16 ` [PATCH 1/2] oe-selftest: tinfoil: add tests for recently enabled datastore operations Paul Eggleton
2017-03-20 4:16 ` [PATCH 2/2] devtool: tidy up handling of parse failures Paul Eggleton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.