From 884e28f66b01a8bf21f855f91875f22defa121ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= Date: Tue, 12 Jun 2012 19:45:51 +0200 Subject: wintest: check netcats exitstatus instead of output There are many netcat implementations with different output messages. Signed-off-by: Kai Blin --- wintest/wintest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wintest/wintest.py b/wintest/wintest.py index 94d54de1500..93da47a6a62 100644 --- a/wintest/wintest.py +++ b/wintest/wintest.py @@ -492,9 +492,12 @@ options { while retries > 0: child = self.pexpect_spawn("nc -v -z -w 1 %s %u" % (hostname, port), crlf=False, timeout=1) - i = child.expect(['succeeded', 'failed', pexpect.EOF, pexpect.TIMEOUT]) + child.expect([pexpect.EOF, pexpect.TIMEOUT]) + child.close() + i = child.exitstatus if wait_for_fail: - if i > 0: + #wait for timeout or fail + if i == None or i > 0: return else: if i == 0: -- cgit v1.2.1