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