diff options
Diffstat (limited to 'tests/vm/basevm.py')
-rwxr-xr-x | tests/vm/basevm.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 494d62e1bc..b5d1479bee 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -207,7 +207,7 @@ class BaseVM(object): # log console line sys.stderr.write("con recv: %s\n" % line) - def console_wait(self, expect): + def console_wait(self, expect, expectalt = None): vm = self._guest output = "" while True: @@ -216,6 +216,8 @@ class BaseVM(object): except socket.timeout: sys.stderr.write("console: *** read timeout ***\n") sys.stderr.write("console: waiting for: '%s'\n" % expect) + if not expectalt is None: + sys.stderr.write("console: waiting for: '%s' (alt)\n" % expectalt) sys.stderr.write("console: line buffer:\n") sys.stderr.write("\n") self.console_log(output.rstrip()) @@ -224,6 +226,8 @@ class BaseVM(object): output += chars.decode("latin1") if expect in output: break + if not expectalt is None and expectalt in output: + break if "\r" in output or "\n" in output: lines = re.split("[\r\n]", output) output = lines.pop() @@ -231,6 +235,9 @@ class BaseVM(object): self.console_log("\n".join(lines)) if self.debug: self.console_log(output) + if not expectalt is None and expectalt in output: + return False + return True def console_send(self, command): vm = self._guest |