All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Improve bblayers and prservices selftests
@ 2016-03-10 10:29 mariano.lopez
  2016-03-10 10:29 ` [PATCH 1/2] selftest/prservice.py: Sanitize package version when looking for stamp mariano.lopez
  2016-03-10 10:29 ` [PATCH 2/2] selftest/bblayers.py: Remove harcoded recipe files mariano.lopez
  0 siblings, 2 replies; 3+ messages in thread
From: mariano.lopez @ 2016-03-10 10:29 UTC (permalink / raw)
  To: openembedded-core

From: Mariano Lopez <mariano.lopez@linux.intel.com>

These patches will improve some selftests that required the file
name of recipes. With these changes just the recipe is needed
and the tests will get the file names as required.

The following changes since commit bc0e99d2b165ff547e02c7169a8b0d210de54a1a:

  recipetool: create: shrinkwrap and lockdown npm modules (2016-03-09 17:00:29 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib mariano/xauth
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=mariano/xauth

Mariano Lopez (2):
  selftest/prservice.py: Sanitize package version when looking for stamp
  selftest/bblayers.py: Remove harcoded recipe files

 meta/lib/oeqa/selftest/bblayers.py  | 20 ++++++++++++++++++--
 meta/lib/oeqa/selftest/prservice.py |  2 +-
 2 files changed, 19 insertions(+), 3 deletions(-)

-- 
2.6.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] selftest/prservice.py: Sanitize package version when looking for stamp
  2016-03-10 10:29 [PATCH 0/2] Improve bblayers and prservices selftests mariano.lopez
@ 2016-03-10 10:29 ` mariano.lopez
  2016-03-10 10:29 ` [PATCH 2/2] selftest/bblayers.py: Remove harcoded recipe files mariano.lopez
  1 sibling, 0 replies; 3+ messages in thread
From: mariano.lopez @ 2016-03-10 10:29 UTC (permalink / raw)
  To: openembedded-core

From: Mariano Lopez <mariano.lopez@linux.intel.com>

Currently when using a git version the check for the stamp, using regex,
will fail because of plus sign in the version.

With this change the version is escaped before adding it to the regex.

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
---
 meta/lib/oeqa/selftest/prservice.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/prservice.py b/meta/lib/oeqa/selftest/prservice.py
index 66638de..1b9a510 100644
--- a/meta/lib/oeqa/selftest/prservice.py
+++ b/meta/lib/oeqa/selftest/prservice.py
@@ -27,7 +27,7 @@ class BitbakePrTests(oeSelfTest):
         package_stamps_path = "/".join(stampdata[:-1])
         stamps = []
         for stamp in os.listdir(package_stamps_path):
-            find_stamp = re.match("%s\.%s\.([a-z0-9]{32})" % (prefix, recipe_task), stamp)
+            find_stamp = re.match("%s\.%s\.([a-z0-9]{32})" % (re.escape(prefix), recipe_task), stamp)
             if find_stamp:
                 stamps.append(find_stamp.group(1))
         self.assertFalse(len(stamps) == 0, msg="Cound not find stamp for task %s for recipe %s" % (recipe_task, package_name))
-- 
2.6.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] selftest/bblayers.py: Remove harcoded recipe files
  2016-03-10 10:29 [PATCH 0/2] Improve bblayers and prservices selftests mariano.lopez
  2016-03-10 10:29 ` [PATCH 1/2] selftest/prservice.py: Sanitize package version when looking for stamp mariano.lopez
@ 2016-03-10 10:29 ` mariano.lopez
  1 sibling, 0 replies; 3+ messages in thread
From: mariano.lopez @ 2016-03-10 10:29 UTC (permalink / raw)
  To: openembedded-core

From: Mariano Lopez <mariano.lopez@linux.intel.com>

Currently the recipe files are hardcoded and if the recipe
change the version, the test will fail.

This will change from using a harcoded file to look for the
file using bitbake-layers. Now, just the recipe name must
be specified.

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
---
 meta/lib/oeqa/selftest/bblayers.py | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/selftest/bblayers.py b/meta/lib/oeqa/selftest/bblayers.py
index b88c25e..d23675e 100644
--- a/meta/lib/oeqa/selftest/bblayers.py
+++ b/meta/lib/oeqa/selftest/bblayers.py
@@ -23,8 +23,10 @@ class BitbakeLayers(oeSelfTest):
 
     @testcase(93)
     def test_bitbakelayers_showappends(self):
+        recipe = "xcursor-transparent-theme"
+        bb_file = self.get_recipe_basename(recipe)
         result = runCmd('bitbake-layers show-appends')
-        self.assertTrue('xcursor-transparent-theme_0.1.1.bbappend' in result.output, msg="xcursor-transparent-theme_0.1.1.bbappend file was not recognised.  bitbake-layers show-appends output: %s" % result.output)
+        self.assertTrue(bb_file in result.output, msg="%s file was not recognised. bitbake-layers show-appends output: %s" % (bb_file, result.output))
 
     @testcase(90)
     def test_bitbakelayers_showoverlayed(self):
@@ -33,11 +35,14 @@ class BitbakeLayers(oeSelfTest):
 
     @testcase(95)
     def test_bitbakelayers_flatten(self):
+        recipe = "xcursor-transparent-theme"
+        recipe_path = "recipes-graphics/xcursor-transparent-theme"
+        recipe_file = self.get_recipe_basename(recipe)
         testoutdir = os.path.join(self.builddir, 'test_bitbakelayers_flatten')
         self.assertFalse(os.path.isdir(testoutdir), msg = "test_bitbakelayers_flatten should not exist at this point in time")
         self.track_for_cleanup(testoutdir)
         result = runCmd('bitbake-layers flatten %s' % testoutdir)
-        bb_file = os.path.join(testoutdir, 'recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb')
+        bb_file = os.path.join(testoutdir, recipe_path, recipe_file)
         self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.")
         contents = ftools.read_file(bb_file)
         find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents)
@@ -86,3 +91,14 @@ class BitbakeLayers(oeSelfTest):
         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)
+
+    def get_recipe_basename(self, recipe):
+        recipe_file = ""
+        result = runCmd("bitbake-layers show-recipes -f %s" % recipe)
+        for line in result.output.splitlines():
+            if recipe in line:
+                recipe_file = line
+                break
+
+        self.assertTrue(os.path.isfile(recipe_file), msg = "Can't find recipe file for %s" % recipe)
+        return os.path.basename(recipe_file)
-- 
2.6.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-10 18:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-10 10:29 [PATCH 0/2] Improve bblayers and prservices selftests mariano.lopez
2016-03-10 10:29 ` [PATCH 1/2] selftest/prservice.py: Sanitize package version when looking for stamp mariano.lopez
2016-03-10 10:29 ` [PATCH 2/2] selftest/bblayers.py: Remove harcoded recipe files mariano.lopez

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.