From d4563e2b282840fadae6244733dbbc1b5db9037d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Thu, 16 May 2024 03:05:40 -0400 Subject: [PATCH] test/pylib: rest_client: add get_injection() The /v2/error_injection/{injection} endpoint now has a GET method too, expose this. (cherry picked from commit 0c61b1822c203aeded5b73c3389bc2173a6b26a2) --- test/pylib/rest_client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/pylib/rest_client.py b/test/pylib/rest_client.py index 9547626ae0..2fe606c472 100644 --- a/test/pylib/rest_client.py +++ b/test/pylib/rest_client.py @@ -230,6 +230,14 @@ class ScyllaRESTAPIClient(): await self.client.post(f"/v2/error_injection/injection/{injection}", host=node_ip, params={"one_shot": str(one_shot)}, json={ key: str(value) for key, value in parameters.items() }) + async def get_injection(self, node_ip: str, injection: str) -> list[dict[str, Any]]: + """Read the state of the error injection named `injection` on `node_ip`. + The returned information includes whether the error injections is + active, as well as any parameters it might have. + Note: this only has an effect in specific build modes: debug,dev,sanitize. + """ + return await self.client.get_json(f"/v2/error_injection/injection/{injection}", host=node_ip) + async def move_tablet(self, node_ip: str, ks: str, table: str, src_host: HostID, src_shard: int, dst_host: HostID, dst_shard: int, token: int) -> None: await self.client.post(f"/storage_service/tablets/move", host=node_ip, params={ "ks": ks,