diff --git a/src/python/devtest/os/test/test.py b/src/python/devtest/os/test/test.py index 045050c..86e44c2 100644 --- a/src/python/devtest/os/test/test.py +++ b/src/python/devtest/os/test/test.py @@ -8,11 +8,13 @@ from ..misc import * from ..Connection import Connection from ..Connections import Connections -async def expect(conn, cmd=None, regex=None, subject=None, act_timeout=0.1, total_timeout=None): # export +async def expect(conn, cmd=None, regex=None, subject=None, act_timeout=0.1, total_timeout=None, log_act=None): # export # regex is a keyword-argument so that other arguments to support other # checks can be added later if regex is None: raise Exception("passed empty pattern to test.expect()") + if log_act is None: + log_act = INFO if cmd is not None: if isinstance(cmd, str) and not cmd.endswith('\n'): cmd += '\n' @@ -35,7 +37,7 @@ async def expect(conn, cmd=None, regex=None, subject=None, act_timeout=0.1, tota else: slog(INFO, "reading from console timed out after %d seconds of inactivity" % act_timeout) return None - slog(INFO, "read from console: >%s<" % buf, only_printable=True) + slog(log_act, "read from console: >%s<" % buf, only_printable=True) if len(buf) == 0: raise Exception('connection "{}" reset while waiting on {}'.format(conn, subject)) if re.search(regex, buf):