blob: df92503e0a6997ac04051788c004ffa30c804963 [file] [log] [blame]
Gayathri.Selvan283a63c2020-01-23 04:09:18 +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.
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000014
15*** Settings ***
HungWei Chiu87edb1f2020-01-28 00:10:58 +000016Documentation Test various failure scenarios
HungWei Chiu1408fb92020-03-03 19:43:30 -050017Suite Setup Setup Suite
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000018Test Setup Setup
19Test Teardown Teardown
TorstenThieme4e2168e2021-06-22 14:01:47 +000020Suite Teardown Teardown Suite
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000021Library Collections
22Library String
23Library OperatingSystem
24Library XML
25Library RequestsLibrary
26Library ../../libraries/DependencyLibrary.py
27Resource ../../libraries/onos.robot
28Resource ../../libraries/voltctl.robot
29Resource ../../libraries/voltha.robot
30Resource ../../libraries/utils.robot
31Resource ../../libraries/k8s.robot
32Resource ../../variables/variables.robot
HungWei Chiu87edb1f2020-01-28 00:10:58 +000033Resource ../../libraries/power_switch.robot
Hardik Windlassc082c422021-03-16 15:44:10 +000034Resource ../../libraries/bbsim.robot
Gayathri.Selvan283a63c2020-01-23 04:09:18 +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
Matteo Scandoloa4e59522021-08-31 14:56:24 -070045${STACK_NAME} voltha
Hardik Windlass4288c6a2021-09-28 07:22:06 +000046${INFRA_NAMESPACE} default
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000047# For below variable value, using deployment name as using grep for
48# parsing radius pod name, we can also use full radius pod name
49${RESTART_POD_NAME} radius
50${timeout} 60s
51${of_id} 0
52${logical_id} 0
Suchitra Vemuri109feb12020-01-23 16:25:02 -080053${has_dataplane} True
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000054${teardown_device} False
55${scripts} ../../scripts
56
Matteo Scandolo7e519fb2021-08-13 11:35:16 -070057${suppressaddsubscriber} True
58
Andy Bavierabeba262020-02-07 16:22:16 -070059# Per-test logging on failure is turned off by default; set this variable to enable
60${container_log_dir} ${None}
61
Matteo Scandoloda1c64b2021-07-20 10:14:49 -070062# logging flag to enable Collect Logs, can be passed via the command line too
63# example: -v logging:False
64${logging} True
65
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000066*** Test Cases ***
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080067Verify ONU after rebooting physically
68 [Documentation] Test the ONU functionality by physically turning on/off ONU.
69 ... Prerequisite : Subscriber are authenticated/DHCP/pingable state
70 ... Test case runs only on the PODs that are configured with PowerSwitch that
71 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
72 ... VOL-2634
73 [Tags] functional PowerSwitch
Andy Baviere187eda2020-04-20 15:00:02 -070074 [Setup] Start Logging ONUreboot_PowerSwitch
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080075 [Teardown] Run Keywords Collect Logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080076 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -070077 ... AND Run Keyword If ${logging} Collect Logs
78 ... AND Stop Logging ONUreboot_PowerSwitch
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080079 # Add OLT device
80 setup
81 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
82 Run Keyword If ${has_dataplane} Clean Up Linux
83 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
84 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080085 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080086 ${src}= Set Variable ${hosts.src[${I}]}
87 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080088 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass0560f802020-05-06 23:06:53 +053089 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080090 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +000091 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080092 Disable Switch Outlet ${src['power_switch_port']}
93 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
94 ... Wait Until Keyword Succeeds 60s 2s
95 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
96 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +053097 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +000098 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass7c801e62020-05-04 19:33:21 +053099 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800100
101 Enable Switch Outlet ${src['power_switch_port']}
102 # Check ONU port is Enabled in ONOS
103 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000104 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800105 # Verify EAPOL flows are added for the ONU port
106 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700107 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800108 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700109 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800110 ... ENABLED ACTIVE REACHABLE
111 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlass7c801e62020-05-04 19:33:21 +0530112 Run Keyword If ${has_dataplane} Clean Up Linux
113 # Perform Authentication
114 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
115 ... /tmp/wpa ${src['dp_iface_name']} log
116 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
117 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
118 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
119 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
120 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
121 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000122 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530123 ... volt-add-subscriber-access ${of_id} ${onu_port}
124 # Verify that no pending flows exist for the ONU port
125 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
126 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530127 # Verify subscriber access flows are added for the ONU port
128 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
129 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
130 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530131 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
132 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800133 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530134 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
135 ... ${dst['container_name']}
136 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
137 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800138 END
Suchitra Vemurid7096132020-02-21 14:50:47 -0800139 # Deleting OLT after tests completes independently (as this test doesn't not run on each POD)
Suchitra Vemuri0656bc22020-03-21 19:07:49 -0700140 #Run Keyword If ${has_dataplane} Delete Device and Verify
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800141
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700142Verify OLT after rebooting physically
143 [Documentation] Test the physical reboot of the OLT
144 ... Prerequisite : Subscriber are authenticated/DHCP/pingable state
145 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
146 ... VOL-1956
147 [Tags] functional PhysicalOLTReboot
Andy Baviere187eda2020-04-20 15:00:02 -0700148 [Setup] Start Logging PhysicalOLTReboot
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700149 [Teardown] Run Keywords Collect Logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800150 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700151 ... AND Run Keyword If ${logging} Collect Logs
152 ... AND Stop Logging PhysicalOLTReboot
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700153 # Add OLT device
154 setup
155 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
156 Run Keyword If ${has_dataplane} Clean Up Linux
157 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
158 # Reboot the OLT from the OLT CLI
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800159 FOR ${I} IN RANGE 0 ${olt_count}
160 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
161 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
162 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
163 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
164 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
165 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
Andrea Campanella5ef88142021-02-02 14:34:50 +0100166 ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=#
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800167 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800168 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700169 ${src}= Set Variable ${hosts.src[${I}]}
170 ${dst}= Set Variable ${hosts.dst[${I}]}
171 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
172 ... Wait Until Keyword Succeeds 60s 2s
173 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
174 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
175 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800176 # Wait for the OLTs to come back up
177 FOR ${I} IN RANGE 0 ${olt_count}
178 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
179 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
180 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
181 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
182 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
183 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
184 ... Check Remote System Reachability True ${olt_ssh_ip}
185 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
186 ... Validate OLT Device ENABLED ACTIVE
187 ... REACHABLE ${olt_serial_number}
188 END
Suchitra Vemuri64db9652020-03-22 21:11:13 -0700189 # Waiting extra time for the ONUs to come up
190 Sleep 60s
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700191 Run Keyword If ${has_dataplane} Clean Up Linux
192 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
193 # Deleting OLT after test completes
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800194 #Run Keyword If ${has_dataplane} Delete All Devices and Verify
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700195
Suchitra Vemuri05180cb2020-03-26 13:13:27 -0700196Verify restart openolt-adapter container after subscriber provisioning
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800197 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
198 ... Prerequisite : ONUs are authenticated and pingable.
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800199 [Tags] functional VOL-1958 Restart-OpenOlt released
Andy Baviere187eda2020-04-20 15:00:02 -0700200 [Setup] Start Logging Restart-OpenOlt
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800201 [Teardown] Run Keywords Collect Logs
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800202 ... AND Stop Logging Restart-OpenOlt
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800203 # Add OLT device
204 setup
205 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
206 Run Keyword If ${has_dataplane} Clean Up Linux
207 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
208 ${waitforRestart} Set Variable 120s
209 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
210 Log ${podStatusOutput}
211 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Andrea Campanella3dcce272021-01-15 16:04:47 +0100212 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530213 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530214 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
215 ... app ${podName} Running
Suchitra Vemuri312bfe02020-03-16 16:11:34 -0700216 # Wait for 1min after openolt adapter is restarted
Hardik Windlass5e214b22021-02-26 10:37:14 +0000217 # TBD: Need for this Sleep
Suchitra Vemuri312bfe02020-03-16 16:11:34 -0700218 Sleep 60s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800219 Run Keyword If ${has_dataplane} Clean Up Linux
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700220 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test ${suppressaddsubscriber}
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800221 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
222 Log ${podStatusOutput}
223 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
224 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
225 Log to console Pod ${podName} restarted and sanity checks passed successfully
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800226
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800227Check OLT/ONU Authentication After Radius Pod Restart
228 [Documentation] After radius restart, triggers reassociation, checks status and
229 ... authentication, validates dhcp and ping. Note : wpa reassociate works only when
230 ... wpa supplicant is running in background hence it is recommended to remove
231 ... teardown from previous test or uncomment 'Teardown None'.
232 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
233 [Tags] functional RadiusRestart released
Andy Baviere187eda2020-04-20 15:00:02 -0700234 [Setup] Start Logging RadiusRestart
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800235 [Teardown] Run Keywords Collect Logs
236 ... AND Stop Logging RadiusRestart
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800237 ${waitforRestart} Set Variable 120s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530238 ${podName} Set Variable radius
Matteo Scandolo10acf562021-05-03 15:35:16 -0700239 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${INFRA_NAMESPACE} app ${podName}
240 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pods Status By Label ${INFRA_NAMESPACE}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530241 ... app ${podName} Running
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800242 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800243 ${src}= Set Variable ${hosts.src[${I}]}
244 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800245 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800246 ${onu_device_id}= Get Device ID From SN ${src['onu']}
247 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000248 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800249 Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700250 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
251 ... ${src['c_tag']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800252 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
253 ... Validate Authentication After Reassociate True ${src['dp_iface_name']}
254 ... ${src['ip']} ${src['user']} ${src['pass']}
255 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800256 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800257 ... ${ONOS_SSH_PORT} ${onu_port}
258 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
259 ... Validate DHCP and Ping True True ${src['dp_iface_name']}
260 ... ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
261 ... ${src['ip']} ${src['user']} ${src['pass']}
262 ... ${src['container_type']} ${src['container_name']}
263 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']}
264 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
265 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
ubuntu6b6e7d42020-03-02 12:35:42 -0800266 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800267 END
268
Suchitra Vemuri05180cb2020-03-26 13:13:27 -0700269Verify openolt adapter restart before subscriber provisioning
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800270 [Documentation] Deploys an device instance and waits for it to authenticate. After
271 ... authentication is successful the rw-core deployment is scaled to 0 instances to
272 ... simulate a POD crash. The test then scales the rw-core back to a single instance
273 ... and configures ONOS for access. The test succeeds if the device is able to
274 ... complete the DHCP sequence.
Hung-Wei Chiud3576762020-03-25 18:06:26 -0700275 [Tags] functional olt-adapter-restart
Andy Baviere187eda2020-04-20 15:00:02 -0700276 [Setup] Start Logging OltAdapterRestart
Suchitra Vemuria0c086f2020-03-29 19:14:13 -0700277 #... AND Clear All Devices Then Create New Device
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800278 [Teardown] Run Keywords Collect Logs
279 ... AND Stop Logging OltAdapterRestart
Hung-Wei Chiud3576762020-03-25 18:06:26 -0700280 # Add OLT and perform sanity test
Suchitra Vemuri59ad2772020-03-26 22:27:27 -0700281 #setup
Suchitra Vemuri91537c82020-03-29 15:03:26 -0700282 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri59ad2772020-03-26 22:27:27 -0700283 #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800284 #Set Global Variable ${of_id}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800285
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800286 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800287 ${src}= Set Variable ${hosts.src[${I}]}
288 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800289 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800290 ${onu_device_id}= Get Device ID From SN ${src['onu']}
291 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000292 ... ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800293
294 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700295 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000296 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
ubuntu6b6e7d42020-03-02 12:35:42 -0800297 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700298 ... ${ONOS_SSH_PORT} ${of_id} ${onu_port} ${src['c_tag']}
Andy Bavier84834d42020-02-25 13:49:50 -0700299 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
300 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800301 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
302 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700303 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
ubuntu6b6e7d42020-03-02 12:35:42 -0800304 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800305 ... ${ONOS_SSH_PORT} ${onu_port}
306 END
307 # Scale down the open OLT adapter deployment to 0 PODs and once confirmed, scale it back to 1
Andrea Campanella3dcce272021-01-15 16:04:47 +0100308 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 0
309 Wait Until Keyword Succeeds ${timeout} 2s Pods Do Not Exist By Label ${NAMESPACE} app
310 ... ${OLT_ADAPTER_APP_LABEL}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800311 # Scale up the open OLT adapter deployment and make sure both it and the ofagent deployment are back
Andrea Campanella3dcce272021-01-15 16:04:47 +0100312 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800313 Wait Until Keyword Succeeds ${timeout} 2s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100314 ... Check Expected Available Deployment Replicas By Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800315
316 # Ensure the device is available in ONOS, this represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800317 FOR ${I} IN RANGE 0 ${olt_count}
318 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
319 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
320 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
321 ... ${olt_serial_number}
322 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
323 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
324 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800325
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800326 FOR ${I} IN RANGE 0 ${num_all_onus}
327 ${src}= Set Variable ${hosts.src[${I}]}
328 ${dst}= Set Variable ${hosts.dst[${I}]}
329 ${of_id}= Get ofID From OLT List ${src['olt']}
330 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000331 ... ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800332 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000333 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800334 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530335 # Verify subscriber access flows are added for the ONU port
336 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
337 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
338 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800339 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
340 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
341 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
342 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
343 ... ${dst['container_name']}
344 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
ubuntu6b6e7d42020-03-02 12:35:42 -0800345 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800346 END
347
hwchiu14c05102020-03-27 00:44:30 +0000348Verify restart ofagent container after subscriber is provisioned
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000349 [Documentation] Restart ofagent container after VOLTHA is operational.
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000350 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass7a846662020-03-19 20:42:59 +0530351 [Tags] functional VOL-2409 ofagentRestart
Andy Baviere187eda2020-04-20 15:00:02 -0700352 [Setup] Start Logging ofagentRestart
Andy Bavier4a8450e2020-02-04 08:58:37 -0700353 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700354 ... AND Stop Logging ofagentRestart
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700355 ... AND Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1
Suchitra Vemuriceb002a2020-03-25 13:36:21 -0700356 # set timeout value
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000357 ${waitforRestart} Set Variable 120s
Andy Bavier4a8450e2020-02-04 08:58:37 -0700358 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000359 Log ${podStatusOutput}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700360 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530361 ${podName} Set Variable ofagent
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530362 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530363 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
364 ... app ${podName} Running
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530365 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
366 Run Keyword If ${has_dataplane} Clean Up Linux
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700367 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test ${suppressaddsubscriber}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700368 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000369 Log ${podStatusOutput}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700370 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000371 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530372 # Scale Down the Of-Agent Deployment
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700373 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 0
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530374 Sleep 30s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800375 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530376 ${src}= Set Variable ${hosts.src[${I}]}
377 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800378 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530379 ${onu_device_id}= Get Device ID From SN ${src['onu']}
380 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000381 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530382 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700383 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530384 ... ENABLED ACTIVE REACHABLE
385 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
386 # Check ONU port is Disabled in ONOS
387 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000388 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530389 # Verify EAPOL flows are present for the ONU port
390 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700391 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
392 ... ${src['c_tag']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530393 # Verify ONU in AAA-Users
394 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
395 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
396 # Verify DHCP-Allocations
397 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
398 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530399 # Verify subscriber access flows are added for the ONU port
400 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
401 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
402 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530403 # Verify Ping
404 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True
405 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
406 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530407 END
408 # Scale Up the Of-Agent Deployment
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700409 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530410 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
411 ... Running
412 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
413 Run Keyword If ${has_dataplane} Clean Up Linux
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700414 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test ${suppressaddsubscriber}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530415 Log to console Pod ${podName} restarted and sanity checks passed successfully
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000416
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000417Check ONU adapter crash not forcing authentication again
418 [Documentation] After ONU adapter restart, checks wpa log for 'authentication started'
419 ... message count to make sure auth not started again and validates EAP status and ping.
420 ... Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable
hwchiu14c05102020-03-27 00:44:30 +0000421 [Tags] functional ONUAdaptCrash
Andy Baviere187eda2020-04-20 15:00:02 -0700422 [Setup] Start Logging ONUAdaptCrash
Andy Bavierabeba262020-02-07 16:22:16 -0700423 [Teardown] Run Keywords Collect Logs
424 ... AND Stop Logging ONUAdaptCrash
hwchiu14c05102020-03-27 00:44:30 +0000425 # Wait for adapter to resync
Hardik Windlass5e214b22021-02-26 10:37:14 +0000426 # TBD: Need for this Sleep
hwchiu14c05102020-03-27 00:44:30 +0000427 Sleep 60s
428 # Restart the onu
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530429 ${podName} Set Variable adapter-open-onu
Hung-Wei Chiu2bee4d42020-04-24 11:31:50 -0700430 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
hwchiu14c05102020-03-27 00:44:30 +0000431 # Validate ONU Ports
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800432 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000433 ${src}= Set Variable ${hosts.src[${I}]}
434 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800435 ${of_id}= Get ofID From OLT List ${src['olt']}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000436 ${onu_device_id}= Get Device ID From SN ${src['onu']}
437 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000438 ... ${of_id} ${src['uni_id']}
Hardik Windlass39015672021-07-05 05:48:08 +0000439 Run Keyword And Continue On Failure Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000440 ... ${src['onu']} ${src['uni_id']}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000441 ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System
442 ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']}
443 ... ${src['container_type']} ${src['container_name']}
444 Run Keyword If ${has_dataplane} Should Contain ${output} SUCCESS
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000445 END
Hung-Wei Chiu2bee4d42020-04-24 11:31:50 -0700446 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
447 ... app ${podName} Running
hwchiu14c05102020-03-27 00:44:30 +0000448 # Wait for adapter to resync
Hardik Windlass5e214b22021-02-26 10:37:14 +0000449 # TBD: Need for this Sleep
hwchiu14c05102020-03-27 00:44:30 +0000450 Sleep 60s
Andy Bavier8da0e132020-04-13 10:25:16 -0700451 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800452 # Validate OLTs are active in ONOS
453 FOR ${I} IN RANGE 0 ${olt_count}
454 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
455 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
456 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
457 ... ${olt_serial_number}
458 END
hwchiu14c05102020-03-27 00:44:30 +0000459 # Perform all steps in Sanity Test except the subscriber addition
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800460 FOR ${I} IN RANGE 0 ${num_all_onus}
hwchiu14c05102020-03-27 00:44:30 +0000461 ${src}= Set Variable ${hosts.src[${I}]}
462 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800463 ${of_id}= Get ofID From OLT List ${src['olt']}
hwchiu14c05102020-03-27 00:44:30 +0000464 ${onu_device_id}= Get Device ID From SN ${src['onu']}
465 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000466 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
hwchiu14c05102020-03-27 00:44:30 +0000467 # Check ONU port is Enabled in ONOS
468 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000469 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
hwchiu14c05102020-03-27 00:44:30 +0000470 # Verify EAPOL flows are added for the ONU port
471 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700472 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
473 ... ${src['c_tag']}
hwchiu14c05102020-03-27 00:44:30 +0000474 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700475 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
hwchiu14c05102020-03-27 00:44:30 +0000476 ... ENABLED ACTIVE REACHABLE
477 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
478 # Perform Authentication
479 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
480 ... /tmp/wpa ${src['dp_iface_name']} log
481 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
482 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
483 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
484 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
485 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
486 # Verify that no pending flows exist for the ONU port
487 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
488 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530489 # Verify subscriber access flows are added for the ONU port
490 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
491 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
492 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
hwchiu14c05102020-03-27 00:44:30 +0000493 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
494 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
495 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
496 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
497 ... ${dst['container_name']}
498 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
499 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
hwchiu14c05102020-03-27 00:44:30 +0000500 END
501
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700502Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart
503 [Documentation] Deploys an device instance and waits for it to authenticate. After
504 ... authentication is successful the rw-core deployment is scaled to 0 instances to
505 ... simulate a POD crash. The test then scales the rw-core back to a single instance
506 ... and configures ONOS for access. The test succeeds if the device is able to
507 ... complete the DHCP sequence.
508 [Tags] functional rwcore-restart
Andy Baviere187eda2020-04-20 15:00:02 -0700509 [Setup] Run Keywords Start Logging RwCoreFailAndRestart
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700510 ... AND Clear All Devices Then Create New Device
511 [Teardown] Run Keywords Collect Logs
512 ... AND Stop Logging RwCoreFailAndRestart
Suchitra Vemuri5d3383f2020-04-03 11:02:26 -0700513 #... AND Delete Device and Verify
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700514 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800515 FOR ${I} IN RANGE 0 ${olt_count}
516 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
517 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
518 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
519 ... ${olt_serial_number}
520 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
521 ... Get NNI Port in ONOS ${of_id}
522 # Set Global Variable ${nni_port}
523 END
524 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700525 ${src}= Set Variable ${hosts.src[${I}]}
526 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800527 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700528 ${onu_device_id}= Get Device ID From SN ${src['onu']}
529 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000530 ... ${of_id} ${src['uni_id']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700531 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700532 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000533 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700534 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700535 ... ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700536 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
537 ... /tmp/wpa ${src['dp_iface_name']} log
538 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
539 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
540 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
541 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
542 ... ${ONOS_SSH_PORT} ${onu_port}
543 END
544
545 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700546 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-rw-core 0
547 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist ${NAMESPACE} ${STACK_NAME}-voltha-rw-core
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700548 # Ensure the ofagent POD goes "not-ready" as expected
549 Wait Until keyword Succeeds ${timeout} 2s
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700550 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 0
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700551 # Scale up the core deployment and make sure both it and the ofagent deployment are back
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700552 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-rw-core 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700553 Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700554 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${STACK_NAME}-voltha-rw-core 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700555 Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700556 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700557 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
558 # so restart the port forwarding for the API service
David Bainbridge07321ff2020-06-12 13:55:42 -0700559 Restart VOLTHA Port Forward voltha-api
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700560 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
561 # represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800562 FOR ${I} IN RANGE 0 ${olt_count}
563 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
564 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
565 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
566 ... ${olt_serial_number}
Girish Gowdrae4de3b32021-03-23 22:20:00 -0700567 Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800568 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
569 END
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700570
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800571 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier52094622020-05-12 15:54:24 -0700572 ${src}= Set Variable ${hosts.src[${I}]}
573 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800574 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier52094622020-05-12 15:54:24 -0700575 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000576 ... ${of_id} ${src['uni_id']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700577 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000578 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700579 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530580 # Verify subscriber access flows are added for the ONU port
581 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
582 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
583 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700584 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
585 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
586 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
587 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
588 ... ${dst['container_name']}
589 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
590 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
591 END
592
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700593Verify OLT Soft Reboot
594 [Documentation] Test soft reboot of the OLT using voltctl command
595 [Tags] VOL-2745 OLTSoftReboot functional
596 [Setup] Start Logging OLTSoftReboot
597 [Teardown] Run Keywords Collect Logs
598 ... AND Stop Logging OLTSoftReboot
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800599 FOR ${I} IN RANGE 0 ${olt_count}
600 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
601 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
602 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
603 ... Validate OLT Device ENABLED ACTIVE
604 ... REACHABLE ${olt_serial_number}
605 # Reboot the OLT using "voltctl device reboot" command
606 Reboot Device ${olt_device_id}
Andrea Campanella9d8d3a52021-06-17 12:18:23 +0200607 # Wait for the OLT to actually go down
608 Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED UNKNOWN UNREACHABLE
609 ... ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800610 END
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700611 #Verify that ping fails
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800612 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700613 ${src}= Set Variable ${hosts.src[${I}]}
614 ${dst}= Set Variable ${hosts.dst[${I}]}
615 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
616 ... Wait Until Keyword Succeeds 60s 2s
617 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
618 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
619 END
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700620 # Check OLT states
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800621 FOR ${I} IN RANGE 0 ${olt_count}
622 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
623 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
624 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
625 # Wait for the OLT to come back up
626 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
627 ... Check Remote System Reachability True ${olt_ssh_ip}
628 # Check OLT states
629 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
630 ... Validate OLT Device ENABLED ACTIVE
631 ... REACHABLE ${olt_serial_number}
632 END
633 # Waiting extra time for the ONUs to come up
634 Sleep 60s
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700635 #Check after reboot that ONUs are active, authenticated/DHCP/pingable
636 Run Keyword If ${has_dataplane} Clean Up Linux
637 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
638
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700639Verify restart ofagent container before subscriber is provisioned
640 [Documentation] Restart ofagent container before subscriber is provisioned.
641 [Tags] functional VOL-2962 ofagentRestart2
642 [Setup] Start Logging ofagentRestart2
643 [Teardown] Run Keywords Collect Logs
Suchitra Vemuri8130be82020-09-15 16:47:58 -0700644 ... AND Stop Logging ofagentRestart2
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000645 ... AND Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 1
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800646 Delete All Devices And Verify
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700647 setup
648 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800649 FOR ${I} IN RANGE 0 ${olt_count}
650 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
651 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
652 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
653 ... ${olt_serial_number}
654 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
655 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
656 END
657 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700658 ${src}= Set Variable ${hosts.src[${I}]}
659 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800660 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700661 ${onu_device_id}= Get Device ID From SN ${src['onu']}
662 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000663 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700664 # Bring up the device and verify it authenticates
665 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000666 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700667 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700668 ... ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700669 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
670 ... /tmp/wpa ${src['dp_iface_name']} log
671 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
672 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
673 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
674 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
675 ... ${ONOS_SSH_PORT} ${onu_port}
676 END
677 # Restart POD ofagent
678 ${waitforRestart} Set Variable 120s
679 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
680 Log ${podStatusOutput}
681 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
682 ${podName} Set Variable ofagent
TorstenThieme37165402021-09-03 11:39:40 +0000683 Restart Pod By Label ${NAMESPACE} app ${podName}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700684 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
685 ... Running
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800686 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700687 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000688 #Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700689 #... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
690 ${src}= Set Variable ${hosts.src[${I}]}
691 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800692 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700693 ${onu_device_id}= Get Device ID From SN ${src['onu']}
694 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000695 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700696 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000697 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700698 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
699 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
700 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
701 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
702 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
703 ... ${dst['container_name']}
704 # Verify DHCP-Allocations
705 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
706 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700707 END
708
Hardik Windlassc082c422021-03-16 15:44:10 +0000709Verify OLT Grpc Disconnection
710 [Documentation] Restarts OLT Grpc Server and verifies everything works as before without any system disruption.
711 [Tags] functional VOL-3904 restartGrpcServer bbsim
712 [Setup] Start Logging restartGrpcServer
713 [Teardown] Run Keywords Collect Logs
714 ... AND Stop Logging restartGrpcServer
715 Delete All Devices And Verify
716 Setup
717 Run Keyword If ${has_dataplane} Clean Up Linux
718 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
719 FOR ${J} IN RANGE 0 ${num_olts}
720 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
721 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
722 Restart Grpc Server ${NAMESPACE} ${bbsim_pod} 5
723 END
724 # Repeat sanity test without subscriber changes
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700725 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test ${suppressaddsubscriber}
Hardik Windlassc082c422021-03-16 15:44:10 +0000726 # Additional Verification
727 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
728 Setup
729 Run Keyword If ${has_dataplane} Clean Up Linux
730 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
731
Hema123aff52020-05-26 15:41:47 +0530732Verify ONU Soft Reboot
733 [Documentation] Test soft reboot of the ONU using voltctl command
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800734 [Tags] VOL-1957 ONUSoftReboot functional notready
Hema123aff52020-05-26 15:41:47 +0530735 [Setup] Start Logging ONUSoftReboot
736 #... AND Setup
Andy Bavier4a8450e2020-02-04 08:58:37 -0700737 [Teardown] Run Keywords Collect Logs
Hema123aff52020-05-26 15:41:47 +0530738 ... AND Stop Logging ONUSoftReboot
739 #... AND Delete Device and Verify
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800740 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000741 ${src}= Set Variable ${hosts.src[${I}]}
742 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800743 ${of_id}= Get ofID From OLT List ${src['olt']}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000744 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800745 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
746 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hema123aff52020-05-26 15:41:47 +0530747 Reboot Device ${onu_device_id}
748 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
749 ... Wait Until Keyword Succeeds 60s 2s
750 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
751 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
752 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000753 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hema123aff52020-05-26 15:41:47 +0530754 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800755 Verify ping is succesful except for given device ${num_all_onus} ${onu_device_id}
Hema123aff52020-05-26 15:41:47 +0530756 Sleep 40s
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800757 # Check ONU port is Enabled in ONOS
758 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000759 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800760 # Verify EAPOL flows are added for the ONU port
761 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700762 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800763 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700764 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800765 ... ENABLED ACTIVE REACHABLE
766 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hema123aff52020-05-26 15:41:47 +0530767 Run Keyword If ${has_dataplane} Clean Up Linux
768 # Perform Authentication
769 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
770 ... /tmp/wpa ${src['dp_iface_name']} log
771 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
772 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
773 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
774 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
775 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
776 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000777 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hema123aff52020-05-26 15:41:47 +0530778 ... volt-add-subscriber-access ${of_id} ${onu_port}
779 # Verify that no pending flows exist for the ONU port
780 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
781 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530782 # Verify subscriber access flows are added for the ONU port
783 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
784 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
785 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hema123aff52020-05-26 15:41:47 +0530786 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
787 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800788 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hema123aff52020-05-26 15:41:47 +0530789 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
790 ... ${dst['container_name']}
791 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
792 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000793 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800794
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800795
796*** Keywords ***
797Setup Suite
798 [Documentation] Set up the test suite
799 Common Test Suite Setup
HungWei Chiu1408fb92020-03-03 19:43:30 -0500800 #power_switch.robot needs it to support different vendor's power switch
Hung-Wei Chiufcc6d8e2020-03-10 12:05:11 -0700801 ${switch_type}= Get Variable Value ${web_power_switch.type}
802 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800803
804Clear All Devices Then Create New Device
805 [Documentation] Remove any devices from VOLTHA and ONOS
806 # Remove all devices from voltha and nos
807 Delete All Devices and Verify
808 # Execute normal test Setup Keyword
809 Setup
TorstenThieme4e2168e2021-06-22 14:01:47 +0000810
811Teardown Suite
812 [Documentation] Clean up ONOS SSH connections
813 Close All ONOS SSH Connections