Fix: NAT44 deterministic moved to separate det44 plugin
[csit.git] / resources / libraries / robot / shared / test_teardown.robot
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:
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 test teardowns."""
15
16 *** Settings ***
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
21 |
22 | Documentation | Test teardown keywords.
23
24 *** Keywords ***
25 | Tear down test
26 | | [Documentation]
27 | | ... | Common test teardown for VPP tests.
28 | |
29 | | ... | *Arguments:*
30 | | ... | - ${actions} - Additional teardown action. Type: list
31 | |
32 | | [Arguments] | @{actions}
33 | |
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}
46 | | END
47 | | Clean Sockets On All Nodes | ${nodes}
48
49 | Tear down test raw
50 | | [Documentation]
51 | | ... | Common test teardown for raw tests.
52 | |
53 | | ... | *Arguments:*
54 | | ... | - ${actions} - Additional teardown action. Type: list
55 | |
56 | | [Arguments] | @{actions}
57 | |
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}
61 | | END
62 | | Clean Sockets On All Nodes | ${nodes}
63
64 | Additional Test Tear Down Action For performance
65 | | [Documentation]
66 | | ... | Additional teardown for tests which uses performance measurement.
67 | |
68 | | Run Keyword If Test Failed
69 | | ... | Send traffic at specified rate | ${1.0} | 10000
70 | | ... | ${frame_size} | ${traffic_profile} | trial_multiplicity=${1}
71 | | ... | extended_debug=${True}
72
73 | Additional Test Tear Down Action For packet_trace
74 | | [Documentation]
75 | | ... | Additional teardown for tests which uses packet trace.
76 | |
77 | | Show Packet Trace on All DUTs | ${nodes}
78
79 | Additional Test Tear Down Action For container
80 | | [Documentation]
81 | | ... | Additional teardown for tests which uses containers.
82 | |
83 | | FOR | ${container_group} | IN | @{container_groups}
84 | | | Destroy all '${container_group}' containers
85 | | END
86
87 | Additional Test Tear Down Action For vhost
88 | | [Documentation]
89 | | ... | Additional teardown for tests which uses vhost(s) and VM(s).
90 | |
91 | | Show VPP vhost on all DUTs | ${nodes}
92 | | ${vnf_status} | ${value}= | Run Keyword And Ignore Error
93 | | ... | Keyword Should Exist | vnf_manager.Kill All VMs
94 | | Run Keyword If | '${vnf_status}' == 'PASS' | vnf_manager.Kill All VMs
95
96 | Additional Test Tear Down Action For vhost-pt
97 | | [Documentation]
98 | | ... | Additional teardown for tests which uses pci-passtrough and VM(s).
99 | |
100 | | ${vnf_status} | ${value}= | Run Keyword And Ignore Error
101 | | ... | Keyword Should Exist | vnf_manager.Kill All VMs
102 | | Run Keyword If | '${vnf_status}' == 'PASS' | vnf_manager.Kill All VMs
103
104 | Additional Test Tear Down Action For det44
105 | | [Documentation]
106 | | ... | Additional teardown for tests which uses DET44 feature.
107 | |
108 | | FOR | ${dut} | IN | @{duts}
109 #| | | Run Keyword If Test Failed
110 #| | | ... | Show DET44 verbose | ${nodes['${dut}']}
111 | | | Show DET44 verbose | ${nodes['${dut}']}
112 | | END
113
114 | Additional Test Tear Down Action For nat-ed
115 | | [Documentation]
116 | | ... | Additional teardown for tests which uses NAT feature.
117 | |
118 | | FOR | ${dut} | IN | @{duts}
119 | | | Show NAT Config | ${nodes['${dut}']}
120 | | | Show NAT44 Summary | ${nodes['${dut}']}
121 | | | Show NAT Base Data | ${nodes['${dut}']}
122 | | | Vpp Get Ip Table Summary | ${nodes['${dut}']}
123 | | END
124
125 | Additional Test Tear Down Action For namespace
126 | | [Documentation]
127 | | ... | Additional teardown for tests which uses namespace.
128 | |
129 | | FOR | ${dut} | IN | @{duts}
130 | | | Clean Up Namespaces | ${nodes['${dut}']}
131 | | END
132
133 | Additional Test Tear Down Action For linux_bridge
134 | | [Documentation]
135 | | ... | Additional teardown for tests which uses linux_bridge.
136 | |
137 | | FOR | ${dut} | IN | @{duts}
138 | | | Linux Del Bridge | ${nodes['${dut}']} | ${bid_TAP}
139 | | END
140
141 | Additional Test Tear Down Action For acl
142 | | [Documentation]
143 | | ... | Additional teardown for tests which uses ACL feature.
144 | |
145 | | Run Keyword If Test Failed
146 | | ... | Vpp Log Plugin Acl Settings | ${dut1}
147 | | Run Keyword If Test Failed
148 | | ... | Vpp Log Plugin Acl Interface Assignment | ${dut1}
149
150 | Additional Test Tear Down Action For macipacl
151 | | [Documentation]
152 | | ... | Additional teardown for tests which uses MACIP ACL feature.
153 | |
154 | | Run Keyword If Test Failed
155 | | ... | Vpp Log Macip Acl Settings | ${dut1}
156 | | Run Keyword If Test Failed
157 | | ... | Vpp Log Macip Acl Interface Assignment | ${dut1}
158
159 | Additional Test Tear Down Action For classify
160 | | [Documentation]
161 | | ... | Additional teardown for tests which uses classify tables.
162 | |
163 | | Run Keyword If Test Failed
164 | | ... | Show Classify Tables Verbose on all DUTs | ${nodes}
165
166 | Additional Test Tear Down Action For srv6
167 | | [Documentation]
168 | | ... | Additional teardown for tests which uses SRv6.
169 | |
170 | | Run Keyword If Test Failed
171 | | ... | Show SR Policies on all DUTs | ${nodes}
172 | | Run Keyword If Test Failed
173 | | ... | Show SR Steering Policies on all DUTs | ${nodes}
174 | | Run Keyword If Test Failed
175 | | ... | Show SR LocalSIDs on all DUTs | ${nodes}