diff options
Diffstat (limited to 'bitbake/lib/hashserv/tests.py')
-rw-r--r-- | bitbake/lib/hashserv/tests.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/tests.py b/bitbake/lib/hashserv/tests.py index aeedab3575..fbbe81512a 100644 --- a/bitbake/lib/hashserv/tests.py +++ b/bitbake/lib/hashserv/tests.py | |||
@@ -442,6 +442,11 @@ class HashEquivalenceCommonTests(object): | |||
442 | self.assertEqual(result['taskhash'], taskhash9, 'Server failed to copy unihash from upstream') | 442 | self.assertEqual(result['taskhash'], taskhash9, 'Server failed to copy unihash from upstream') |
443 | self.assertEqual(result['method'], self.METHOD) | 443 | self.assertEqual(result['method'], self.METHOD) |
444 | 444 | ||
445 | def test_unihash_exsits(self): | ||
446 | taskhash, outhash, unihash = self.create_test_hash(self.client) | ||
447 | self.assertTrue(self.client.unihash_exists(unihash)) | ||
448 | self.assertFalse(self.client.unihash_exists('6662e699d6e3d894b24408ff9a4031ef9b038ee8')) | ||
449 | |||
445 | def test_ro_server(self): | 450 | def test_ro_server(self): |
446 | rw_server = self.start_server() | 451 | rw_server = self.start_server() |
447 | rw_client = self.start_client(rw_server.address) | 452 | rw_client = self.start_client(rw_server.address) |
@@ -1031,6 +1036,40 @@ class TestHashEquivalenceClient(HashEquivalenceTestSetup, unittest.TestCase): | |||
1031 | def test_stress(self): | 1036 | def test_stress(self): |
1032 | self.run_hashclient(["--address", self.server_address, "stress"], check=True) | 1037 | self.run_hashclient(["--address", self.server_address, "stress"], check=True) |
1033 | 1038 | ||
1039 | def test_unihash_exsits(self): | ||
1040 | taskhash, outhash, unihash = self.create_test_hash(self.client) | ||
1041 | |||
1042 | p = self.run_hashclient([ | ||
1043 | "--address", self.server_address, | ||
1044 | "unihash-exists", unihash, | ||
1045 | ], check=True) | ||
1046 | self.assertEqual(p.stdout.strip(), "true") | ||
1047 | |||
1048 | p = self.run_hashclient([ | ||
1049 | "--address", self.server_address, | ||
1050 | "unihash-exists", '6662e699d6e3d894b24408ff9a4031ef9b038ee8', | ||
1051 | ], check=True) | ||
1052 | self.assertEqual(p.stdout.strip(), "false") | ||
1053 | |||
1054 | def test_unihash_exsits_quiet(self): | ||
1055 | taskhash, outhash, unihash = self.create_test_hash(self.client) | ||
1056 | |||
1057 | p = self.run_hashclient([ | ||
1058 | "--address", self.server_address, | ||
1059 | "unihash-exists", unihash, | ||
1060 | "--quiet", | ||
1061 | ]) | ||
1062 | self.assertEqual(p.returncode, 0) | ||
1063 | self.assertEqual(p.stdout.strip(), "") | ||
1064 | |||
1065 | p = self.run_hashclient([ | ||
1066 | "--address", self.server_address, | ||
1067 | "unihash-exists", '6662e699d6e3d894b24408ff9a4031ef9b038ee8', | ||
1068 | "--quiet", | ||
1069 | ]) | ||
1070 | self.assertEqual(p.returncode, 1) | ||
1071 | self.assertEqual(p.stdout.strip(), "") | ||
1072 | |||
1034 | def test_remove_taskhash(self): | 1073 | def test_remove_taskhash(self): |
1035 | taskhash, outhash, unihash = self.create_test_hash(self.client) | 1074 | taskhash, outhash, unihash = self.create_test_hash(self.client) |
1036 | self.run_hashclient([ | 1075 | self.run_hashclient([ |