feat(hoststack): Add stat pre/post actions 24/40924/6
authorVratko Polak <vrpolak@cisco.com>
Tue, 28 May 2024 08:18:08 +0000 (10:18 +0200)
committerPeter Mikus <peter.mikus@protonmail.ch>
Tue, 28 May 2024 08:36:32 +0000 (08:36 +0000)
While adding runtime actions to hoststack tests is not easy,
adding pre and post actions for stats is easy.
The main hoststack measurement is treated as the stats trial,
the same way as the 10 measurements in MRR tests are.

+ Remove the previous partial info via "show" CLI commands.
- As in other VPP tests, stat telemetry is not exported.

Change-Id: Ib567aa810418568520d4d543c6d50431e85a3269
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
resources/libraries/python/HoststackUtil.py
resources/libraries/robot/hoststack/hoststack.robot

index 399395d..4ac73ff 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2023 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:
@@ -413,10 +413,6 @@ class HoststackUtil():
                 f"bits/sec, pkt-drop-rate {nsim_attr[u'packets_per_drop']} " \
                 f"pkts/drop\n"
 
-        test_results += \
-            f"\n{role} VPP 'show errors' on host {node[u'host']}:\n" \
-            f"{PapiSocketExecutor.run_cli_cmd(node, u'show error')}\n"
-
         if u"error" in program_stderr.lower():
             test_results += f"ERROR DETECTED:\n{program_stderr}"
             return (True, test_results)
@@ -469,18 +465,3 @@ class HoststackUtil():
         :rtype: bool
         """
         return server_defer_fail and client_defer_fail
-
-    @staticmethod
-    def log_vpp_hoststack_data(node):
-        """Retrieve and log VPP HostStack data.
-
-        :param node: DUT node.
-        :type node: dict
-        :raises RuntimeError: If node subtype is not a DUT or startup failed.
-        """
-
-        if node[u"type"] != u"DUT":
-            raise RuntimeError(u"Node type is not a DUT!")
-
-        PapiSocketExecutor.run_cli_cmd(node, u"show error")
-        PapiSocketExecutor.run_cli_cmd(node, u"show interface")
index 20c071d..0b82ff2 100644 (file)
 | | ${numa}= | Get interfaces numa node | ${dut2} | ${dut2_if1}
 | | ${core_list}= | Cpu list per node str | ${dut2} | ${numa}
 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${vpp_echo_server_attr}[cpu_cnt]
+| | FOR | ${action} | IN | @{stat_pre_trial}
+| | | Run Keyword | Additional Statistics Action For ${action}
+| | END
 | | ${server_pid}= | Run hoststack test program on DUT
 | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip4_addr} | ${dut2_if1_ip4_prefix}
 | | ... | ${vpp_echo_server_attr}[namespace] | ${core_list}
 | | ${server_defer_fail} | ${server_output}=
 | | ... | Analyze hoststack test program output | ${dut2} | Server
 | | ... | ${vpp_nsim_attr} | ${vpp_echo_server}
+| | FOR | ${action} | IN | @{stat_post_trial}
+| | | Run Keyword | Additional Statistics Action For ${action}
+| | END
 | | Set test message | ${server_output} | append=True
 | | Run Keyword And Return | Hoststack Test Program Defer Fail
 | | ... | ${server_defer_fail} | ${client_defer_fail}
 | | ${numa}= | Get interfaces numa node | ${dut2} | ${dut2_if1}
 | | ${core_list}= | Cpu list per node str | ${dut2} | ${numa}
 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${iperf3_server_attr}[cpu_cnt]
+| | FOR | ${action} | IN | @{stat_pre_trial}
+| | | Run Keyword | Additional Statistics Action For ${action}
+| | END
 | | ${server_pid}= | Run hoststack test program on DUT
 | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip4_addr} | ${dut2_if1_ip4_prefix}
 | | ... | ${iperf3_server_attr}[namespace] | ${core_list}
 | | ... | ${iperf3_client_attr}[cfg_vpp_feature] | ${iperf3_client}
 | | When Hoststack Test Program Finished | ${dut1} | ${client_pid}
 | | ... | ${iperf3_client} | ${dut2} | ${iperf3_server}
+| | FOR | ${action} | IN | @{stat_post_trial}
+| | | Run Keyword | Additional Statistics Action For ${action}
+| | END
 | | ${client_defer_fail} | ${client_output}=
 | | ... | Analyze hoststack test program output | ${dut1} | Client
 | | ... | ${vpp_nsim_attr} | ${iperf3_client}
 | |
 | | ${dut_ip_addrs_str} | Evaluate | ','.join(${dut_ip_addrs})
 | | ${ad_ip_addrs_str} | Evaluate | ','.join(${ab_ip_addrs})
+| | FOR | ${action} | IN | @{stat_pre_trial}
+| | | Run Keyword | Additional Statistics Action For ${action}
+| | END
 | | ${output}= | Run ab | ${tg} | ${dut_ip_addrs_str} | ${ad_ip_addrs_str}
 | | ... | ${tls_tcp} | ${ciphers} | ${files} | ${mode} | ${r_total} | ${c_total}
 | | ... | ${listen_port}
+| | FOR | ${action} | IN | @{stat_post_trial}
+| | | Run Keyword | Additional Statistics Action For ${action}
+| | END
 | | Set test message | ${output}
-| | Log VPP Hoststack data | ${dut1}
 
 | Configure VPP startup configuration for NGINX
 | | [Documentation]