All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] selftest/bblayers: Place the test layer directory in builddir
@ 2018-07-25 13:49 Richard Purdie
  2018-07-25 13:49 ` [PATCH 2/2] selftest/bbtests: Add test for bitbake execution outside the build directory Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2018-07-25 13:49 UTC (permalink / raw)
  To: openembedded-core

Placing the layer in meta means the directory is in an unclean state
which may influence other tests. Use our build directory instead
since we 'own' that. This helps keep oe-selftest parallelisation
clean.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/bblayers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py
index 3448ae1999b..447c54b7e60 100644
--- a/meta/lib/oeqa/selftest/cases/bblayers.py
+++ b/meta/lib/oeqa/selftest/cases/bblayers.py
@@ -88,7 +88,7 @@ class BitbakeLayers(OESelftestTestCase):
     def test_bitbakelayers_createlayer(self):
         priority = 10
         layername = 'test-bitbakelayer-layercreate'
-        layerpath = os.path.join(get_bb_var('COREBASE'), layername)
+        layerpath = os.path.join(self.builddir, layername)
         self.assertFalse(os.path.exists(layerpath), '%s should not exist at this point in time' % layerpath)
         result = runCmd('bitbake-layers create-layer --priority=%d %s' % (priority, layerpath))
         self.track_for_cleanup(layerpath)
-- 
2.17.1



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

* [PATCH 2/2] selftest/bbtests: Add test for bitbake execution outside the build directory
  2018-07-25 13:49 [PATCH 1/2] selftest/bblayers: Place the test layer directory in builddir Richard Purdie
@ 2018-07-25 13:49 ` Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2018-07-25 13:49 UTC (permalink / raw)
  To: openembedded-core

Also fix a related test's error message to match what it does.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/bbtests.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/cases/bbtests.py b/meta/lib/oeqa/selftest/cases/bbtests.py
index 350614967c9..005fdd09640 100644
--- a/meta/lib/oeqa/selftest/cases/bbtests.py
+++ b/meta/lib/oeqa/selftest/cases/bbtests.py
@@ -15,16 +15,26 @@ class BitbakeTests(OESelftestTestCase):
                 return l
 
     @OETestID(789)
+    # Test bitbake can run from the <builddir>/conf directory
     def test_run_bitbake_from_dir_1(self):
         os.chdir(os.path.join(self.builddir, 'conf'))
         self.assertEqual(bitbake('-e').status, 0, msg = "bitbake couldn't run from \"conf\" dir")
 
     @OETestID(790)
+    # Test bitbake can run from the <builddir>'s parent directory
     def test_run_bitbake_from_dir_2(self):
         my_env = os.environ.copy()
         my_env['BBPATH'] = my_env['BUILDDIR']
         os.chdir(os.path.dirname(os.environ['BUILDDIR']))
-        self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from builddir")
+        self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from builddir's parent directory")
+
+    # Test bitbake can run from some other random system location (we use /tmp/)
+    def test_run_bitbake_from_dir_3(self):
+        my_env = os.environ.copy()
+        my_env['BBPATH'] = my_env['BUILDDIR']
+        os.chdir("/tmp/")
+        self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from /tmp/")
+
 
     @OETestID(806)
     def test_event_handler(self):
-- 
2.17.1



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

end of thread, other threads:[~2018-07-25 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-25 13:49 [PATCH 1/2] selftest/bblayers: Place the test layer directory in builddir Richard Purdie
2018-07-25 13:49 ` [PATCH 2/2] selftest/bbtests: Add test for bitbake execution outside the build directory Richard Purdie

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.