[PATCH] Keep iperf server running unless duration option is set
by Jan Tluka
---
Tests/TestIperf.py | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/Tests/TestIperf.py b/Tests/TestIperf.py
index 8b84484..c65ed2d 100644
--- a/Tests/TestIperf.py
+++ b/Tests/TestIperf.py
@@ -13,7 +13,6 @@ from Common.ShellProcess import ShellProcess
import time
class TestIperf(TestGeneric):
-
def _install_iperf(self):
# by default dies on failure
logging.info("trace: _install_iperf")
@@ -43,18 +42,25 @@ class TestIperf(TestGeneric):
def run_server(self, cmd):
server = ShellProcess(cmd)
- time.sleep(float(self.duration))
- server.read_nonblocking()
- server.kill()
+
+ if not self._keep_server_running:
+ time.sleep(float(self.duration))
+ server.read_nonblocking()
+ server.kill()
+ else:
+ server.wait()
def run(self):
+ self._keep_server_running = True
self._harness = "iperf-2.0.5"
self._harness_archive = self._harness + ".tar.gz"
self._harness_url = "http://sourceforge.net/projects/iperf/files/%s/download" % self._harness_archive
self.duration = self.get_opt("duration")
if self.duration is None:
- self.duration = 60
+ self.duration = 60 # for client purposes
+ else:
+ self._keep_server_running = False # for server purposes
# same for client and server
installed = self.get_opt("install_dir")
--
1.7.4.4
11 years, 5 months
[PATCH] Ignore failures produced by 'kill' and 'intr' commands.
by Jan Tluka
---
NetTest/NetTestCommand.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/NetTest/NetTestCommand.py b/NetTest/NetTestCommand.py
index aefd173..ca28abf 100644
--- a/NetTest/NetTestCommand.py
+++ b/NetTest/NetTestCommand.py
@@ -105,7 +105,11 @@ class NetTestCommandExec(NetTestCommandGeneric):
exec_cmd(self._command["value"])
self.set_pass()
except ExecCmdFail:
- self.set_fail("Command failed to execute")
+ if "bg_id" in self._command:
+ logging.info("Command probably intentionally killed. Passing.")
+ self.set_pass()
+ else:
+ self.set_fail("Command failed to execute")
class BgProcessException(Exception):
"""Base class for client errors."""
--
1.7.4.4
11 years, 5 months
[PATCH] TestIperf installed option
by Jan Tluka
The option helps with consequent runs of the test.
---
Tests/TestIperf.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Tests/TestIperf.py b/Tests/TestIperf.py
index 45eda95..8b84484 100644
--- a/Tests/TestIperf.py
+++ b/Tests/TestIperf.py
@@ -17,7 +17,6 @@ class TestIperf(TestGeneric):
def _install_iperf(self):
# by default dies on failure
logging.info("trace: _install_iperf")
- self._temp_dir = (exec_cmd("mktemp -d")[0]).strip()
exec_cmd("wget -P %s/ %s" % (self._temp_dir, self._harness_url) )
exec_cmd("cd %s; tar -xvzf %s" % (self._temp_dir, self._harness_archive))
exec_cmd("cd %s/%s; ./configure; make; " % (self._temp_dir, self._harness))
@@ -58,7 +57,12 @@ class TestIperf(TestGeneric):
self.duration = 60
# same for client and server
- self._install_iperf()
+ installed = self.get_opt("install_dir")
+ if installed is None:
+ self._temp_dir = (exec_cmd("mktemp -d")[0]).strip()
+ self._install_iperf()
+ else:
+ self._temp_dir = installed
role = self.get_mopt("role")
cmd = self._compose_iperf_cmd(role)
--
1.7.4.4
11 years, 5 months
[lnst] TestIperf installed option
by Jiří Pírko
commit 6cd92c563ce86c67bad3a159838a2d8f416b5187
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri Dec 9 17:03:49 2011 +0100
TestIperf installed option
The option helps with consequent runs of the test.
Signed-off-by: Jiri Pirko <jpirko(a)redhat.com>
Tests/TestIperf.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/Tests/TestIperf.py b/Tests/TestIperf.py
index 45eda95..8b84484 100644
--- a/Tests/TestIperf.py
+++ b/Tests/TestIperf.py
@@ -17,7 +17,6 @@ class TestIperf(TestGeneric):
def _install_iperf(self):
# by default dies on failure
logging.info("trace: _install_iperf")
- self._temp_dir = (exec_cmd("mktemp -d")[0]).strip()
exec_cmd("wget -P %s/ %s" % (self._temp_dir, self._harness_url) )
exec_cmd("cd %s; tar -xvzf %s" % (self._temp_dir, self._harness_archive))
exec_cmd("cd %s/%s; ./configure; make; " % (self._temp_dir, self._harness))
@@ -58,7 +57,12 @@ class TestIperf(TestGeneric):
self.duration = 60
# same for client and server
- self._install_iperf()
+ installed = self.get_opt("install_dir")
+ if installed is None:
+ self._temp_dir = (exec_cmd("mktemp -d")[0]).strip()
+ self._install_iperf()
+ else:
+ self._temp_dir = installed
role = self.get_mopt("role")
cmd = self._compose_iperf_cmd(role)
11 years, 5 months