SUT Updaters: package fuzzinator.update

class fuzzinator.update.SubprocessUpdate(*, command, cwd=None, env=None, timeout=None, encoding=None, **kwargs)

Subprocess invocation-based SUT update.

Mandatory parameter of the SUT update:

  • command: string to pass to the child shell as a command to run.

Optional parameters of the SUT update:

  • cwd: if not None, change working directory before the command invocation.

  • env: if not None, a dictionary of variable names-values to update the environment with.

  • timeout: run subprocess with timeout.

  • encoding: stdout and stderr encoding (default: autodetect).

Example configuration snippet:

[sut.foo]
update=fuzzinator.update.SubprocessUpdate
#update_condition=... is needed to trigger the update

[sut.foo.update]
command=git pull && make
cwd=/home/alice/foo
env={"BAR": "1"}
class fuzzinator.update.TimestampUpdateCondition(*, path, age, **kwargs)

File timestamp-based SUT update condition.

Mandatory parameters of the SUT update condition:

  • path: path to a file or directory to check for its last modification time.

  • age: maximum allowed age of path given in [days:][hours:][minutes:]seconds format.

Result of the SUT update condition:

  • Returns True if path does not exist or is older than age.

Example configuration snippet:

[sut.foo]
update_condition=fuzzinator.update.TimestampUpdateCondition
#update=... will be triggered if file timestamp is too old

[sut.foo.update_condition]
path=/home/alice/foo/bin/foo
age=7:00:00:00
class fuzzinator.update.Update

Abstract base class to represent how a software-under-test (SUT) can be updated.

__call__()

Update the SUT.

Raises NotImplementedError by default.

class fuzzinator.update.UpdateCondition

Abstract base class to represent how to determine whether a software-under-test (SUT) should be updated.

__call__()

Return whether the SUT is outdated and an update should be perfromed.

Raises NotImplementedError by default.

Returns:

True if the SUT should be updated, false otherwise.

Return type:

bool