Skip to content

Commit

Permalink
Changes to support client-server and standalone stress tool runs
Browse files Browse the repository at this point in the history
This commit has few changes[1,2] required to support running
stress workloads in server-client mode as well as standalone mode
in parallel. Change [3] is a minor fix for handling stress unload.
1. Rename param which is used to specify custom server-client pairs.
2. Now users can run stress tools which are client-server based as well
as standalone stress tools together. So place existing check under condition
when user chooses only 'client_server' type of stress load.
3. In case of stopping stress app, in some cases have seen delays to stop
stress app, giving couple of seconds sleep after stop_cmd fixes the issue

new param which can be used in testcases to configure stress run mode
is documented in base.cfg.

Signed-off-by: Srikanth Aithal <[email protected]>
  • Loading branch information
Srikanth Aithal committed Aug 30, 2019
1 parent 31f4ce2 commit 8908610
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions shared/cfg/base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,10 @@ libvirtd_log_cleanup = "yes"
#uperf_protocol = "tcp"
#Client profile to run for uperf tests
#client_profile_uperf = "shared/deps/uperf/iperf.xml"
#stress_config can have below possible values:
# 1> client_server: stress workloads which requires client server setup: eg:uperf
# 2> standalone: stress workloads which are standalone. eg: stress-ng
# 3> mix: running both client server workload and standalone stress workload in parallel

# params to enable/disable sosreport for host/remote host
enable_host_sosreport = "no"
Expand Down
17 changes: 9 additions & 8 deletions virttest/utils_test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2157,7 +2157,7 @@ def _unload_stress():

logging.info("stop stress app in guest/host/remote host")
utils_misc.wait_for(_unload_stress, self.stress_wait_for_timeout, first=2.0,
text="wait stress app quit", step=1.0)
text="wait stress app quit", step=2.0)

def app_running(self):
"""
Expand Down Expand Up @@ -2547,7 +2547,8 @@ def __init__(self, params, env):
self.need_profile = int(params.get("need_profile", False))
self.server_cmd = params.get("%s_server_cmd" % self.stress_type)
self.client_cmd = params.get("%s_client_cmd" % self.stress_type)
self.custom_pair = params.get("server_clients", "").split()
self.custom_pair = params.get("vm_pair", "").split()
stress_config = params.get("stress_config", "client_server")
self.server_vms = []
self.client_vms = []
self.stress_vm = {}
Expand All @@ -2569,14 +2570,14 @@ def __init__(self, params, env):
self.server_vms.append(vm)
if vm.name == pair.split("_")[1]:
self.client_vms.append(vm)
if (len(set(self.server_vms)) + len(set(self.client_vms))) != len(self.vms):
raise exceptions.TestError(
"Number of server client vms does not match total_vms")
elif len(self.server_vms) != len(self.client_vms):
if stress_config != "mix":
if (len(set(self.server_vms)) + len(set(self.client_vms))) != len(self.vms):
raise exceptions.TestError(
"Number of server client vms does not match total_vms")
if len(self.server_vms) != len(self.client_vms):
raise exceptions.TestError(
"This test requires server and client vms in 1:1 ratio")
else:
self.pair_vms = zip(self.server_vms, self.client_vms)
self.pair_vms = zip(self.server_vms, self.client_vms)

def prepare_profile(self, fpath, pat_repl):
"""
Expand Down

0 comments on commit 8908610

Please sign in to comment.