SimpleCore helper utility extensions.

UtilityExtensions#

class UtilityExtensions()

Collection of utilities.

retry#

@staticmethod
def retry(testcase,
          evalfunc,
          getfunc,
          getargs=(),
          repeat=5,
          backoff=5,
          failmsg="")

Retry testing for a condition

Arguments:

  • testcase testcase - Reference to testcase

  • evalfunc Callable - function to check result, must return True

  • getfunc Callable - function to refresh the check value

  • getargs Iterable, optional - Optional arguments to the getfunc. Defaults to None.

  • repeat int, optional - Number of times to repeat the check. Defaults to 5.

  • backoff int, optional - Retry delay in seconds. Defaults to 5.

  • failmsg str, optional - Optional failure message. Defaults to “”.

interactive#

@staticmethod
def interactive(msg="", choices=None, default=None)

Interactive questions in a test.

copy_to#

@staticmethod
def copy_to(src, dst)

Copy files/folder on the host side.

run_host#

@staticmethod
def run_host(args, **kwargs)

Run a process on the host side.