-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: added honey badger utility to ducktape
Signed-off-by: Michal Maslanka <michal@vectorized.io>
- Loading branch information
1 parent
b236067
commit e39de2b
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright 2021 Vectorized, Inc. | ||
# | ||
# Use of this software is governed by the Business Source License | ||
# included in the file licenses/BSL.md | ||
# | ||
# As of the Change Date specified in that file, in accordance with | ||
# the Business Source License, use of this software will be governed | ||
# by the Apache License, Version 2.0 | ||
import random | ||
import requests | ||
|
||
from rptest.services.admin import Admin | ||
|
||
|
||
class HoneyBadger: | ||
@staticmethod | ||
def is_enabled(node): | ||
return requests.get(Admin._url(node, | ||
'failure-probes')).json()['enabled'] | ||
|
||
@staticmethod | ||
def list_failure_probes(node): | ||
return requests.get(Admin._url(node, 'failure-probes')).json() | ||
|
||
@staticmethod | ||
def set_delay(node, module, probe): | ||
requests.post( | ||
Admin._url(node, f'failure-probes/{module}/{probe}/delay')) | ||
|
||
@staticmethod | ||
def set_terminate(node, module, probe): | ||
requests.post( | ||
Admin._url(node, f'failure-probes/{module}/{probe}/terminate')) | ||
|
||
@staticmethod | ||
def set_exception(node, module, probe): | ||
requests.post( | ||
Admin._url(node, f'failure-probes/{module}/{probe}/exception')) | ||
|
||
@staticmethod | ||
def unset_failures(node, module, probe): | ||
requests.delete(Admin._url(node, f'failure-probes/{module}/{probe}')) |