1 # Copyright (c) 2021 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
14 """Keywords used in test teardowns."""
17 | Resource | resources/libraries/robot/shared/container.robot
18 | Library | resources.libraries.python.PapiHistory
19 | Library | resources.libraries.python.topology.Topology
20 | Variables | resources/libraries/python/Constants.py
22 | Documentation | Test teardown keywords.
27 | | ... | Common test teardown for VPP tests.
29 | | ... | *Arguments:*
30 | | ... | - ${actions} - Additional teardown action. Type: list
32 | | [Arguments] | @{actions}
34 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
35 | | Show PAPI History On All DUTs | ${nodes}
36 | | Run Keyword If Test Failed
37 | | ... | Show Log On All DUTs | ${nodes}
38 | | Run Keyword If Test Failed
39 | | ... | Get Core Files on All Nodes | ${nodes}
40 | | Run Keyword If Test Failed
41 | | ... | Verify VPP PID in Teardown
42 | | Run Keyword If Test Failed
43 | | ... | VPP Show Memory On All DUTs | ${nodes}
44 | | FOR | ${action} | IN | @{actions}
45 | | | Run Keyword | Additional Test Tear Down Action For ${action}
47 | | Clean Sockets On All Nodes | ${nodes}
51 | | ... | Common test teardown for raw tests.
53 | | ... | *Arguments:*
54 | | ... | - ${actions} - Additional teardown action. Type: list
56 | | [Arguments] | @{actions}
58 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
59 | | FOR | ${action} | IN | @{actions}
60 | | | Run Keyword | Additional Test Tear Down Action For ${action}
62 | | Clean Sockets On All Nodes | ${nodes}
64 # Additional Test Tear Down Actions in alphabetical order
65 | Additional Test Tear Down Action For acl
67 | | ... | Additional teardown for tests which uses ACL feature.
69 | | Run Keyword If Test Failed
70 | | ... | Vpp Log Plugin Acl Settings | ${dut1}
71 | | Run Keyword If Test Failed
72 | | ... | Vpp Log Plugin Acl Interface Assignment | ${dut1}
74 | Additional Test Tear Down Action For classify
76 | | ... | Additional teardown for tests which uses classify tables.
78 | | Run Keyword If Test Failed
79 | | ... | Show Classify Tables Verbose on all DUTs | ${nodes}
81 | Additional Test Tear Down Action For container
83 | | ... | Additional teardown for tests which uses containers.
85 | | FOR | ${container_group} | IN | @{container_groups}
86 | | | Destroy all '${container_group}' containers
89 | Additional Test Tear Down Action For nginx
91 | | ... | Additional teardown for tests which uses nginx.
93 | | FOR | ${dut} | IN | @{duts}
94 | | | Kill Program | ${nodes['${dut}']} | nginx
97 | Additional Test Tear Down Action For det44
99 | | ... | Additional teardown for tests which uses DET44 feature.
101 | | FOR | ${dut} | IN | @{duts}
102 | | | Run Keyword If Test Failed
103 | | | ... | Show DET44 verbose | ${nodes['${dut}']}
106 | Additional Test Tear Down Action For geneve4
108 | | ... | Additional teardown for tests which uses GENEVE IPv4 tunnel.
110 | | FOR | ${dut} | IN | @{duts}
111 | | | Run Keyword If Test Failed
112 | | | ... | Show Geneve Tunnel Data | ${nodes['${dut}']}
115 | Additional Test Tear Down Action For iPerf3
117 | | ... | Additional teardown for test which uses iPerf3 server.
119 | | Run Keyword And Ignore Error
120 | | ... | Teardown iPerf | ${nodes['${iperf_server_node}']}
122 | Additional Test Tear Down Action For ipsec_sa
124 | | ... | Additional teardown for tests which uses IPSec security association.
126 | | FOR | ${dut} | IN | @{duts}
127 | | | Run Keyword If Test Failed
128 | | | ... | Show Ipsec Security Association | ${nodes['${dut}']}
131 | Additional Test Tear Down Action For linux_bridge
133 | | ... | Additional teardown for tests which uses linux_bridge.
135 | | FOR | ${dut} | IN | @{duts}
136 | | | Linux Del Bridge | ${nodes['${dut}']} | ${bid_TAP}
139 | Additional Test Tear Down Action For macipacl
141 | | ... | Additional teardown for tests which uses MACIP ACL feature.
143 | | Run Keyword If Test Failed
144 | | ... | Vpp Log Macip Acl Settings | ${dut1}
145 | | Run Keyword If Test Failed
146 | | ... | Vpp Log Macip Acl Interface Assignment | ${dut1}
148 | Additional Test Tear Down Action For namespace
150 | | ... | Additional teardown for tests which uses namespace.
152 | | FOR | ${dut} | IN | @{duts}
153 | | | Clean Up Namespaces | ${nodes['${dut}']}
156 | Additional Test Tear Down Action For nat-ed
158 | | ... | Additional teardown for tests which uses NAT feature.
160 | | FOR | ${dut} | IN | @{duts}
161 | | | Show NAT44 Config | ${nodes['${dut}']}
162 | | | Show NAT44 Summary | ${nodes['${dut}']}
163 | | | Show NAT Base Data | ${nodes['${dut}']}
164 | | | Vpp Get Ip Table Summary | ${nodes['${dut}']}
167 | Additional Test Tear Down Action For packet_trace
169 | | ... | Additional teardown for tests which uses packet trace.
171 | | Show Packet Trace on All DUTs | ${nodes}
173 | Additional Test Tear Down Action For telemetry
175 | | ... | Additional teardown for tests which uses telemetry reads.
177 | | Run Telemetry On All DUTs
178 | | ... | ${nodes} | profile=${telemetry_profile}.yaml
180 | Additional Test Tear Down Action For performance
182 | | ... | Additional teardown for tests which uses performance measurement.
183 | | ... | Optionally, call \${resetter} (if defined) to reset DUT state.
185 | | Run Keyword If Test Passed | Return From Keyword
186 | | ${use_latency} = | Get Use Latency
187 | | ${rate_for_teardown} = | Get Rate For Teardown
189 | | Set Test Variable | \${extended_debug} | ${True}
190 | | Send traffic at specified rate
191 | | ... | trial_duration=${1.0}
192 | | ... | rate=${rate_for_teardown}
193 | | ... | trial_multiplicity=${1}
194 | | ... | use_latency=${use_latency}
195 | | ... | duration_limit=${1.0}
197 | Additional Test Tear Down Action For srv6
199 | | ... | Additional teardown for tests which uses SRv6.
201 | | Run Keyword If Test Failed
202 | | ... | Show SR Policies on all DUTs | ${nodes}
203 | | Run Keyword If Test Failed
204 | | ... | Show SR Steering Policies on all DUTs | ${nodes}
205 | | Run Keyword If Test Failed
206 | | ... | Show SR LocalSIDs on all DUTs | ${nodes}
208 | Additional Test Tear Down Action For vhost
210 | | ... | Additional teardown for tests which uses vhost(s) and VM(s).
212 | | Show VPP vhost on all DUTs | ${nodes}
213 | | ${vnf_status} | ${value}= | Run Keyword And Ignore Error
214 | | ... | Keyword Should Exist | vnf_manager.Kill All VMs
215 | | Run Keyword If | '${vnf_status}' == 'PASS' | vnf_manager.Kill All VMs
217 | Additional Test Tear Down Action For vhost-pt
219 | | ... | Additional teardown for tests which uses pci-passtrough and VM(s).
221 | | ${vnf_status} | ${value}= | Run Keyword And Ignore Error
222 | | ... | Keyword Should Exist | vnf_manager.Kill All VMs
223 | | Run Keyword If | '${vnf_status}' == 'PASS' | vnf_manager.Kill All VMs