diff options
Diffstat (limited to 'test-cli/test/tests/qethernet.py')
-rw-r--r-- | test-cli/test/tests/qethernet.py | 9 |
1 files changed, 6 insertions, 3 deletions
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: |