UTI: Export results
[csit.git] / resources / libraries / robot / shared / suite_teardown.robot
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:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
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.
13
14 """Keywords used in suite teardowns."""
15
16 *** Settings ***
17 | Library | resources.libraries.python.DPDK.DPDKTools
18 | Library | resources.libraries.python.TrafficGenerator
19 | Library | resources.libraries.python.DUTSetup
20 |
21 | Documentation | Suite teardown keywords.
22
23 *** Keywords ***
24 | Tear down suite
25 | | [Documentation]
26 | | ... | Common suite teardown for tests.
27 | |
28 | | ... | *Arguments:*
29 | | ... | - ${actions} - Additional teardown action. Type: list
30 | |
31 | | [Arguments] | @{actions}
32 | |
33 | | Start Suite Teardown Export
34 | | FOR | ${action} | IN | @{actions}
35 | | | Run Keyword | Additional Suite Tear Down Action For ${action}
36 | | END
37 | | Remove All Added VIF Ports On All DUTs From Topology | ${nodes}
38 | | Finalize Suite Teardown Export
39
40 | Additional Suite Tear Down Action For ab
41 | | [Documentation]
42 | | ... | Additional teardown for suites which uses ab.
43 | |
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}
51 | | END
52
53 | Additional Suite Tear Down Action For performance
54 | | [Documentation]
55 | | ... | Additional teardown for suites which uses performance measurement.
56 | |
57 | | Run Keyword And Ignore Error | Teardown traffic generator | ${tg}
58
59 | Additional Suite Tear Down Action For dpdk
60 | | [Documentation]
61 | | ... | Additional teardown for suites which uses dpdk.
62 | |
63 | | FOR | ${dut} | IN | @{duts}
64 | | | Cleanup DPDK Framework
65 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}1}[0] | ${${dut}_${int}2}[0]
66 | | END
67
68 | Additional Suite Tear Down Action For hoststack
69 | | [Documentation]
70 | | ... | Additional teardown for suites which uses hoststack test programs.
71 | | ... | Ensure all hoststack test programs are no longer running on all DUTS.
72 | |
73 | | FOR | ${dut} | IN | @{duts}
74 | | | Kill Program | ${nodes['${dut}']} | iperf3
75 | | | Kill Program | ${nodes['${dut}']} | vpp_echo