summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-25 13:44:11 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-25 16:48:27 +0100
commit1b7eccff64621f281ebdea6086ccb663f57f854e (patch)
tree1e2b546aae6bb05533d670d19db24eda1a855a41 /meta
parentce76b71666c0300c1ece4a778df3341c7e363157 (diff)
downloadpoky-1b7eccff64621f281ebdea6086ccb663f57f854e.tar.gz
selftest/bbtests: Add test for bitbake execution outside the build directory
Also fix a related test's error message to match what it does. (From OE-Core rev: 662be652ed39f32c3c7bee6539a9e91af191557e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/cases/bbtests.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bbtests.py b/meta/lib/oeqa/selftest/cases/bbtests.py
index 350614967c..005fdd0964 100644
--- a/meta/lib/oeqa/selftest/cases/bbtests.py
+++ b/meta/lib/oeqa/selftest/cases/bbtests.py
@@ -15,16 +15,26 @@ class BitbakeTests(OESelftestTestCase):
15 return l 15 return l
16 16
17 @OETestID(789) 17 @OETestID(789)
18 # Test bitbake can run from the <builddir>/conf directory
18 def test_run_bitbake_from_dir_1(self): 19 def test_run_bitbake_from_dir_1(self):
19 os.chdir(os.path.join(self.builddir, 'conf')) 20 os.chdir(os.path.join(self.builddir, 'conf'))
20 self.assertEqual(bitbake('-e').status, 0, msg = "bitbake couldn't run from \"conf\" dir") 21 self.assertEqual(bitbake('-e').status, 0, msg = "bitbake couldn't run from \"conf\" dir")
21 22
22 @OETestID(790) 23 @OETestID(790)
24 # Test bitbake can run from the <builddir>'s parent directory
23 def test_run_bitbake_from_dir_2(self): 25 def test_run_bitbake_from_dir_2(self):
24 my_env = os.environ.copy() 26 my_env = os.environ.copy()
25 my_env['BBPATH'] = my_env['BUILDDIR'] 27 my_env['BBPATH'] = my_env['BUILDDIR']
26 os.chdir(os.path.dirname(os.environ['BUILDDIR'])) 28 os.chdir(os.path.dirname(os.environ['BUILDDIR']))
27 self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from builddir") 29 self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from builddir's parent directory")
30
31 # Test bitbake can run from some other random system location (we use /tmp/)
32 def test_run_bitbake_from_dir_3(self):
33 my_env = os.environ.copy()
34 my_env['BBPATH'] = my_env['BUILDDIR']
35 os.chdir("/tmp/")
36 self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from /tmp/")
37
28 38
29 @OETestID(806) 39 @OETestID(806)
30 def test_event_handler(self): 40 def test_event_handler(self):