blob: 81b5eee66ff1506a52faadd470cd7f4dec26d902 [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
Huseyin Ahmet AYDIN208723d2021-11-16 07:15:53 +0000872 RG Same ONU Different Channel Multicast Test
88 [Documentation] Verify that 2 RG which are connected to the same ONU could join the different channel.
89 [Tags] functionalTT 2RGSameOnuDifferentChannel multicastTT
90 [Setup] Start Logging 2RGSameOnuDifferentChannel
91 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
92 ... AND Stop Logging 2RGSameOnuDifferentChannel
93 ${test_onus_pon0}= Set Variable ${multicast_test_onu_pon_locations.pon_0[0]}
94 ${test_onu1_sn}= Set Variable ${test_onus_pon0['onu_1']}
95 ${test_onu1_uni}= Set Variable 1
96 ${test_onu2_sn}= Set Variable ${test_onus_pon0['onu_1']}
97 ${test_onu2_uni}= Set Variable 2
98 ${channel_ip_list}= Set Variable ${multicast_ip_addresses[0]}
99 ${channel_ip_1}= Set Variable ${channel_ip_list['channel_1']}
100 ${channel_ip_2}= Set Variable ${channel_ip_list['channel_2']}
101 ${matched} ${src_onu1} ${dst_onu1}= Get ONU details with Given Sn and Service and UNI ${test_onu1_sn} mcast
102 ... ${test_onu1_uni}
103 ${matched} ${src_onu2} ${dst_onu2}= Get ONU details with Given Sn and Service and UNI ${test_onu2_sn} mcast
104 ... ${test_onu2_uni}
105 Wait Until Keyword Succeeds ${timeout} 15 TT 2 RG MCAST Test ${src_onu1} ${dst_onu1}
106 ... ${channel_ip_1} ${src_onu2} ${dst_onu2} ${channel_ip_2}
107
Huseyin Ahmet AYDIN7cb5ae62021-10-28 11:07:27 +0000108*** Keywords ***
109Get ONU details with Given Sn and Service and UNI
110 [Documentation] This keyword finds the ONU details (as required for multicast test)
111 ... with given serial number, service type and UNI
112 [Arguments] ${onu_sn} ${service_type} ${uni}
113 ${matched}= Set Variable False
114 FOR ${I} IN RANGE 0 ${num_all_onus}
115 ${src}= Set Variable ${hosts.src[${I}]}
116 ${dst}= Set Variable ${hosts.dst[${I}]}
117 ${service}= Get Variable Value ${src['service_type']} "null"
118 ${onu}= Get Variable Value ${src['onu']} "null"
119 ${uni_id}= Get Variable Value ${src['uni_id']} "null"
120 Continue For Loop If '${onu}' != '${onu_sn}' or '${service}' != '${service_type}'
121 ${matched}= Set Variable If
122 ... '${onu}' == '${onu_sn}' and '${service}' == '${service_type}' and '${uni}' == '${uni_id}'
123 ... True False
124 Exit For Loop If ${matched}
125 END
126 [Return] ${matched} ${src} ${dst}
127
128
129TT 2 RG MCAST Test
130 [Documentation] This keyword performs MCAST two RG at the Same Time for TT workflow
131 [Arguments] ${src_rg1} ${dst_rg1} ${channel_ip_rg1} ${src_rg2} ${dst_rg2} ${channel_ip_rg2}
132 # Check for iperf and jq tools RG1
133 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf jq
134 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
135 ... ${src_rg1['container_name']}
136 Pass Execution If ${rc} != 0 Skipping test: iperf / jq not found on the RG
137
138 # Check for iperf and jq tools RG2
139 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf jq
140 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
141 ... ${src_rg2['container_name']}
142 Pass Execution If ${rc} != 0 Skipping test: iperf / jq not found on the RG
143
144 #Reset the IP on the interface RG1
145 ${output}= Login And Run Command On Remote System sudo ifconfig ${src_rg1['dp_iface_name']} 0
146 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
147 ... ${src_rg1['container_name']}
148 # Kill iperf on BNG
149 ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
150 ... sudo kill -9 `pidof iperf`
151 ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']}
152 ... ${dst_rg1['container_name']}
153
154 #Reset the IP on the interface RG2
155 ${output}= Login And Run Command On Remote System sudo ifconfig ${src_rg1['dp_iface_name']} 0
156 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
157 ... ${src_rg2['container_name']}
158 # Kill iperf on BNG
159 ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
160 ... sudo kill -9 `pidof iperf`
161 ... ${dst_rg2['bng_ip']} ${dst_rg2['bng_user']} ${dst_rg2['bng_pass']} ${dst_rg2['container_type']}
162 ... ${dst_rg2['container_name']}
163
164 # Setup RG1 for Multi-cast test
165 ${output}= Login And Run Command On Remote System
166 ... sudo ifconfig ${src_rg1['dp_iface_name']} ${src_rg1['mcast_rg']} up ; sudo kill -9 `pidof iperf`
167 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
168 ... ${src_rg1['container_name']}
169 ${output}= Login And Run Command On Remote System
170 ... sudo ip route add ${src_rg1['mcast_grp_subnet_mask']} dev ${src_rg1['dp_iface_name']} scope link
171 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
172 ... ${src_rg1['container_name']}
173
174 # Setup RG2 for Multi-cast test
175 ${output}= Login And Run Command On Remote System
176 ... sudo ifconfig ${src_rg2['dp_iface_name']} ${src_rg2['mcast_rg']} up ; sudo kill -9 `pidof iperf`
177 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
178 ... ${src_rg2['container_name']}
179 ${output}= Login And Run Command On Remote System
180 ... sudo ip route add ${src_rg2['mcast_grp_subnet_mask']} dev ${src_rg2['dp_iface_name']} scope link
181 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
182 ... ${src_rg2['container_name']}
183
184 # Setup iperf on the BNG
185 ${server_output}= Run Keyword If '${channel_ip_rg1}'=='${channel_ip_rg2}'
186 ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg1}' -u -T 32 -t 60 -i 1 &
187 ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']}
188 ... ${dst_rg1['container_name']}
189 ... ELSE Run Keywords Run Keyword And Continue On Failure
190 ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg1}' -u -T 32 -t 60 -i 1 &
191 ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']}
192 ... ${dst_rg1['container_name']} AND Run Keyword And Continue On Failure
193 ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg2}' -u -T 32 -t 60 -i 1 &
194 ... ${dst_rg2['bng_ip']} ${dst_rg2['bng_user']} ${dst_rg2['bng_pass']} ${dst_rg2['container_type']}
195 ... ${dst_rg2['container_name']}
196
197 # Setup iperf on the RG1
198 ${rg_output_rg1}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s
199 ... Login And Run Command On Remote System
200 ... rm -rf /tmp/rg_output ; sudo iperf -s -u -B '${channel_ip_rg1}' -i 1 -D >> /tmp/rg_output
201 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
202 ... ${src_rg1['container_name']}
203
204 # Setup iperf on the RG2
205 ${rg_output_rg2}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s
206 ... Login And Run Command On Remote System
207 ... rm -rf /tmp/rg_output ; sudo iperf -s -u -B '${channel_ip_rg2}' -i 1 -D >> /tmp/rg_output
208 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
209 ... ${src_rg2['container_name']}
210
211 #Logging Outputs and Check iperf UDP Stream Outputs
212 Log ${rg_output_rg1}
213 Log ${rg_output_rg2}
214 Sleep 60s
215 ${output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s
216 ... Login And Run Command On Remote System
217 ... cat /tmp/rg_output | grep KBytes
218 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
219 ... ${src_rg1['container_name']}
220 Log ${output}
221 Should Contain ${output} KBytes
222 ${output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s
223 ... Login And Run Command On Remote System
224 ... cat /tmp/rg_output | grep KBytes
225 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
226 ... ${src_rg2['container_name']}
227 Log ${output}
228 Should Contain ${output} KBytes
229
230 # Kill iperf on BNG
231 ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
232 ... sudo kill -9 `pidof iperf`
233 ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']}
234 ... ${dst_rg1['container_name']}
235
236 # Kill iperf on the RG1
237 ${output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
238 ... sudo kill -9 `pidof iperf`
239 ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']}
240 ... ${src_rg1['container_name']}
241
242 # Kill iperf on the RG2
243 ${output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
244 ... sudo kill -9 `pidof iperf`
245 ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']}
246 ... ${src_rg2['container_name']}
247
248Setup Suite
249 [Documentation] Set up the test suite
250 Common Test Suite Setup
251 ${switch_type}= Get Variable Value ${web_power_switch.type}
252 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
253 Run Keyword If ${has_dataplane} Clean Up Linux
254 Run Keyword Setup
255 Wait Until Keyword Succeeds ${timeout} 2s Provision Subscription TT
256
257
258
259Clear All Devices Then Create New Device
260 [Documentation] Remove any devices from VOLTHA and ONOS
261 # Remove all devices from voltha and nos
262 Delete All Devices and Verify
263 # Execute normal test Setup Keyword
264 Setup
265
266Teardown Suite
267 [Documentation] Tear down steps for the suite
268 Run Keyword If ${has_dataplane} Clean Up Linux
269 Run Keyword If ${teardown_device} Delete All Devices And Verify
270 Close All ONOS SSH Connections