Skip to contentSkip to conversation

oe-selftest improvements

PATCH New Paul Eggleton 1 participant 4 messages Nov 6, 2015

lore
Share & tools
lore
#0 lore raw

cover oe-selftest improvements

A fix for two tests plus an additional test for the bitbake-layers show-recipes command.

The following changes since commit e44ed8c18e395b9c055aefee113b90708e8a8a2f:

build-appliance-image: Update to jethro head revision (2015-11-03 14:02:57 +0000)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib paule/oe-selftest-1
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/oe-selftest-1

Paul Eggleton (3):
oeqa/selftest/devtool: fix test if build directory is not inside
COREBASE
oeqa/selftest/layerappend: fix test if build directory is not inside
COREBASE
oe-selftest: add test for bitbake-layers show-recipes

 meta/lib/oeqa/selftest/bblayers.py    | 25 +++++++++++++++++++++++++
 meta/lib/oeqa/selftest/devtool.py     |  2 +-
 meta/lib/oeqa/selftest/layerappend.py |  9 ++++++---
 3 files changed, 32 insertions(+), 4 deletions(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/3 oeqa/selftest/devtool: fix test if build directory is not inside COREBASE

Fix test_devtool_update_recipe_git to work when build directory is not inside COREBASE.

Fixes [YOCTO #8639].

---
 meta/lib/oeqa/selftest/devtool.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/selftest/devtool.py +1 -1
index f48e6a2..dcdef5a 100644
@@ -582,7 +582,7 @@ class DevtoolTests(DevtoolBase):
         # Now try with auto mode
         runCmd('cd %s; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, os.path.basename(recipefile)))
         result = runCmd('devtool update-recipe %s' % testrecipe)
-        result = runCmd('git rev-parse --show-toplevel')
+        result = runCmd('git rev-parse --show-toplevel', cwd=os.path.dirname(recipefile))
         topleveldir = result.output.strip()
         relpatchpath = os.path.join(os.path.relpath(os.path.dirname(recipefile), topleveldir), testrecipe)
         expected_status = [(' M', os.path.relpath(recipefile, topleveldir)),
Signature · 1 line
2.1.0
#2 lore raw

PATCH 2/3 oeqa/selftest/layerappend: fix test if build directory is not inside COREBASE

In reply to Paul Eggleton

Fix test_layer_appends to work when build directory is not inside COREBASE.

Fixes [YOCTO #8639].

---
 meta/lib/oeqa/selftest/layerappend.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
meta/lib/oeqa/selftest/layerappend.py +6 -3
index a82a6c8..4de5034 100644
@@ -46,10 +46,11 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
 SRC_URI_append += "file://appendtest.txt"
 """
-    layerappend = "BBLAYERS += \"COREBASE/meta-layertest0 COREBASE/meta-layertest1 COREBASE/meta-layertest2\""
+    layerappend = ''
 
     def tearDownLocal(self):
-        ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend.replace("COREBASE", self.builddir + "/.."))
+        if self.layerappend:
+            ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend)
 
     @testcase(1196)
     def test_layer_appends(self):
@@ -79,7 +80,9 @@ SRC_URI_append += "file://appendtest.txt"
                 with open(layer + "/recipes-test/layerappendtest/appendtest.txt", "w") as f:
                     f.write("Layer 2 test")
             self.track_for_cleanup(layer)
-        ftools.append_file(self.builddir + "/conf/bblayers.conf", self.layerappend.replace("COREBASE", self.builddir + "/.."))
+
+        self.layerappend = "BBLAYERS += \"{0}/meta-layertest0 {0}/meta-layertest1 {0}/meta-layertest2\"".format(corebase)
+        ftools.append_file(self.builddir + "/conf/bblayers.conf", self.layerappend)
         bitbake("layerappendtest")
         data = ftools.read_file(stagingdir + "/appendtest.txt")
         self.assertEqual(data, "Layer 2 test")
Signature · 1 line
2.1.0
#3 lore raw

PATCH 3/3 oe-selftest: add test for bitbake-layers show-recipes

In reply to Paul Eggleton

Add a test for bitbake-layers show-recipes including the recently added -i option.

---
 meta/lib/oeqa/selftest/bblayers.py | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
meta/lib/oeqa/selftest/bblayers.py +25 -0
index 20c17e4..5452925 100644
@@ -60,3 +60,28 @@ class BitbakeLayers(oeSelfTest):
         result = runCmd('bitbake-layers remove-layer */meta-skeleton')
         result = runCmd('bitbake-layers show-layers')
         self.assertNotIn('meta-skeleton', result.output, msg = "meta-skeleton should have been removed at this step.  bitbake-layers show-layers output: %s" % result.output)
+
+    def test_bitbakelayers_showrecipes(self):
+        result = runCmd('bitbake-layers show-recipes')
+        self.assertIn('aspell:', result.output)
+        self.assertIn('mtd-utils:', result.output)
+        self.assertIn('linux-yocto:', result.output)
+        self.assertIn('core-image-minimal:', result.output)
+        result = runCmd('bitbake-layers show-recipes mtd-utils')
+        self.assertIn('mtd-utils:', result.output)
+        self.assertNotIn('aspell:', result.output)
+        result = runCmd('bitbake-layers show-recipes -i kernel')
+        self.assertIn('linux-yocto:', result.output)
+        self.assertNotIn('mtd-utils:', result.output)
+        result = runCmd('bitbake-layers show-recipes -i image')
+        self.assertIn('core-image-minimal', result.output)
+        self.assertNotIn('linux-yocto:', result.output)
+        self.assertNotIn('mtd-utils:', result.output)
+        result = runCmd('bitbake-layers show-recipes -i cmake,pkgconfig')
+        self.assertIn('libproxy:', result.output)
+        self.assertNotIn('mtd-utils:', result.output) # doesn't inherit either
+        self.assertNotIn('wget:', result.output) # doesn't inherit cmake
+        self.assertNotIn('waffle:', result.output) # doesn't inherit pkgconfig
+        result = runCmd('bitbake-layers show-recipes -i nonexistentclass', ignore_status=True)
+        self.assertNotEqual(result.status, 0, 'bitbake-layers show-recipes -i nonexistentclass should have failed')
+        self.assertIn('ERROR:', result.output)
Signature · 1 line
2.1.0