blob: 1d62728dc8071b59dfa1fd377bd684f9f91288ba [file] [log] [blame]
Hardik Windlassa3d04b92020-02-17 15:06:05 +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 end-to-end scenarios
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
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070034Resource ../../libraries/power_switch.robot
Hardik Windlassa3d04b92020-02-17 15:06:05 +000035
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# For below variable value, using deployment name as using grep for
46# parsing radius pod name, we can also use full radius pod name
47${RESTART_POD_NAME} radius
48${timeout} 60s
49${of_id} 0
50${logical_id} 0
51${has_dataplane} True
Hardik Windlassffbf0602020-04-24 23:14:45 +053052${teardown_device} True
Hardik Windlassa3d04b92020-02-17 15:06:05 +000053${scripts} ../../scripts
54
Andy Baviere19991a2020-05-08 10:42:40 -070055# For dataplane bandwidth testing
56${upper_margin_pct} 105 # Allow 5% over the limit
Andy Bavierf6ab19c2020-05-14 10:34:47 -070057${lower_margin_pct} 92 # Allow 8% under the limit
Andy Baviere19991a2020-05-08 10:42:40 -070058${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
59${udp_packet_bytes} 1400 # UDP payload in bytes
60
Hardik Windlassa3d04b92020-02-17 15:06:05 +000061# Per-test logging on failure is turned off by default; set this variable to enable
62${container_log_dir} ${None}
63
64*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070065Reboot DT ONUs Physically
66 [Documentation] This test reboots ONUs physically before execution all the tests
67 ... Test case runs only on the PODs that are configured with PowerSwitch that
68 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
Hardik Windlassd6aa0822020-06-29 20:18:12 +053069 [Tags] functionalDt PowerSwitch RebootAllDTONUs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070070 [Setup] Start Logging RebootAllDTONUs
71 [Teardown] Run Keywords Collect Logs
72 ... AND Stop Logging RebootAllDTONUs
73 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
74 FOR ${I} IN RANGE 0 ${num_onus}
75 ${src}= Set Variable ${hosts.src[${I}]}
76 ${dst}= Set Variable ${hosts.dst[${I}]}
77 Disable Switch Outlet ${src['power_switch_port']}
78 Sleep 60s
79 Enable Switch Outlet ${src['power_switch_port']}
80 Sleep 60s
81 END
82
Hardik Windlassa3d04b92020-02-17 15:06:05 +000083Sanity E2E Test for OLT/ONU on POD for DT
84 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
85 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
86 ... Traffic sent with same vlan from different RGs,
87 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
88 ... Inner vlans from the RG should not change
Suchitra Vemurif2388ad2020-03-15 21:44:44 -070089 [Tags] sanityDt
Andy Baviere187eda2020-04-20 15:00:02 -070090 [Setup] Run Keywords Start Logging SanityTestDt
Hardik Windlassa3d04b92020-02-17 15:06:05 +000091 ... AND Setup
92 [Teardown] Run Keywords Collect Logs
93 ... AND Stop Logging SanityTestDt
Hardik Windlassa3d04b92020-02-17 15:06:05 +000094 Run Keyword If ${has_dataplane} Clean Up Linux
95 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
96
Hardik Windlass35706ba2020-02-20 08:16:42 +000097Test Subscriber Delete and Add for DT
98 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
Hardik Windlass63d5e002020-03-06 21:07:09 +053099 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000100 ... Delete a subscriber and validate that the pings do not succeed and state is purged
101 ... Disable and Enable the ONU (This is to replicate the existing DT behaviour)
102 ... Re-add the subscriber, and validate that the flows are present and pings are successful
Suchitra Vemurif2388ad2020-03-15 21:44:44 -0700103 [Tags] functionalDt SubAddDeleteDt
Andy Baviere187eda2020-04-20 15:00:02 -0700104 [Setup] Start Logging SubAddDeleteDt
Hardik Windlass35706ba2020-02-20 08:16:42 +0000105 [Teardown] Run Keywords Collect Logs
106 ... AND Stop Logging SubAddDeleteDt
Hardik Windlass35706ba2020-02-20 08:16:42 +0000107 FOR ${I} IN RANGE 0 ${num_onus}
108 ${src}= Set Variable ${hosts.src[${I}]}
109 ${dst}= Set Variable ${hosts.dst[${I}]}
110 ${onu_device_id}= Get Device ID From SN ${src['onu']}
111 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
112 ... ${of_id}
113 # Remove Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -0800114 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000115 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
116 Sleep 10s
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530117 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000118 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
119 ... Wait Until Keyword Succeeds 60s 2s
120 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
121 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530122 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
123 ${onos_flows_count}= Evaluate 4 * ( ${num_onus} - 1 )
124 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
125 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass25e11702020-03-30 20:05:19 +0530126 ... ${of_id} ${onos_flows_count}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000127 # Verify VOLTHA flows for OLT equals twice the number of ONUS (minus ONU under test) + 1 for LLDP
128 ${olt_flows}= Evaluate 2 * ( ${num_onus} - 1 ) + 1
129 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
130 # Verify VOLTHA flows for ONU under test is Zero
131 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
132 ... ${onu_device_id} 0
133 # Disable and Re-Enable the ONU (To replicate DT current workflow)
134 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
135 Disable Device ${onu_device_id}
136 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
137 ... Validate Device DISABLED UNKNOWN
138 ... REACHABLE ${src['onu']}
139 Enable Device ${onu_device_id}
140 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
141 ... Validate Device ENABLED ACTIVE
142 ... REACHABLE ${src['onu']}
143 # Add Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -0800144 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000145 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
146 Sleep 10s
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530147 # Verify subscriber access flows are added for the ONU port
148 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530149 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
150 ... ${onu_port} ${nni_port} ${src['s_tag']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000151 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
152 ... Validate Device ENABLED ACTIVE
153 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530154 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000155 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
156 ... Wait Until Keyword Succeeds 60s 2s
157 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
158 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
159 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
160 Run Keyword and Ignore Error Collect Logs
161 END
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530162 # Verify ONOS Flows
163 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
164 ${onos_flows_count}= Evaluate 4 * ${num_onus}
165 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530166 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
167 ... ${of_id} ${onos_flows_count}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530168 # Verify VOLTHA Flows
Hardik Windlass35706ba2020-02-20 08:16:42 +0000169 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
170 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
171 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
172 ${onu_flows}= Set Variable 2
173 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
174 ${List_ONU_Serial} Create List
175 Set Suite Variable ${List_ONU_Serial}
176 Build ONU SN List ${List_ONU_Serial}
177 Log ${List_ONU_Serial}
178 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
179 ... ${List_ONU_Serial} ${onu_flows}
180
Hardik Windlass63d5e002020-03-06 21:07:09 +0530181Test Disable and Enable ONU for DT
182 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
183 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
184 ... Perform disable on the ONUs and validate that the pings do not succeed
185 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemurif2388ad2020-03-15 21:44:44 -0700186 [Tags] functionalDt DisableEnableONUDt
Andy Baviere187eda2020-04-20 15:00:02 -0700187 [Setup] Start Logging DisableEnableONUDt
Hardik Windlass63d5e002020-03-06 21:07:09 +0530188 [Teardown] Run Keywords Collect Logs
189 ... AND Stop Logging DisableEnableONUDt
Hardik Windlass63d5e002020-03-06 21:07:09 +0530190 FOR ${I} IN RANGE 0 ${num_onus}
191 ${src}= Set Variable ${hosts.src[${I}]}
192 ${dst}= Set Variable ${hosts.dst[${I}]}
193 ${onu_device_id}= Get Device ID From SN ${src['onu']}
194 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
195 ... ${of_id}
196 Disable Device ${onu_device_id}
197 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
198 ... Validate Device DISABLED UNKNOWN
199 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock
200 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700201 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530202 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530203 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
204 ... Wait Until Keyword Succeeds 60s 2s
205 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
206 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
207 Sleep 5s
208 Enable Device ${onu_device_id}
209 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
210 ... Validate Device ENABLED ACTIVE
211 ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled
212 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700213 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530214 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530215 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
216 ... Wait Until Keyword Succeeds 60s 2s
217 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
218 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
219 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
220 Run Keyword and Ignore Error Collect Logs
221 END
222
Hardik Windlassaaea3402020-03-10 19:45:45 +0530223Test Disable and Delete OLT for DT
224 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
225 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
226 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
227 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Suchitra Vemurif2388ad2020-03-15 21:44:44 -0700228 [Tags] functionalDt DisableDeleteOLTDt
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700229 [Setup] Start Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530230 [Teardown] Run Keywords Collect Logs
231 ... AND Stop Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530232 # Disable and Validate OLT Device
233 Disable Device ${olt_device_id}
234 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
235 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
236 ... ${olt_serial_number}
237 # Validate ONUs
238 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530239 # Verify ONOS Flows
240 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
241 ${onos_flows_count}= Evaluate 4 * ${num_onus}
242 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530243 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
244 ... ${of_id} ${onos_flows_count}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530245 # Verify VOLTHA Flows
Hardik Windlassaaea3402020-03-10 19:45:45 +0530246 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
247 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
248 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
249 ${onu_flows}= Set Variable 2
250 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
251 ${List_ONU_Serial} Create List
252 Set Suite Variable ${List_ONU_Serial}
253 Build ONU SN List ${List_ONU_Serial}
254 Log ${List_ONU_Serial}
255 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
256 ... ${List_ONU_Serial} ${onu_flows}
257 # Delete OLT and Validate Empty Device List
258 Delete Device ${olt_device_id}
259 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
Hardik Windlass480f3e22020-04-02 20:14:14 +0530260 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
261 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Hardik Windlassaaea3402020-03-10 19:45:45 +0530262 Run Keyword and Ignore Error Collect Logs
263 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
264 Run Keyword Setup
265 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Suchitra Vemuriae9cecb2020-03-12 12:59:14 -0700266 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlassaaea3402020-03-10 19:45:45 +0530267
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530268Test Disable and Enable OLT for DT
269 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
270 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
271 ... Perform disable on the OLT and validate that the pings do not succeed
272 ... Perform enable on the OLT and validate that the pings are successful
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700273 [Tags] functionalDt DisableEnableOLTDt notready
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530274 [Setup] Start Logging DisableEnableOLTDt
275 [Teardown] Run Keywords Collect Logs
276 ... AND Stop Logging DisableEnableOLTDt
277 # Disable and Validate OLT Device
278 Disable Device ${olt_device_id}
279 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
280 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
281 ... ${olt_serial_number}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530282 FOR ${I} IN RANGE 0 ${num_onus}
283 ${src}= Set Variable ${hosts.src[${I}]}
284 ${dst}= Set Variable ${hosts.dst[${I}]}
285 ${onu_device_id}= Get Device ID From SN ${src['onu']}
286 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
287 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
288 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700289 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530290 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
291 ... Wait Until Keyword Succeeds 60s 2s
292 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
293 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
294 # Remove Subscriber Access (To replicate DT workflow)
295 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
296 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
297 # Delete ONU Device (To replicate DT workflow)
298 Delete Device ${onu_device_id}
299 END
300 Sleep 15s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530301 # Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
302 Enable Device ${olt_device_id}
303 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
304 ... ${olt_serial_number}
305 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
306 ... PON_OLT ETHERNET_NNI
Hardik Windlass7c801e62020-05-04 19:33:21 +0530307 # Waiting extra time for the ONUs to come up
308 Sleep 60s
309 Run Keyword If ${has_dataplane} Clean Up Linux
310 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530311
312Test Delete and ReAdd OLT for DT
313 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
314 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
315 ... Disable and Delete the OLT
316 ... Create/Enable the same OLT again
317 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
318 [Tags] functionalDt DeleteReAddOLTDt
319 [Setup] Start Logging DeleteReAddOLTDt
320 [Teardown] Run Keywords Collect Logs
321 ... AND Stop Logging DeleteReAddOLTDt
322 Run Keyword If ${has_dataplane} Clean Up Linux
323 Delete Device and Verify
324 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
325 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
326 Run Keyword and Ignore Error Collect Logs
Andrea Campanella5a4c4b12020-07-24 23:25:10 +0200327 Sleep 180s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530328 # Recreate the OLT
329 Setup
330 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
331
332Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
333 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
334 ... This TC is to confirm that ONU removal is not impacting OLT
335 ... Devices will be removed during the execution of this TC
336 ... so calling setup at the end to add the devices back to avoid the confusion.
337 [Tags] functionalDt DisableDeleteONUOLTDt
338 [Setup] Start Logging DisableDeleteONUOLTDt
339 [Teardown] Run Keywords Collect Logs
340 ... AND Stop Logging DisableDeleteONUOLTDt
341 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
342 FOR ${I} IN RANGE 0 ${num_onus}
343 ${src}= Set Variable ${hosts.src[${I}]}
344 ${dst}= Set Variable ${hosts.dst[${I}]}
345 ${onu_device_id}= Get Device ID From SN ${src['onu']}
346 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
347 ... Validate Device ENABLED ACTIVE
348 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
349 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
350 ... Validate OLT Device ENABLED ACTIVE
351 ... REACHABLE ${olt_serial_number}
352 Disable Device ${onu_device_id}
353 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
354 ... Validate Device DISABLED UNKNOWN
355 ... REACHABLE ${src['onu']} onu=false
356 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
357 ... Validate OLT Device ENABLED ACTIVE
358 ... REACHABLE ${olt_serial_number}
359 END
360 Disable Device ${olt_device_id}
361 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
362 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
363 ... ${olt_serial_number}
364 FOR ${I} IN RANGE 0 ${num_onus}
365 ${src}= Set Variable ${hosts.src[${I}]}
366 ${dst}= Set Variable ${hosts.dst[${I}]}
367 ${onu_device_id}= Get Device ID From SN ${src['onu']}
368 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
369 ... Validate Device DISABLED DISCOVERED
370 ... UNREACHABLE ${src['onu']} onu=false
371 Delete Device ${onu_device_id}
372 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
373 ... Validate OLT Device DISABLED UNKNOWN
374 ... REACHABLE ${olt_serial_number}
375 END
376 Delete Device ${olt_device_id}
377 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
378 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
379 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
380 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Andrea Campanella5a4c4b12020-07-24 23:25:10 +0200381 Sleep 180s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530382 Run Keyword Setup
383 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
384 Run Keyword If ${has_dataplane} Clean Up Linux
385
Andy Baviere19991a2020-05-08 10:42:40 -0700386Data plane verification using TCP for DT
387 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
388 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavier1b144eb2020-05-28 11:22:11 -0700389 [Tags] dataplaneDt BandwidthProfileTCPDt VOL-3061 notready
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700390 [Setup] Start Logging BandwidthProfileTCPDt
391 [Teardown] Run Keywords Collect Logs
392 ... AND Stop Logging BandwidthProfileTCPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700393 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
394 ... physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700395 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Andy Baviere19991a2020-05-08 10:42:40 -0700396 FOR ${I} IN RANGE 0 ${num_onus}
397 ${src}= Set Variable ${hosts.src[${I}]}
398 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700399
400 # Check for iperf3 and jq tools
401 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
402 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
403 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
404
Andy Baviere19991a2020-05-08 10:42:40 -0700405 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
406 ... ${of_id}
407 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
408 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
409 ... upstreamBandwidthProfile
410 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
411 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
412 ... downstreamBandwidthProfile
413 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
414
415 # Stream TCP packets from RG to server
416 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
417 ... args=-t 30
418 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
419
420 # Stream TCP packets from server to RG
421 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
422 ... args=-R -t 30
423 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
424
425 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
426 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
427 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
428 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
429
430 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
431 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
432 Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
433 ... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
434 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
435 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
436 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
437 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
438 END
439
440Data plane verification using UDP for DT
441 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
442 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700443 [Tags] dataplaneDt BandwidthProfileUDPDt VOL-3061 notready
444 [Setup] Start Logging BandwidthProfileUDPDt
445 [Teardown] Run Keywords Collect Logs
446 ... AND Stop Logging BandwidthProfileUDPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700447 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
448 ... physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700449 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Andy Baviere19991a2020-05-08 10:42:40 -0700450 FOR ${I} IN RANGE 0 ${num_onus}
451 ${src}= Set Variable ${hosts.src[${I}]}
452 ${dst}= Set Variable ${hosts.dst[${I}]}
453 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
454 ... ${of_id}
455 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
456 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
457 ... upstreamBandwidthProfile
458 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
459 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
460 ... downstreamBandwidthProfile
461 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
462
463 # Stream UDP packets from RG to server
464 ${uprate}= Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
465 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700466 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700467 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
468 ${actual_upstream_bw_used}= Evaluate
469 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
470
471 # Stream UDP packets from server to RG
472 ${dnrate}= Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
473 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700474 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700475 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
476 ${actual_dnstream_bw_used}= Evaluate
477 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
478
479 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
480 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
481 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
482 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
483
484 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
485 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
486 Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
487 ... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
488 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
489 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
490 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
491 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
492 END
493
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000494*** Keywords ***
495Setup Suite
496 [Documentation] Set up the test suite
497 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700498 #Restore all ONUs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700499 #Run Keyword If ${has_dataplane} RestoreONUs ${num_onus}
500 #power_switch.robot needs it to support different vendor's power switch
501 ${switch_type}= Get Variable Value ${web_power_switch.type}
502 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000503
504Clear All Devices Then Create New Device
505 [Documentation] Remove any devices from VOLTHA and ONOS
506 # Remove all devices from voltha and nos
507 Delete All Devices and Verify
508 # Execute normal test Setup Keyword
509 Setup
510