summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/hashserv/tests.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2023-11-30 10:03:43 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-02 18:04:23 +0000
commit6b6374c336016ee56ff7418c45d1eba2eac95b21 (patch)
treee50773f8af86e7c4760ac68fdc40107c6b420b6f /bitbake/lib/hashserv/tests.py
parent5b18ff6d6bef14cf590be4649b4d27134928c23b (diff)
downloadpoky-6b6374c336016ee56ff7418c45d1eba2eac95b21.tar.gz
bitbake: bitbake-hashclient: Add commands to get hashes
Adds subcommands to query the server for equivalent hashes and for output hashes. (Bitbake rev: 36ba202232399738670c9fb11169ead5590a3e82) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/hashserv/tests.py')
-rw-r--r--bitbake/lib/hashserv/tests.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/tests.py b/bitbake/lib/hashserv/tests.py
index a9e6fdf9ff..869f7636c5 100644
--- a/bitbake/lib/hashserv/tests.py
+++ b/bitbake/lib/hashserv/tests.py
@@ -842,6 +842,26 @@ class TestHashEquivalenceClient(HashEquivalenceTestSetup, unittest.TestCase):
842 def get_server_addr(self, server_idx): 842 def get_server_addr(self, server_idx):
843 return "unix://" + os.path.join(self.temp_dir.name, 'sock%d' % server_idx) 843 return "unix://" + os.path.join(self.temp_dir.name, 'sock%d' % server_idx)
844 844
845 def test_get(self):
846 taskhash, outhash, unihash = self.create_test_hash(self.client)
847
848 p = self.run_hashclient(["--address", self.server_address, "get", self.METHOD, taskhash])
849 data = json.loads(p.stdout)
850 self.assertEqual(data["unihash"], unihash)
851 self.assertEqual(data["outhash"], outhash)
852 self.assertEqual(data["taskhash"], taskhash)
853 self.assertEqual(data["method"], self.METHOD)
854
855 def test_get_outhash(self):
856 taskhash, outhash, unihash = self.create_test_hash(self.client)
857
858 p = self.run_hashclient(["--address", self.server_address, "get-outhash", self.METHOD, outhash, taskhash])
859 data = json.loads(p.stdout)
860 self.assertEqual(data["unihash"], unihash)
861 self.assertEqual(data["outhash"], outhash)
862 self.assertEqual(data["taskhash"], taskhash)
863 self.assertEqual(data["method"], self.METHOD)
864
845 def test_stats(self): 865 def test_stats(self):
846 p = self.run_hashclient(["--address", self.server_address, "stats"], check=True) 866 p = self.run_hashclient(["--address", self.server_address, "stats"], check=True)
847 json.loads(p.stdout) 867 json.loads(p.stdout)