1 # Copyright (c) 2020 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 | | FOR | ${action} | IN | @{actions}
34 | | | Run Keyword | Additional Suite Tear Down Action For ${action}
36 | | Remove All Added VIF Ports On All DUTs From Topology | ${nodes}
38 | Additional Suite Tear Down Action For performance
40 | | ... | Additional teardown for suites which uses performance measurement.
42 | | Run Keyword And Ignore Error | Teardown traffic generator | ${tg}
44 | Additional Suite Tear Down Action For dpdk
46 | | ... | Additional teardown for suites which uses dpdk.
48 | | FOR | ${dut} | IN | @{duts}
49 | | | Cleanup DPDK Framework
50 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}1}[0] | ${${dut}_${int}2}[0]
53 | Additional Suite Tear Down Action For wrk
55 | | ... | Additional teardown for suites which uses wrk.
57 | | ${intf_name}= | Get Linux interface name | ${tg}
58 | | ... | ${tg['interfaces']['${tg_if1}']['pci_address']}
59 | | FOR | ${ip_addr} | IN | @{wrk_ip_addrs}
60 | | | ${ip_addr_on_intf}= | Linux Interface Has IP | ${tg} | ${intf_name}
61 | | | ... | ${ip_addr} | ${wrk_ip_prefix}
62 | | | Run Keyword If | ${ip_addr_on_intf}==${True} | Delete Linux Interface IP
63 | | | ... | ${tg} | ${intf_name} | ${ip_addr} | ${wrk_ip_prefix}
65 | | Run Keyword And Ignore Error | PCI Driver Unbind
66 | | ... | ${tg} | ${tg['interfaces']['${tg_if1}']['pci_address']}
67 | | Run Keyword And Ignore Error | PCI Driver Unbind
68 | | ... | ${tg} | ${tg['interfaces']['${tg_if2}']['pci_address']}
70 | Additional Suite Tear Down Action For hoststack
72 | | ... | Additional teardown for suites which uses hoststack test programs.
73 | | ... | Ensure all hoststack test programs are no longer running on all DUTS.
75 | | FOR | ${dut} | IN | @{duts}
76 | | | Kill Program | ${nodes['${dut}']} | iperf3
77 | | | Kill Program | ${nodes['${dut}']} | vpp_echo