blob: fbdca156f63aba4e87140781377182f92091774b [file] [log] [blame]
Huseyin Ahmet AYDIN7cb5ae62021-10-28 11:07:27 +00001# Copyright 2017 - present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14# FIXME Can we use the same test against BBSim and Hardware?
15
16*** Settings ***
17Documentation Test various functional end-to-end scenarios for TT workflow
18Suite Setup Setup Suite
19Test Setup Setup
20Test Teardown Teardown
21Suite Teardown Teardown Suite
22Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
27Library ../../libraries/DependencyLibrary.py
28Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
30Resource ../../libraries/voltha.robot
31Resource ../../libraries/utils.robot
32Resource ../../libraries/k8s.robot
33Resource ../../variables/variables.robot
34Resource ../../libraries/power_switch.robot
35
36*** Variables ***
37${POD_NAME} flex-ocp-cord
38${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
39${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
40#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
41${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
42${HELM_CHARTS_DIR} ~/helm-charts
43${VOLTHA_POD_NUM} 8
44${NAMESPACE} voltha
45${INFRA_NAMESPACE} default
46# For below variable value, using deployment name as using grep for
47# parsing radius pod name, we can also use full radius pod name
48${RESTART_POD_NAME} radius
49${timeout} 60s
50${of_id} 0
51${logical_id} 0
52${has_dataplane} True
53${teardown_device} True
54${scripts} ../../scripts
55
56# Per-test logging on failure is turned off by default; set this variable to enable
57${container_log_dir} ${None}
58
59# logging flag to enable Collect Logs, can be passed via the command line too
60# example: -v logging:False
61${logging} True
62
63${suppressaddsubscriber} True
64
65*** Test Cases ***
662 RG Same ONU Same Channel Multicast Test
67 [Documentation] Verify that 2 RG which are connected to the same ONU could join the same channel.
68 [Tags] functionalTT 2RGSameOnuSameChannel multicastTT
69 [Setup] Start Logging 2RGSameOnuSameChannel
70 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
71 ... AND Stop Logging 2RGSameOnuSameChannel
72 ${test_onus_pon0}= Set Variable ${multicast_test_onu_pon_locations.pon_0[0]}
73 ${test_onu1_sn}= Set Variable ${test_onus_pon0['onu_1']}
74 ${test_onu1_uni}= Set Variable 1
75 ${test_onu2_sn}= Set Variable ${test_onus_pon0['onu_1']}
76 ${test_onu2_uni}= Set Variable 2
77 ${channel_ip_list}= Set Variable ${multicast_ip_addresses[0]}
78 ${channel_ip_1}= Set Variable ${channel_ip_list['channel_1']}
79 ${channel_ip_2}= Set Variable ${channel_ip_list['channel_2']}
80 ${matched} ${src_onu1} ${dst_onu1}= Get ONU details with Given Sn and Service and UNI ${test_onu1_sn} mcast
81 ... ${test_onu1_uni}
82 ${matched} ${src_onu2} ${dst_onu2}= Get ONU details with Given Sn and Service and UNI ${test_onu2_sn} mcast
83 ... ${test_onu2_uni}
84 Wait Until Keyword Succeeds ${timeout} 15 TT 2 RG MCAST Test ${src_onu1} ${dst_onu1}
85 ... ${channel_ip_1} ${src_onu2} ${dst_onu2} ${channel_ip_1}
86
87*** Keywords ***
88Get ONU details with Given Sn and Service and UNI
89 [Documentation] This keyword finds the ONU details (as required for multicast test)
90 ... with given serial number, service type and UNI
91 [Arguments] ${onu_sn} ${service_type} ${uni}
92 ${matched}= Set Variable False
93 FOR ${I} IN RANGE 0 ${num_all_onus}
94 ${src}= Set Variable ${hosts.src[${I}]}
95 ${dst}= Set Variable ${hosts.dst[${I}]}
96 ${service}= Get Variable Value ${src['service_type']} "null"
97 ${onu}= Get Variable Value ${src['onu']} "null"
98 ${uni_id}= Get Variable Value ${src['uni_id']} "null"
99 Continue For Loop If '${onu}' != '${onu_sn}' or '${service}' != '${service_type}'
100 ${matched}= Set Variable If
101 ... '${onu}' == '${onu_sn}' and '${service}' == '${service_type}' and '${uni}' == '${uni_id}'
102 ... True False
103 Exit For Loop If ${matched}
104 END
105 [Return] ${matched} ${src} ${dst}
106
107
108TT 2 RG MCAST Test
109 [Documentation] This keyword performs MCAST two RG at the Same Time for TT workflow
110 [Arguments] ${src_rg1} ${dst_rg1} ${channel_ip_rg1} ${src_rg2} ${dst_rg2} ${channel_ip_rg2}
111 # Check for iperf and jq tools RG1
112 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf jq
113 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
114 ... ${src_rg1['container_name']}
115 Pass Execution If ${rc} != 0 Skipping test: iperf / jq not found on the RG
116
117 # Check for iperf and jq tools RG2
118 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf jq
119 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
120 ... ${src_rg2['container_name']}
121 Pass Execution If ${rc} != 0 Skipping test: iperf / jq not found on the RG
122
123 #Reset the IP on the interface RG1
124 ${output}= Login And Run Command On Remote System sudo ifconfig ${src_rg1['dp_iface_name']} 0
125 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
126 ... ${src_rg1['container_name']}
127 # Kill iperf on BNG
128 ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
129 ... sudo kill -9 `pidof iperf`
130 ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']}
131 ... ${dst_rg1['container_name']}
132
133 #Reset the IP on the interface RG2
134 ${output}= Login And Run Command On Remote System sudo ifconfig ${src_rg1['dp_iface_name']} 0
135 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
136 ... ${src_rg2['container_name']}
137 # Kill iperf on BNG
138 ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
139 ... sudo kill -9 `pidof iperf`
140 ... ${dst_rg2['bng_ip']} ${dst_rg2['bng_user']} ${dst_rg2['bng_pass']} ${dst_rg2['container_type']}
141 ... ${dst_rg2['container_name']}
142
143 # Setup RG1 for Multi-cast test
144 ${output}= Login And Run Command On Remote System
145 ... sudo ifconfig ${src_rg1['dp_iface_name']} ${src_rg1['mcast_rg']} up ; sudo kill -9 `pidof iperf`
146 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
147 ... ${src_rg1['container_name']}
148 ${output}= Login And Run Command On Remote System
149 ... sudo ip route add ${src_rg1['mcast_grp_subnet_mask']} dev ${src_rg1['dp_iface_name']} scope link
150 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
151 ... ${src_rg1['container_name']}
152
153 # Setup RG2 for Multi-cast test
154 ${output}= Login And Run Command On Remote System
155 ... sudo ifconfig ${src_rg2['dp_iface_name']} ${src_rg2['mcast_rg']} up ; sudo kill -9 `pidof iperf`
156 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
157 ... ${src_rg2['container_name']}
158 ${output}= Login And Run Command On Remote System
159 ... sudo ip route add ${src_rg2['mcast_grp_subnet_mask']} dev ${src_rg2['dp_iface_name']} scope link
160 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
161 ... ${src_rg2['container_name']}
162
163 # Setup iperf on the BNG
164 ${server_output}= Run Keyword If '${channel_ip_rg1}'=='${channel_ip_rg2}'
165 ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg1}' -u -T 32 -t 60 -i 1 &
166 ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']}
167 ... ${dst_rg1['container_name']}
168 ... ELSE Run Keywords Run Keyword And Continue On Failure
169 ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg1}' -u -T 32 -t 60 -i 1 &
170 ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']}
171 ... ${dst_rg1['container_name']} AND Run Keyword And Continue On Failure
172 ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg2}' -u -T 32 -t 60 -i 1 &
173 ... ${dst_rg2['bng_ip']} ${dst_rg2['bng_user']} ${dst_rg2['bng_pass']} ${dst_rg2['container_type']}
174 ... ${dst_rg2['container_name']}
175
176 # Setup iperf on the RG1
177 ${rg_output_rg1}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s
178 ... Login And Run Command On Remote System
179 ... rm -rf /tmp/rg_output ; sudo iperf -s -u -B '${channel_ip_rg1}' -i 1 -D >> /tmp/rg_output
180 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
181 ... ${src_rg1['container_name']}
182
183 # Setup iperf on the RG2
184 ${rg_output_rg2}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s
185 ... Login And Run Command On Remote System
186 ... rm -rf /tmp/rg_output ; sudo iperf -s -u -B '${channel_ip_rg2}' -i 1 -D >> /tmp/rg_output
187 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
188 ... ${src_rg2['container_name']}
189
190 #Logging Outputs and Check iperf UDP Stream Outputs
191 Log ${rg_output_rg1}
192 Log ${rg_output_rg2}
193 Sleep 60s
194 ${output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s
195 ... Login And Run Command On Remote System
196 ... cat /tmp/rg_output | grep KBytes
197 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
198 ... ${src_rg1['container_name']}
199 Log ${output}
200 Should Contain ${output} KBytes
201 ${output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s
202 ... Login And Run Command On Remote System
203 ... cat /tmp/rg_output | grep KBytes
204 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
205 ... ${src_rg2['container_name']}
206 Log ${output}
207 Should Contain ${output} KBytes
208
209 # Kill iperf on BNG
210 ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
211 ... sudo kill -9 `pidof iperf`
212 ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']}
213 ... ${dst_rg1['container_name']}
214
215 # Kill iperf on the RG1
216 ${output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
217 ... sudo kill -9 `pidof iperf`
218 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
219 ... ${src_rg1['container_name']}
220
221 # Kill iperf on the RG2
222 ${output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
223 ... sudo kill -9 `pidof iperf`
224 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
225 ... ${src_rg2['container_name']}
226
227Setup Suite
228 [Documentation] Set up the test suite
229 Common Test Suite Setup
230 ${switch_type}= Get Variable Value ${web_power_switch.type}
231 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
232 Run Keyword If ${has_dataplane} Clean Up Linux
233 Run Keyword Setup
234 Wait Until Keyword Succeeds ${timeout} 2s Provision Subscription TT
235
236
237
238Clear All Devices Then Create New Device
239 [Documentation] Remove any devices from VOLTHA and ONOS
240 # Remove all devices from voltha and nos
241 Delete All Devices and Verify
242 # Execute normal test Setup Keyword
243 Setup
244
245Teardown Suite
246 [Documentation] Tear down steps for the suite
247 Run Keyword If ${has_dataplane} Clean Up Linux
248 Run Keyword If ${teardown_device} Delete All Devices And Verify
249 Close All ONOS SSH Connections