diff options
Diffstat (limited to 'resources/libraries')
-rw-r--r-- | resources/libraries/python/HoststackUtil.py | 11 | ||||
-rw-r--r-- | resources/libraries/python/model/parse.py | 14 | ||||
-rw-r--r-- | resources/libraries/robot/hoststack/hoststack.robot | 6 |
3 files changed, 21 insertions, 10 deletions
diff --git a/resources/libraries/python/HoststackUtil.py b/resources/libraries/python/HoststackUtil.py index 3ada07b2a4..cb3970ff0c 100644 --- a/resources/libraries/python/HoststackUtil.py +++ b/resources/libraries/python/HoststackUtil.py @@ -285,7 +285,7 @@ class HoststackUtil(): # NGINX used `worker_cpu_affinity` in configuration file taskset_cmd = u"" if program_name == u"nginx" else \ f"taskset --cpu-list {core_list}" - cmd = f"nohup {shell_cmd} \'{env_vars}{taskset_cmd} " \ + cmd = f"nohup {taskset_cmd} {shell_cmd} \'{env_vars} " \ f"{program_path}{program_name} {args} >/tmp/{program_name}_" \ f"stdout.log 2>/tmp/{program_name}_stderr.log &\'" try: @@ -322,6 +322,15 @@ class HoststackUtil(): exec_cmd_no_error(node, cmd, message=errmsg, sudo=True) @staticmethod + def sleep_for_hoststack_test_duration(sleep_time): + """Wait for the HostStack test program process to complete. + + :param sleep_time: waiting stecific time. + """ + logger.info(f"Sleeping for {sleep_time} seconds") + sleep(sleep_time + 1) + + @staticmethod def hoststack_test_program_finished(node, program_pid, program, other_node, other_program): """Wait for the specified HostStack test program process to complete. diff --git a/resources/libraries/python/model/parse.py b/resources/libraries/python/model/parse.py index 6f4505262e..1e0aebfe18 100644 --- a/resources/libraries/python/model/parse.py +++ b/resources/libraries/python/model/parse.py @@ -1,4 +1,4 @@ -# Copyright (c) 2025 Cisco and/or its affiliates. +# Copyright (c) 2024 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -93,21 +93,19 @@ def parse(dirpath: str, fake_value: float = 1.0) -> Dict[str, List[float]]: result_object = data["result"] result_type = result_object["type"] if result_type == "mrr": - result_list = result_object["receive_rate"]["rate"]["values"] + results[name] = result_object["receive_rate"]["rate"]["values"] elif result_type == "ndrpdr": - result_list = [result_object["pdr"]["lower"]["rate"]["value"]] + results[name] = [result_object["pdr"]["lower"]["rate"]["value"]] elif result_type == "soak": - result_list = [ + results[name] = [ result_object["critical_rate"]["lower"]["rate"]["value"] ] elif result_type == "reconf": - result_list = [result_object["loss"]["time"]["value"]] + results[name] = [result_object["loss"]["time"]["value"]] elif result_type == "hoststack": - result_list = [result_object["bandwidth"]["value"]] + results[name] = [result_object["bandwidth"]["value"]] else: raise RuntimeError(f"Unknown result type: {result_type}") - # Negative values from csit/issues/3983 need to be ignored. - results[name] = [float(val) for val in result_list if val >= 0] results = {test_id: results[test_id] for test_id in sorted(results)} with open(resultpath, "wt", encoding="utf8") as file_out: json.dump(results, file_out, indent=1, separators=(", ", ": ")) diff --git a/resources/libraries/robot/hoststack/hoststack.robot b/resources/libraries/robot/hoststack/hoststack.robot index 643a67cd85..6d1f49a4fb 100644 --- a/resources/libraries/robot/hoststack/hoststack.robot +++ b/resources/libraries/robot/hoststack/hoststack.robot @@ -44,6 +44,7 @@ | ... | sess_v4_hopen_mem=64M | ... | sess_lendpt_buckets=250000 | ... | sess_lendpt_mem=512M +| ... | strace=${False} | &{vpp_echo_server_attr}= | ... | role=server | ... | cpu_cnt=${1} @@ -565,8 +566,11 @@ | | ... | ${dut1} | ${dut1_if1} | ${dut1_if1_ip4_addr} | ${dut1_if1_ip4_prefix} | | ... | ${iperf3_client_attr}[namespace] | ${core_list} | | ... | ${iperf3_client_attr}[cfg_vpp_feature] | ${iperf3_client} -| | When Hoststack Test Program Finished | ${dut1} | ${client_pid} +| | Run Keyword If | ${vpp_hoststack_attr}[strace] +| | ... | When Hoststack Test Program Finished | ${dut1} | ${client_pid} | | ... | ${iperf3_client} | ${dut2} | ${iperf3_server} +| | ... | ELSE +| | ... | Sleep For Hoststack Test Duration | ${iperf3_client_attr}[time] | | FOR | ${action} | IN | @{stat_post_trial} | | | Run Keyword | Additional Statistics Action For ${action} | | END |