Skip to content

Commit

Permalink
tests: added honey badger utility to ducktape
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Maslanka <michal@vectorized.io>
  • Loading branch information
mmaslankaprv committed May 21, 2021
1 parent b236067 commit e39de2b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tests/rptest/services/honey_badger.py
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}'))

0 comments on commit e39de2b

Please sign in to comment.