1174fde9de096a3dde69ba5d6e313f4e42ea63b8
[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 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 | Additional Test Tear Down Action For performance
50 | | [Documentation]
51 | | ... | Additional teardown for tests which uses performance measurement.
52 | |
53 | | Run Keyword If Test Failed
54 | | ... | Send traffic at specified rate | ${PERF_TRIAL_DURATION} | 10000pps
55 | | ... | ${frame_size} | ${traffic_profile} | pkt_trace=${True}
56
57 | Additional Test Tear Down Action For packet_trace
58 | | [Documentation]
59 | | ... | Additional teardown for tests which uses packet trace.
60 | |
61 | | Show Packet Trace on All DUTs | ${nodes}
62
63 | Additional Test Tear Down Action For container
64 | | [Documentation]
65 | | ... | Additional teardown for tests which uses containers.
66 | |
67 | | FOR | ${container_group} | IN | @{container_groups}
68 | | | Destroy all '${container_group}' containers
69 | | END
70
71 | Additional Test Tear Down Action For vhost
72 | | [Documentation]
73 | | ... | Additional teardown for tests which uses vhost(s) and VM(s).
74 | |
75 | | Show VPP vhost on all DUTs | ${nodes}
76 | | ${vnf_status} | ${value}= | Run Keyword And Ignore Error
77 | | ... | Keyword Should Exist | vnf_manager.Kill All VMs
78 | | Run Keyword If | '${vnf_status}' == 'PASS' | vnf_manager.Kill All VMs
79
80 | Additional Test Tear Down Action For nat
81 | | [Documentation]
82 | | ... | Additional teardown for tests which uses NAT feature.
83 | |
84 | | FOR | ${dut} | IN | @{duts}
85 | | | Run Keyword If Test Failed
86 | | | ... | Show NAT verbose | ${nodes['${dut}']}
87 | | END
88
89 | Additional Test Tear Down Action For namespace
90 | | [Documentation]
91 | | ... | Additional teardown for tests which uses namespace.
92 | |
93 | | FOR | ${dut} | IN | @{duts}
94 | | | Clean Up Namespaces | ${nodes['${dut}']}
95 | | END
96
97 | Additional Test Tear Down Action For linux_bridge
98 | | [Documentation]
99 | | ... | Additional teardown for tests which uses linux_bridge.
100 | |
101 | | FOR | ${dut} | IN | @{duts}
102 | | | Linux Del Bridge | ${nodes['${dut}']} | ${bid_TAP}
103 | | END
104
105 | Additional Test Tear Down Action For acl
106 | | [Documentation]
107 | | ... | Additional teardown for tests which uses ACL feature.
108 | |
109 | | Run Keyword If Test Failed
110 | | ... | Vpp Log Plugin Acl Settings | ${dut1}
111 | | Run Keyword If Test Failed
112 | | ... | Vpp Log Plugin Acl Interface Assignment | ${dut1}
113
114 | Additional Test Tear Down Action For macipacl
115 | | [Documentation]
116 | | ... | Additional teardown for tests which uses MACIP ACL feature.
117 | |
118 | | Run Keyword If Test Failed
119 | | ... | Vpp Log Macip Acl Settings | ${dut1}
120 | | Run Keyword If Test Failed
121 | | ... | Vpp Log Macip Acl Interface Assignment | ${dut1}
122
123 | Additional Test Tear Down Action For classify
124 | | [Documentation]
125 | | ... | Additional teardown for tests which uses classify tables.
126 | |
127 | | Run Keyword If Test Failed
128 | | ... | Show Classify Tables Verbose on all DUTs | ${nodes}
129
130 | Additional Test Tear Down Action For srv6
131 | | [Documentation]
132 | | ... | Additional teardown for tests which uses SRv6.
133 | |
134 | | Run Keyword If Test Failed
135 | | ... | Show SR Policies on all DUTs | ${nodes}
136 | | Run Keyword If Test Failed
137 | | ... | Show SR Steering Policies on all DUTs | ${nodes}
138 | | Run Keyword If Test Failed
139 | | ... | Show SR LocalSIDs on all DUTs | ${nodes}