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 suite teardowns."""
17 | Library | resources.libraries.python.DPDK.DPDKTools
18 | Library | resources.libraries.python.TrafficGenerator
19 | Library | resources.libraries.python.DUTSetup
21 | Documentation | Suite teardown keywords.
26 | | ... | Common suite teardown for tests.
28 | | ... | *Arguments:*
29 | | ... | - ${actions} - Additional teardown action. Type: list
31 | | [Arguments] | @{actions}
33 | | Start Suite Teardown Export
34 | | FOR | ${action} | IN | @{actions}
35 | | | Run Keyword | Additional Suite Tear Down Action For ${action}
37 | | Remove All Added VIF Ports On All DUTs From Topology | ${nodes}
38 | | Finalize Suite Teardown Export
40 | Additional Suite Tear Down Action For ab
42 | | ... | Additional teardown for suites which uses ab.
44 | | ${intf_name}= | Get Linux interface name | ${tg}
45 | | ... | ${tg['interfaces']['${tg_if1}']['pci_address']}
46 | | FOR | ${ip_addr} | IN | @{ab_ip_addrs}
47 | | | ${ip_addr_on_intf}= | Linux Interface Has IP | ${tg} | ${intf_name}
48 | | | ... | ${ip_addr} | ${ab_ip_prefix}
49 | | | Run Keyword If | ${ip_addr_on_intf}==${True} | Delete Linux Interface IP
50 | | | ... | ${tg} | ${intf_name} | ${ip_addr} | ${ab_ip_prefix}
53 | Additional Suite Tear Down Action For performance
55 | | ... | Additional teardown for suites which uses performance measurement.
57 | | Run Keyword And Ignore Error | Teardown traffic generator | ${tg}
59 | Additional Suite Tear Down Action For dpdk
61 | | ... | Additional teardown for suites which uses dpdk.
63 | | FOR | ${dut} | IN | @{duts}
64 | | | Cleanup DPDK Framework
65 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}1}[0] | ${${dut}_${int}2}[0]
68 | Additional Suite Tear Down Action For hoststack
70 | | ... | Additional teardown for suites which uses hoststack test programs.
71 | | ... | Ensure all hoststack test programs are no longer running on all DUTS.
73 | | FOR | ${dut} | IN | @{duts}
74 | | | Kill Program | ${nodes['${dut}']} | iperf3
75 | | | Kill Program | ${nodes['${dut}']} | vpp_echo