diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2023-11-03 08:26:33 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-09 17:33:03 +0000 |
commit | 3a2c5a6fa2e0081c28d5f2f43e1d9a79d093ea37 (patch) | |
tree | f596b84a7295cd8421fcee447a10e2c082b94c72 /bitbake/lib/hashserv/tests.py | |
parent | 8cfb94c06cdfe3e6f0ec1ce0154951108bc3df94 (diff) | |
download | poky-3a2c5a6fa2e0081c28d5f2f43e1d9a79d093ea37.tar.gz |
bitbake: hashserv: Add db-usage API
Adds an API to query the server for the usage of the database (e.g. how
many rows are present in each table)
(Bitbake rev: c9c1224447e147e0de92953bc85cea75670b898c)
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.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/tests.py b/bitbake/lib/hashserv/tests.py index 311b7b7772..9d5bec2454 100644 --- a/bitbake/lib/hashserv/tests.py +++ b/bitbake/lib/hashserv/tests.py | |||
@@ -767,6 +767,15 @@ class HashEquivalenceCommonTests(object): | |||
767 | with self.auth_perms("@user-admin") as client: | 767 | with self.auth_perms("@user-admin") as client: |
768 | become = client.become_user(client.username) | 768 | become = client.become_user(client.username) |
769 | 769 | ||
770 | def test_get_db_usage(self): | ||
771 | usage = self.client.get_db_usage() | ||
772 | |||
773 | self.assertTrue(isinstance(usage, dict)) | ||
774 | for name in usage.keys(): | ||
775 | self.assertTrue(isinstance(usage[name], dict)) | ||
776 | self.assertIn("rows", usage[name]) | ||
777 | self.assertTrue(isinstance(usage[name]["rows"], int)) | ||
778 | |||
770 | 779 | ||
771 | class TestHashEquivalenceUnixServer(HashEquivalenceTestSetup, HashEquivalenceCommonTests, unittest.TestCase): | 780 | class TestHashEquivalenceUnixServer(HashEquivalenceTestSetup, HashEquivalenceCommonTests, unittest.TestCase): |
772 | def get_server_addr(self, server_idx): | 781 | def get_server_addr(self, server_idx): |