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
20 | Documentation | Suite teardown keywords.
25 | | ... | Common suite teardown for tests.
27 | | ... | *Arguments:*
28 | | ... | - ${actions} - Additional teardown action. Type: list
30 | | [Arguments] | @{actions}
32 | | FOR | ${action} | IN | @{actions}
33 | | | Run Keyword | Additional Suite Tear Down Action For ${action}
35 | | Remove All Added VIF Ports On All DUTs From Topology | ${nodes}
37 | Additional Suite Tear Down Action For performance
39 | | ... | Additional teardown for suites which uses performance measurement.
41 | | Teardown traffic generator | ${tg}
43 | Additional Suite Tear Down Action For dpdk
45 | | ... | Additional teardown for suites which uses dpdk.
47 | | FOR | ${dut} | IN | @{duts}
48 | | | Cleanup DPDK Environment
49 | | | ... | ${nodes['${dut}']} | ${${dut}_if1} | ${${dut}_if2}
52 | Additional Suite Tear Down Action For wrk
54 | | ... | Additional teardown for suites which uses wrk.
56 | | ${intf_name}= | Get Linux interface name | ${tg}
57 | | ... | ${tg['interfaces']['${tg_if1}']['pci_address']}
58 | | FOR | ${ip_addr} | IN | @{wrk_ip_addrs}
59 | | | ${ip_addr_on_intf}= | Linux Interface Has IP | ${tg} | ${intf_name}
60 | | | ... | ${ip_addr} | ${wrk_ip_prefix}
61 | | | Run Keyword If | ${ip_addr_on_intf}==${True} | Delete Linux Interface IP
62 | | | ... | ${tg} | ${intf_name} | ${ip_addr} | ${wrk_ip_prefix}
64 | | Run Keyword And Ignore Error | PCI Driver Unbind
65 | | ... | ${tg} | ${tg['interfaces']['${tg_if1}']['pci_address']}
66 | | Run Keyword And Ignore Error | PCI Driver Unbind
67 | | ... | ${tg} | ${tg['interfaces']['${tg_if2}']['pci_address']}