diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-02 15:32:27 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-06 11:21:32 +0100 |
| commit | fd79638046891fb5ab6091f7ef3e7ae6df12c39b (patch) | |
| tree | 04a256b8a35158fbb1d90b6d4fbcb84cb2301066 /bitbake/lib/bb/tests/runqueue.py | |
| parent | 347c2056022d21deea6e2e7359eca2b96c6f01fe (diff) | |
| download | poky-fd79638046891fb5ab6091f7ef3e7ae6df12c39b.tar.gz | |
bitbake: tests/runqueue: Add hashserv+runqueue test
Add a test which tests the runqueue adaptations for hash equivalency.
(Bitbake rev: 477321d0780df177c1582db119c2bb6795912fc6)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/runqueue.py')
| -rw-r--r-- | bitbake/lib/bb/tests/runqueue.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/bitbake/lib/bb/tests/runqueue.py b/bitbake/lib/bb/tests/runqueue.py index f22ad4bd81..fbdacccfa1 100644 --- a/bitbake/lib/bb/tests/runqueue.py +++ b/bitbake/lib/bb/tests/runqueue.py | |||
| @@ -25,7 +25,7 @@ class RunQueueTests(unittest.TestCase): | |||
| 25 | a1_sstatevalid = "a1:do_package a1:do_package_qa a1:do_packagedata a1:do_package_write_ipk a1:do_package_write_rpm a1:do_populate_lic a1:do_populate_sysroot" | 25 | a1_sstatevalid = "a1:do_package a1:do_package_qa a1:do_packagedata a1:do_package_write_ipk a1:do_package_write_rpm a1:do_populate_lic a1:do_populate_sysroot" |
| 26 | b1_sstatevalid = "b1:do_package b1:do_package_qa b1:do_packagedata b1:do_package_write_ipk b1:do_package_write_rpm b1:do_populate_lic b1:do_populate_sysroot" | 26 | b1_sstatevalid = "b1:do_package b1:do_package_qa b1:do_packagedata b1:do_package_write_ipk b1:do_package_write_rpm b1:do_populate_lic b1:do_populate_sysroot" |
| 27 | 27 | ||
| 28 | def run_bitbakecmd(self, cmd, builddir, sstatevalid="", slowtasks="", extraenv=None): | 28 | def run_bitbakecmd(self, cmd, builddir, sstatevalid="", slowtasks="", extraenv=None, cleanup=False): |
| 29 | env = os.environ.copy() | 29 | env = os.environ.copy() |
| 30 | env["BBPATH"] = os.path.realpath(os.path.join(os.path.dirname(__file__), "runqueue-tests")) | 30 | env["BBPATH"] = os.path.realpath(os.path.join(os.path.dirname(__file__), "runqueue-tests")) |
| 31 | env["BB_ENV_EXTRAWHITE"] = "SSTATEVALID SLOWTASKS" | 31 | env["BB_ENV_EXTRAWHITE"] = "SSTATEVALID SLOWTASKS" |
| @@ -42,6 +42,8 @@ class RunQueueTests(unittest.TestCase): | |||
| 42 | tasks = [] | 42 | tasks = [] |
| 43 | with open(builddir + "/task.log", "r") as f: | 43 | with open(builddir + "/task.log", "r") as f: |
| 44 | tasks = [line.rstrip() for line in f] | 44 | tasks = [line.rstrip() for line in f] |
| 45 | if cleanup: | ||
| 46 | os.remove(builddir + "/task.log") | ||
| 45 | return tasks | 47 | return tasks |
| 46 | 48 | ||
| 47 | def test_no_setscenevalid(self): | 49 | def test_no_setscenevalid(self): |
| @@ -226,3 +228,26 @@ class RunQueueTests(unittest.TestCase): | |||
| 226 | expected.remove(x) | 228 | expected.remove(x) |
| 227 | self.assertEqual(set(tasks), set(expected)) | 229 | self.assertEqual(set(tasks), set(expected)) |
| 228 | 230 | ||
| 231 | |||
| 232 | def test_hashserv(self): | ||
| 233 | with tempfile.TemporaryDirectory(prefix="runqueuetest") as tempdir: | ||
| 234 | extraenv = { | ||
| 235 | "BB_HASHSERVE" : "localhost:0", | ||
| 236 | "BB_SIGNATURE_HANDLER" : "TestEquivHash" | ||
| 237 | } | ||
| 238 | cmd = ["bitbake", "a1", "b1"] | ||
| 239 | setscenetasks = ['package_write_ipk_setscene', 'package_write_rpm_setscene', 'packagedata_setscene', | ||
| 240 | 'populate_sysroot_setscene', 'package_qa_setscene'] | ||
| 241 | sstatevalid = "" | ||
| 242 | tasks = self.run_bitbakecmd(cmd, tempdir, sstatevalid, extraenv=extraenv, cleanup=True) | ||
| 243 | expected = ['a1:' + x for x in self.alltasks] + ['b1:' + x for x in self.alltasks] | ||
| 244 | self.assertEqual(set(tasks), set(expected)) | ||
| 245 | cmd = ["bitbake", "a1", "-c", "install", "-f"] | ||
| 246 | tasks = self.run_bitbakecmd(cmd, tempdir, sstatevalid, extraenv=extraenv, cleanup=True) | ||
| 247 | expected = ['a1:install'] | ||
| 248 | self.assertEqual(set(tasks), set(expected)) | ||
| 249 | cmd = ["bitbake", "a1", "b1"] | ||
| 250 | tasks = self.run_bitbakecmd(cmd, tempdir, sstatevalid, extraenv=extraenv, cleanup=True) | ||
| 251 | expected = ['a1:' + x for x in setscenetasks] + ['b1:' + x for x in setscenetasks] + ['a1:build', 'b1:build'] | ||
| 252 | self.assertEqual(set(tasks), set(expected)) | ||
| 253 | |||
