blob: 235a86a4294b0a94b12f929b3f82e93f76d31ec6 [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
Suchitra Vemurie9c6ca62020-07-27 16:44:53 -070048${timeout} 360s
Hardik Windlassa3d04b92020-02-17 15:06:05 +000049${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}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700140 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000141 ... 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']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700151 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000152 ... 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}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700209 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530210 ... 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
327 # Recreate the OLT
328 Setup
329 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
330
331Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
332 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
333 ... This TC is to confirm that ONU removal is not impacting OLT
334 ... Devices will be removed during the execution of this TC
335 ... so calling setup at the end to add the devices back to avoid the confusion.
336 [Tags] functionalDt DisableDeleteONUOLTDt
337 [Setup] Start Logging DisableDeleteONUOLTDt
338 [Teardown] Run Keywords Collect Logs
339 ... AND Stop Logging DisableDeleteONUOLTDt
340 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
341 FOR ${I} IN RANGE 0 ${num_onus}
342 ${src}= Set Variable ${hosts.src[${I}]}
343 ${dst}= Set Variable ${hosts.dst[${I}]}
344 ${onu_device_id}= Get Device ID From SN ${src['onu']}
345 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
346 ... Validate Device ENABLED ACTIVE
347 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
348 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
349 ... Validate OLT Device ENABLED ACTIVE
350 ... REACHABLE ${olt_serial_number}
351 Disable Device ${onu_device_id}
352 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
353 ... Validate Device DISABLED UNKNOWN
354 ... REACHABLE ${src['onu']} onu=false
355 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
356 ... Validate OLT Device ENABLED ACTIVE
357 ... REACHABLE ${olt_serial_number}
358 END
359 Disable Device ${olt_device_id}
360 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
361 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
362 ... ${olt_serial_number}
363 FOR ${I} IN RANGE 0 ${num_onus}
364 ${src}= Set Variable ${hosts.src[${I}]}
365 ${dst}= Set Variable ${hosts.dst[${I}]}
366 ${onu_device_id}= Get Device ID From SN ${src['onu']}
367 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
368 ... Validate Device DISABLED DISCOVERED
369 ... UNREACHABLE ${src['onu']} onu=false
370 Delete Device ${onu_device_id}
371 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
372 ... Validate OLT Device DISABLED UNKNOWN
373 ... REACHABLE ${olt_serial_number}
374 END
375 Delete Device ${olt_device_id}
376 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
377 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
378 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
379 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
380 Run Keyword Setup
381 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
382 Run Keyword If ${has_dataplane} Clean Up Linux
383
Andy Baviere19991a2020-05-08 10:42:40 -0700384Data plane verification using TCP for DT
385 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
386 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavier7613b9a2020-07-08 07:25:47 -0700387 [Tags] dataplaneDt BandwidthProfileTCPDt VOL-3061
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700388 [Setup] Start Logging BandwidthProfileTCPDt
389 [Teardown] Run Keywords Collect Logs
390 ... AND Stop Logging BandwidthProfileTCPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700391 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
392 ... physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700393 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Andy Baviere19991a2020-05-08 10:42:40 -0700394 FOR ${I} IN RANGE 0 ${num_onus}
395 ${src}= Set Variable ${hosts.src[${I}]}
396 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700397
398 # Check for iperf3 and jq tools
399 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
400 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
401 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
402
Andy Baviere19991a2020-05-08 10:42:40 -0700403 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
404 ... ${of_id}
405 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
406 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
407 ... upstreamBandwidthProfile
408 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
409 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
410 ... downstreamBandwidthProfile
411 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
412
413 # Stream TCP packets from RG to server
414 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
415 ... args=-t 30
416 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
417
418 # Stream TCP packets from server to RG
419 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
420 ... args=-R -t 30
421 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
422
423 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
424 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
425 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
426 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
427
428 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
429 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700430 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
431 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
432 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700433 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
434 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
435 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
436 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
437 END
438
439Data plane verification using UDP for DT
440 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
441 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavier7613b9a2020-07-08 07:25:47 -0700442 [Tags] dataplaneDt BandwidthProfileUDPDt VOL-3061
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700443 [Setup] Start Logging BandwidthProfileUDPDt
444 [Teardown] Run Keywords Collect Logs
445 ... AND Stop Logging BandwidthProfileUDPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700446 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
447 ... physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700448 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Andy Baviere19991a2020-05-08 10:42:40 -0700449 FOR ${I} IN RANGE 0 ${num_onus}
450 ${src}= Set Variable ${hosts.src[${I}]}
451 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700452
453 # Check for iperf3 and jq tools
454 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
455 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
456 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
457
Andy Baviere19991a2020-05-08 10:42:40 -0700458 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
459 ... ${of_id}
460 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
461 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
462 ... upstreamBandwidthProfile
463 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
464 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
465 ... downstreamBandwidthProfile
466 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
467
468 # Stream UDP packets from RG to server
469 ${uprate}= Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
470 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700471 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700472 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
473 ${actual_upstream_bw_used}= Evaluate
474 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
475
476 # Stream UDP packets from server to RG
477 ${dnrate}= Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
478 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700479 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700480 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
481 ${actual_dnstream_bw_used}= Evaluate
482 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
483
484 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
485 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
486 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
487 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
488
489 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
490 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700491 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
492 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
493 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700494 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
495 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
496 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
497 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
498 END
499
Andy Bavier7613b9a2020-07-08 07:25:47 -0700500Validate parsing of data traffic through voltha using tech profile
501 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
502 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
503 ... Install jq tool to read json file, where test suite is being running
504 ... Make sure 9999 port is enabled or forwarded for both upsteam and downstream direction
505 ... This test sends UDP packets on port 9999 with pbits between 0 and 7 and validates that
506 ... the pbits are preserved by the PON.
507 [Tags] dataplaneDt TechProfileDt VOL-3291
508 [Setup] Start Logging TechProfileDt
509 [Teardown] Run Keywords Collect Logs
510 ... AND Stop Logging TechProfileDt
511 Pass Execution If '${has_dataplane}'=='False'
512 ... Skipping test: Technology profile validation can be done only in physical pod
513 FOR ${I} IN RANGE 0 ${num_onus}
514 ${src}= Set Variable ${hosts.src[${I}]}
515 ${dst}= Set Variable ${hosts.dst[${I}]}
516
Andy Bavier275414a2020-07-16 13:07:17 -0700517 ${src_iface_name}= Fetch From Left ${src['dp_iface_name']} .
518
Andy Bavier7613b9a2020-07-08 07:25:47 -0700519 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
520 ${bng_user}= Get Variable Value ${dst['noroot_user']}
521 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
522 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
523 ... Skipping test: credentials for BNG login required in deployment config
524
525 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
526 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
527 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
528 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
529 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
530 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
531 Log Upstream test
532 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700533 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src_iface_name}
534 ... 0 udp 9999 ${src['c_tag']} vlan
Andy Bavier7613b9a2020-07-08 07:25:47 -0700535 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
536 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
537 Log Downstream test
538 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
539 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
540 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
541 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
542 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700543 ... ${rg_ip} ${src_iface_name} ${dst['dp_iface_name']}.${src['s_tag']}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700544 ... 0 udp 9999 ${src['c_tag']} udp
545 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
546 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
547 END
548
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000549*** Keywords ***
550Setup Suite
551 [Documentation] Set up the test suite
552 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700553 #Restore all ONUs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700554 #Run Keyword If ${has_dataplane} RestoreONUs ${num_onus}
555 #power_switch.robot needs it to support different vendor's power switch
556 ${switch_type}= Get Variable Value ${web_power_switch.type}
557 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000558
559Clear All Devices Then Create New Device
560 [Documentation] Remove any devices from VOLTHA and ONOS
561 # Remove all devices from voltha and nos
562 Delete All Devices and Verify
563 # Execute normal test Setup Keyword
564 Setup
565