dummynet.RunInfo

class dummynet.RunInfo(cmd, cwd, pid, stdout, stderr, returncode, is_async, is_daemon, timeout)

Stores the results from running a command

Variables:
__init__(cmd, cwd, pid, stdout, stderr, returncode, is_async, is_daemon, timeout)

Create a new object

Parameters:
  • cmd – The command that was executed

  • cwd – Current working directory i.e. path where the command was executed

  • pid – The process ID of the command

  • stdout – The standard output stream generated by the command

  • stderr – The standard error stream generated by the command

  • returncode – The return code set after invoking the command

  • is_async – Whether the command was run asynchronously

  • is_daemon – Whether the command was run as a daemon

  • timeout – The timeout in seconds, if None then no timeout

match(stdout=None, stderr=None)

Matches the lines in the output with the pattern. The match pattern can contain basic wildcards, see https://docs.python.org/2/library/fnmatch.html For convenience:

+-----------------------------------------+
|Pattern|Meaning                          |
+-----------------------------------------+
|*      |matches everything               |
+-----------------------------------------+
|?      |matches any single character     |
+-----------------------------------------+
|[seq]  |matches any character in seq     |
+-----------------------------------------+
|[!seq] |matches any character not in seq |
+-----------------------------------------+

Simple example:

out.match(stdout='*success*')
Parameters:
  • stdout – Pattern to search for in the list of stdout string

  • stderr – Pattern to search for in the list of stderr string

Raises:

MatchError – If the pattern is not found in the output