FIX: Vhost teardown
[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 | ...
21 | Documentation | Test teardown keywords.
22
23 *** Keywords ***
24 | Tear down test
25 | | [Documentation]
26 | | ... | Common test teardown for tests.
27 | | ...
28 | | ... | *Arguments:*
29 | | ... | - ${actions} - Additional teardown action. Type: list
30 | | ...
31 | | [Arguments] | @{actions}
32 | | ...
33 | | Remove All Added Ports On All DUTs From Topology | ${nodes}
34 | | Show PAPI History On All DUTs | ${nodes}
35 | | Run Keyword If Test Failed
36 | | ... | Get Core Files on All Nodes | ${nodes}
37 | | Run Keyword If Test Failed
38 | | ... | Verify VPP PID in Teardown
39 | | :FOR | ${action} | IN | @{actions}
40 | | | Run Keyword | Additional Test Tear Down Action For ${action}
41
42 | Additional Test Tear Down Action For performance
43 | | [Documentation]
44 | | ... | Additional teardown for tests which uses performance measurement.
45 | | ...
46 | | Run Keyword If Test Failed
47 | | ... | Send traffic at specified rate | ${perf_trial_duration} | 10000pps
48 | | ... | ${frame_size} | ${traffic_profile} | pkt_trace=${True}
49
50 | Additional Test Tear Down Action For packet_trace
51 | | [Documentation]
52 | | ... | Additional teardown for tests which uses packet trace.
53 | | ...
54 | | Show Packet Trace on All DUTs | ${nodes}
55
56 | Additional Test Tear Down Action For container
57 | | [Documentation]
58 | | ... | Additional teardown for tests which uses containers.
59 | | ...
60 | | :FOR | ${container_group} | IN | @{container_groups}
61 | | | Destroy all '${container_group}' containers
62
63 | Additional Test Tear Down Action For vhost
64 | | [Documentation]
65 | | ... | Additional teardown for tests which uses vhost(s) and VM(s).
66 | | ...
67 | | Show VPP vhost on all DUTs | ${nodes}
68 | | ${vnf_status} | ${value}= | Run Keyword And Ignore Error
69 | | ... | Keyword Should Exist | vnf_manager.Kill All VMs
70 | | Run Keyword If | '${vnf_status}' == 'PASS' | vnf_manager.Kill All VMs
71
72 | Additional Test Tear Down Action For nat
73 | | [Documentation]
74 | | ... | Additional teardown for tests which uses NAT feature.
75 | | ...
76 | | :FOR | ${dut} | IN | @{duts}
77 | | | Run Keyword If Test Failed
78 | | | ... | Show NAT verbose | ${nodes['${dut}']}
79
80 | Additional Test Tear Down Action For namespace
81 | | [Documentation]
82 | | ... | Additional teardown for tests which uses namespace.
83 | | ...
84 | | :FOR | ${dut} | IN | @{duts}
85 | | | Clean Up Namespaces | ${nodes['${dut}']}
86
87 | Additional Test Tear Down Action For linux_bridge
88 | | [Documentation]
89 | | ... | Additional teardown for tests which uses linux_bridge.
90 | | ...
91 | | :FOR | ${dut} | IN | @{duts}
92 | | | Linux Del Bridge | ${nodes['${dut}']} | ${bid_TAP}
93
94 | Additional Test Tear Down Action For acl
95 | | [Documentation]
96 | | ... | Additional teardown for tests which uses ACL feature.
97 | | ...
98 | | Run Keyword If Test Failed
99 | | ... | Vpp Log Plugin Acl Settings | ${dut1}
100 | | Run Keyword If Test Failed
101 | | ... | Vpp Log Plugin Acl Interface Assignment | ${dut1}
102
103 | Additional Test Tear Down Action For macipacl
104 | | [Documentation]
105 | | ... | Additional teardown for tests which uses MACIP ACL feature.
106 | | ...
107 | | Run Keyword If Test Failed
108 | | ... | Vpp Log Macip Acl Settings | ${dut1}
109 | | Run Keyword If Test Failed
110 | | ... | Vpp Log Macip Acl Interface Assignment | ${dut1}
111
112 | Additional Test Tear Down Action For srv6
113 | | [Documentation]
114 | | ... | Additional teardown for tests which uses SRv6.
115 | | ...
116 | | Run Keyword If Test Failed
117 | | ... | Show SR Policies on all DUTs | ${nodes}
118 | | Run Keyword If Test Failed
119 | | ... | Show SR Steering Policies on all DUTs | ${nodes}
120 | | Run Keyword If Test Failed
121 | | ... | Show SR LocalSIDs on all DUTs | ${nodes}
122
123 | Additional Test Tear Down Action For ligato
124 | | [Documentation]
125 | | ... | Additional teardown for performance tests with Ligato.
126 | | ...
127 | | Run Keyword If Test Failed
128 | | ... | Get Kubernetes logs on all DUTs | ${nodes} | csit
129 | | Run Keyword If Test Failed
130 | | ... | Describe Kubernetes resource on all DUTs | ${nodes} | csit
131 | | Delete Kubernetes resource on all DUTs | ${nodes} | csit