From 6a680137694233008005415e22cf889b85baa292 Mon Sep 17 00:00:00 2001 From: Hector Fernandez Date: Thu, 16 Apr 2020 17:09:19 +0200 Subject: First release --- test-cli/test/tests/qethernet.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'test-cli/test/tests/qethernet.py') diff --git a/test-cli/test/tests/qethernet.py b/test-cli/test/tests/qethernet.py index 027931c..2246029 100644 --- a/test-cli/test/tests/qethernet.py +++ b/test-cli/test/tests/qethernet.py @@ -6,12 +6,11 @@ import re class Qethernet(unittest.TestCase): __serverip = None __numbytestx = None - __bind = None __bwexpected = None __port = None params = None - #varlist content: serverip, bwexpected, port, (optional)bind + # varlist content: serverip, bwexpected, port def __init__(self, testname, testfunc, varlist): self.params = varlist super(Qethernet, self).__init__(testfunc) @@ -32,7 +31,11 @@ class Qethernet(unittest.TestCase): def execute(self): # execute iperf command against the server - p = sh.iperf("-c", self.__serverip, "-x", "CMSV", "-n", self.__numbytestx, "-f", "m", "-p", self.__port) + try: + p = sh.iperf("-c", self.__serverip, "-x", "CMSV", "-n", self.__numbytestx, "-f", "m", "-p", self.__port, + _timeout=20) + except sh.TimeoutException: + self.fail("failed: iperf timeout reached") # check if it was executed succesfully if p.exit_code == 0: -- cgit v1.1