diff --git a/src/python/devtest/os/test/test.py b/src/python/devtest/os/test/test.py index 86e44c2..219bb7c 100644 --- a/src/python/devtest/os/test/test.py +++ b/src/python/devtest/os/test/test.py @@ -45,14 +45,14 @@ async def expect(conn, cmd=None, regex=None, subject=None, act_timeout=0.1, tota return buf raise Exception("never reached") -async def cmd_expect(conn, cmd, subject=None, regex=None, log_act=None, act_timeout=0.1): # export +async def cmd_expect(conn, cmd, subject=None, regex=None, log_act=None, act_timeout=0.1, echo_cmd=None): # export slog(NOTICE, 'sending command "{}"'.format(str(cmd).rstrip("\n"))) - res = await cmd_exec(conn, cmd) + res = await cmd_exec(conn, cmd, echo_cmd=echo_cmd) if not isinstance(res, list): msg = 'failed to send command over connection {}'.format(conn) slog(ERR, 'FAIL: ' + msg) return msg - if expect(conn, regex=regex, subject=subject, act_timeout=act_timeout, log_act=log_act): + if await expect(conn, regex=regex, subject=subject, act_timeout=act_timeout, log_act=log_act): slog(NOTICE, 'PASS: found pattern "{}" in command output'.format(regex)) return None r = "FAIL: failed to find {} in command output".format(regex)