From 424749b09ac91c4eb5eabdd8bdd9d34b8c130783 Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Fri, 28 Sep 2018 13:55:42 +0000 Subject: [PATCH] CSIT-1326 Add barrier event traces Change-Id: I0f734c2f11cc89716371554880f1d7404ea16090 Signed-off-by: Peter Mikus --- resources/libraries/python/VPPUtil.py | 43 +++++++++++++ .../robot/performance/performance_setup.robot | 73 ---------------------- .../robot/performance/performance_utils.robot | 4 ++ resources/templates/vat/show_event_logger.vat | 1 + .../templates/vat/test_threads_barrier_elog.vat | 1 + 5 files changed, 49 insertions(+), 73 deletions(-) create mode 100644 resources/templates/vat/show_event_logger.vat create mode 100644 resources/templates/vat/test_threads_barrier_elog.vat diff --git a/resources/libraries/python/VPPUtil.py b/resources/libraries/python/VPPUtil.py index 17310aa21a..f6b3afae28 100644 --- a/resources/libraries/python/VPPUtil.py +++ b/resources/libraries/python/VPPUtil.py @@ -211,3 +211,46 @@ class VPPUtil(object): for node in nodes.values(): if node['type'] == NodeType.DUT: VPPUtil.vpp_enable_traces_on_dut(node) + + @staticmethod + def vpp_enable_barrier_traces_on_dut(node): + """Enable vpp barrier traces on the DUT node. + + :param node: DUT node to set up. + :type node: dict + """ + vat = VatExecutor() + vat.execute_script("test_threads_barrier_elog.vat", node, + json_out=False) + + @staticmethod + def vpp_enable_barrier_traces_on_all_duts(nodes): + """Enable vpp barrier traces on all DUTs in the given topology. + + :param nodes: Nodes in the topology. + :type nodes: dict + """ + for node in nodes.values(): + if node['type'] == NodeType.DUT: + VPPUtil.vpp_enable_barrier_traces_on_dut(node) + + @staticmethod + def show_event_logger_on_dut(node): + """Show event logger on the DUT node. + + :param node: DUT node to show traces on. + :type node: dict + """ + vat = VatExecutor() + vat.execute_script("show_event_logger.vat", node, json_out=False) + + @staticmethod + def show_event_logger_on_all_duts(nodes): + """Show event logger on all DUTs in the given topology. + + :param nodes: Nodes in the topology. + :type nodes: dict + """ + for node in nodes.values(): + if node['type'] == NodeType.DUT: + VPPUtil.show_event_logger_on_dut(node) \ No newline at end of file diff --git a/resources/libraries/robot/performance/performance_setup.robot b/resources/libraries/robot/performance/performance_setup.robot index f5288e7a4b..f92f88b219 100644 --- a/resources/libraries/robot/performance/performance_setup.robot +++ b/resources/libraries/robot/performance/performance_setup.robot @@ -24,67 +24,6 @@ # Keywords used in setups and teardowns -| Set variables in 2-node circular topology -| | [Documentation] -| | ... | Compute path for testing on two given nodes in circular -| | ... | topology and set corresponding suite variables. -| | ... -| | ... | _NOTE:_ This KW sets following suite variables: -| | ... | - tg - TG node -| | ... | - tg_if1 - 1st TG interface towards DUT. -| | ... | - tg_if2 - 2nd TG interface towards DUT. -| | ... | - dut1 - DUT1 node -| | ... | - dut1_if1 - 1st DUT interface towards TG. -| | ... | - dut1_if2 - 2nd DUT interface towards TG. -| | ... -| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} -| | Compute Path | always_same_link=${FALSE} -| | ${tg_if1} | ${tg}= | First Interface -| | ${dut1_if1} | ${dut1}= | First Ingress Interface -| | ${dut1_if2} | ${dut1}= | Last Egress Interface -| | ${tg_if2} | ${tg}= | Last Interface -| | Set Suite Variable | ${tg} -| | Set Suite Variable | ${tg_if1} -| | Set Suite Variable | ${tg_if2} -| | Set Suite Variable | ${dut1} -| | Set Suite Variable | ${dut1_if1} -| | Set Suite Variable | ${dut1_if2} - -| Set variables in 3-node circular topology -| | [Documentation] -| | ... | Compute path for testing on three given nodes in circular -| | ... | topology and set corresponding suite variables. -| | ... -| | ... | _NOTE:_ This KW sets following suite variables: -| | ... | - tg - TG node -| | ... | - tg_if1 - TG interface towards DUT1. -| | ... | - tg_if2 - TG interface towards DUT2. -| | ... | - dut1 - DUT1 node -| | ... | - dut1_if1 - DUT1 interface towards TG. -| | ... | - dut1_if2 - DUT1 interface towards DUT2. -| | ... | - dut2 - DUT2 node -| | ... | - dut2_if1 - DUT2 interface towards DUT1. -| | ... | - dut2_if2 - DUT2 interface towards TG. -| | ... -| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} -| | ... | ${nodes['TG']} -| | Compute Path -| | ${tg_if1} | ${tg}= | Next Interface -| | ${dut1_if1} | ${dut1}= | Next Interface -| | ${dut1_if2} | ${dut1}= | Next Interface -| | ${dut2_if1} | ${dut2}= | Next Interface -| | ${dut2_if2} | ${dut2}= | Next Interface -| | ${tg_if2} | ${tg}= | Next Interface -| | Set Suite Variable | ${tg} -| | Set Suite Variable | ${tg_if1} -| | Set Suite Variable | ${tg_if2} -| | Set Suite Variable | ${dut1} -| | Set Suite Variable | ${dut1_if1} -| | Set Suite Variable | ${dut1_if2} -| | Set Suite Variable | ${dut2} -| | Set Suite Variable | ${dut2_if1} -| | Set Suite Variable | ${dut2_if2} - | Set variables in 2-node circular topology with DUT interface model | | [Documentation] | | ... | Compute path for testing on two given nodes in circular topology @@ -732,18 +671,6 @@ | | ... | Traffic should pass with no loss | ${perf_trial_duration} | ${rate} | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False} -| Tear down performance ndrchk test -| | [Documentation] | Common test teardown for ndrchk performance tests. -| | ... -| | Remove All Added Ports On All DUTs From Topology | ${nodes} -| | Show VAT History On All DUTs | ${nodes} - -| Tear down performance pdrchk test -| | [Documentation] | Common test teardown for pdrchk performance tests. -| | ... -| | Remove All Added Ports On All DUTs From Topology | ${nodes} -| | Show VAT History On All DUTs | ${nodes} - | Tear down performance mrr test | | [Documentation] | Common test teardown for max-received-rate performance | | ... | tests. diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot index 80aaa1dc2c..e4ece560b8 100644 --- a/resources/libraries/robot/performance/performance_utils.robot +++ b/resources/libraries/robot/performance/performance_utils.robot @@ -814,6 +814,8 @@ | | Run Keyword If | ${dut_stats}==${True} | Clear all counters on all DUTs | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True} | | ... | VPP Enable Traces On All DUTs | ${nodes} +| | Run Keyword If | ${dut_stats}==${True} +| | ... | VPP enable barrier traces on all DUTs | ${nodes} | | ${results} = | Create List | | :FOR | ${i} | IN RANGE | ${subsamples} | | | Send traffic on tg | ${trial_duration} | ${rate} | ${framesize} @@ -821,6 +823,8 @@ | | | ${rx} = | Get Received | | | ${rr} = | Evaluate | ${rx} / ${trial_duration} | | | Append To List | ${results} | ${rr} +| | Run Keyword If | ${dut_stats}==${True} | Show event logger on all DUTs +| | ... | ${nodes} | | Run Keyword If | ${dut_stats}==${True} | Show statistics on all DUTs | | ... | ${nodes} | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True} diff --git a/resources/templates/vat/show_event_logger.vat b/resources/templates/vat/show_event_logger.vat new file mode 100644 index 0000000000..cebbb1ec55 --- /dev/null +++ b/resources/templates/vat/show_event_logger.vat @@ -0,0 +1 @@ +exec show event-logger diff --git a/resources/templates/vat/test_threads_barrier_elog.vat b/resources/templates/vat/test_threads_barrier_elog.vat new file mode 100644 index 0000000000..5be3c41b92 --- /dev/null +++ b/resources/templates/vat/test_threads_barrier_elog.vat @@ -0,0 +1 @@ +exec test threads barrier-elog enable -- 2.16.6