aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2015-10-12 12:55:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-21 22:55:01 +0100
commit69f5bbc1041e15691af0b4845e2136957a4846a1 (patch)
tree66d7944eb50704fa779f53337017e67f61572003
parent9a2292a995de9f93e742bda6c465daa854279fed (diff)
downloadopenembedded-core-contrib-69f5bbc1041e15691af0b4845e2136957a4846a1.tar.gz
openembedded-core-contrib-69f5bbc1041e15691af0b4845e2136957a4846a1.tar.bz2
openembedded-core-contrib-69f5bbc1041e15691af0b4845e2136957a4846a1.zip
oeqa/selftest: verify that devtool can use plugins in other layers
In selftest we want to exercise devtool's ability to use plugins from other layers, so add a basic command to reverse a string to meta-selftest and a test in oe-selftest to call it. Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta-selftest/lib/devtool/__init__.py0
-rw-r--r--meta-selftest/lib/devtool/test.py11
-rw-r--r--meta/lib/oeqa/selftest/devtool.py12
3 files changed, 23 insertions, 0 deletions
diff --git a/meta-selftest/lib/devtool/__init__.py b/meta-selftest/lib/devtool/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/meta-selftest/lib/devtool/__init__.py
diff --git a/meta-selftest/lib/devtool/test.py b/meta-selftest/lib/devtool/test.py
new file mode 100644
index 0000000000..b7474b5eee
--- /dev/null
+++ b/meta-selftest/lib/devtool/test.py
@@ -0,0 +1,11 @@
+import argparse
+
+def selftest_reverse(args, config, basepath, workspace):
+ """Reverse the value passed to verify the plugin is executing."""
+ print args.value[::-1]
+
+def register_commands(subparsers, context):
+ parser_build = subparsers.add_parser('selftest-reverse', help='Reverse value (for selftest)',
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+ parser_build.add_argument('value', help='Value to reverse')
+ parser_build.set_defaults(func=selftest_reverse)
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index e4de309e72..fb46559eec 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -1015,3 +1015,15 @@ class DevtoolTests(DevtoolBase):
self.track_for_cleanup(tempdir)
self.track_for_cleanup(self.workspacedir)
self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+
+ def test_devtool_layer_plugins(self):
+ """Test that devtool can use plugins from other layers.
+
+ This test executes the selftest-reverse command from meta-selftest."""
+
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+
+ s = "Microsoft Made No Profit From Anyone's Zunes Yo"
+ result = runCmd("devtool --quiet selftest-reverse \"%s\"" % s)
+ self.assertEqual(result.output, s[::-1])