blob: e7a91ad41d8e9219ae3f593336ad1b6497e4d973 [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
Suchitra Vemurica1c5d32020-04-09 18:45:29 -070045${DEFAULTSPACE} default
Matteo Scandolo10acf562021-05-03 15:35:16 -070046${INFRA_NAMESPACE} infra
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
Andy Bavierabeba262020-02-07 16:22:16 -070057# Per-test logging on failure is turned off by default; set this variable to enable
58${container_log_dir} ${None}
59
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000060*** Test Cases ***
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080061Verify ONU after rebooting physically
62 [Documentation] Test the ONU functionality by physically turning on/off ONU.
63 ... Prerequisite : Subscriber are authenticated/DHCP/pingable state
64 ... Test case runs only on the PODs that are configured with PowerSwitch that
65 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
66 ... VOL-2634
67 [Tags] functional PowerSwitch
Andy Baviere187eda2020-04-20 15:00:02 -070068 [Setup] Start Logging ONUreboot_PowerSwitch
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080069 [Teardown] Run Keywords Collect Logs
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -080070 ... AND Stop Logging ONUreboot_PowerSwitch
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080071 ... AND Delete All Devices and Verify
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080072 # Add OLT device
73 setup
74 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
75 Run Keyword If ${has_dataplane} Clean Up Linux
76 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
77 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080078 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080079 ${src}= Set Variable ${hosts.src[${I}]}
80 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080081 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass0560f802020-05-06 23:06:53 +053082 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080083 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +000084 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080085 Disable Switch Outlet ${src['power_switch_port']}
86 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
87 ... Wait Until Keyword Succeeds 60s 2s
88 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
89 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +053090 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +000091 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass7c801e62020-05-04 19:33:21 +053092 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080093
94 Enable Switch Outlet ${src['power_switch_port']}
95 # Check ONU port is Enabled in ONOS
96 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +000097 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080098 # Verify EAPOL flows are added for the ONU port
99 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800100 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800101 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700102 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800103 ... ENABLED ACTIVE REACHABLE
104 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlass7c801e62020-05-04 19:33:21 +0530105 Run Keyword If ${has_dataplane} Clean Up Linux
106 # Perform Authentication
107 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
108 ... /tmp/wpa ${src['dp_iface_name']} log
109 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
110 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
111 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
112 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
113 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
114 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000115 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530116 ... volt-add-subscriber-access ${of_id} ${onu_port}
117 # Verify that no pending flows exist for the ONU port
118 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
119 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530120 # Verify subscriber access flows are added for the ONU port
121 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
122 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
123 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530124 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
125 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800126 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530127 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
128 ... ${dst['container_name']}
129 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
130 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800131 END
Suchitra Vemurid7096132020-02-21 14:50:47 -0800132 # Deleting OLT after tests completes independently (as this test doesn't not run on each POD)
Suchitra Vemuri0656bc22020-03-21 19:07:49 -0700133 #Run Keyword If ${has_dataplane} Delete Device and Verify
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800134
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700135Verify OLT after rebooting physically
136 [Documentation] Test the physical reboot of the OLT
137 ... Prerequisite : Subscriber are authenticated/DHCP/pingable state
138 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
139 ... VOL-1956
140 [Tags] functional PhysicalOLTReboot
Andy Baviere187eda2020-04-20 15:00:02 -0700141 [Setup] Start Logging PhysicalOLTReboot
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700142 [Teardown] Run Keywords Collect Logs
143 ... AND Stop Logging PhysicalOLTReboot
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800144 ... AND Delete All Devices and Verify
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700145 # Add OLT device
146 setup
147 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
148 Run Keyword If ${has_dataplane} Clean Up Linux
149 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
150 # Reboot the OLT from the OLT CLI
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800151 FOR ${I} IN RANGE 0 ${olt_count}
152 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
153 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
154 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
155 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
156 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
157 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
Andrea Campanella5ef88142021-02-02 14:34:50 +0100158 ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=#
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800159 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800160 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700161 ${src}= Set Variable ${hosts.src[${I}]}
162 ${dst}= Set Variable ${hosts.dst[${I}]}
163 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
164 ... Wait Until Keyword Succeeds 60s 2s
165 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
166 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
167 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800168 # Wait for the OLTs to come back up
169 FOR ${I} IN RANGE 0 ${olt_count}
170 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
171 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
172 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
173 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
174 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
175 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
176 ... Check Remote System Reachability True ${olt_ssh_ip}
177 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
178 ... Validate OLT Device ENABLED ACTIVE
179 ... REACHABLE ${olt_serial_number}
180 END
Suchitra Vemuri64db9652020-03-22 21:11:13 -0700181 # Waiting extra time for the ONUs to come up
182 Sleep 60s
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700183 Run Keyword If ${has_dataplane} Clean Up Linux
184 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
185 # Deleting OLT after test completes
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800186 #Run Keyword If ${has_dataplane} Delete All Devices and Verify
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700187
Suchitra Vemuri05180cb2020-03-26 13:13:27 -0700188Verify restart openolt-adapter container after subscriber provisioning
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800189 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
190 ... Prerequisite : ONUs are authenticated and pingable.
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800191 [Tags] functional VOL-1958 Restart-OpenOlt released
Andy Baviere187eda2020-04-20 15:00:02 -0700192 [Setup] Start Logging Restart-OpenOlt
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800193 [Teardown] Run Keywords Collect Logs
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800194 ... AND Stop Logging Restart-OpenOlt
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800195 # Add OLT device
196 setup
197 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
198 Run Keyword If ${has_dataplane} Clean Up Linux
199 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
200 ${waitforRestart} Set Variable 120s
201 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
202 Log ${podStatusOutput}
203 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Andrea Campanella3dcce272021-01-15 16:04:47 +0100204 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530205 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530206 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
207 ... app ${podName} Running
Suchitra Vemuri312bfe02020-03-16 16:11:34 -0700208 # Wait for 1min after openolt adapter is restarted
Hardik Windlass5e214b22021-02-26 10:37:14 +0000209 # TBD: Need for this Sleep
Suchitra Vemuri312bfe02020-03-16 16:11:34 -0700210 Sleep 60s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800211 Run Keyword If ${has_dataplane} Clean Up Linux
212 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800213 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
214 Log ${podStatusOutput}
215 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
216 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
217 Log to console Pod ${podName} restarted and sanity checks passed successfully
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800218
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800219Check OLT/ONU Authentication After Radius Pod Restart
220 [Documentation] After radius restart, triggers reassociation, checks status and
221 ... authentication, validates dhcp and ping. Note : wpa reassociate works only when
222 ... wpa supplicant is running in background hence it is recommended to remove
223 ... teardown from previous test or uncomment 'Teardown None'.
224 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
225 [Tags] functional RadiusRestart released
Andy Baviere187eda2020-04-20 15:00:02 -0700226 [Setup] Start Logging RadiusRestart
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800227 [Teardown] Run Keywords Collect Logs
228 ... AND Stop Logging RadiusRestart
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800229 ${waitforRestart} Set Variable 120s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530230 ${podName} Set Variable radius
Matteo Scandolo10acf562021-05-03 15:35:16 -0700231 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${INFRA_NAMESPACE} app ${podName}
232 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pods Status By Label ${INFRA_NAMESPACE}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530233 ... app ${podName} Running
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800234 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800235 ${src}= Set Variable ${hosts.src[${I}]}
236 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800237 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800238 ${onu_device_id}= Get Device ID From SN ${src['onu']}
239 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000240 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800241 Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800242 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800243 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
244 ... Validate Authentication After Reassociate True ${src['dp_iface_name']}
245 ... ${src['ip']} ${src['user']} ${src['pass']}
246 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800247 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800248 ... ${ONOS_SSH_PORT} ${onu_port}
249 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
250 ... Validate DHCP and Ping True True ${src['dp_iface_name']}
251 ... ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
252 ... ${src['ip']} ${src['user']} ${src['pass']}
253 ... ${src['container_type']} ${src['container_name']}
254 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']}
255 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
256 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
ubuntu6b6e7d42020-03-02 12:35:42 -0800257 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800258 END
259
Suchitra Vemuri05180cb2020-03-26 13:13:27 -0700260Verify openolt adapter restart before subscriber provisioning
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800261 [Documentation] Deploys an device instance and waits for it to authenticate. After
262 ... authentication is successful the rw-core deployment is scaled to 0 instances to
263 ... simulate a POD crash. The test then scales the rw-core back to a single instance
264 ... and configures ONOS for access. The test succeeds if the device is able to
265 ... complete the DHCP sequence.
Hung-Wei Chiud3576762020-03-25 18:06:26 -0700266 [Tags] functional olt-adapter-restart
Andy Baviere187eda2020-04-20 15:00:02 -0700267 [Setup] Start Logging OltAdapterRestart
Suchitra Vemuria0c086f2020-03-29 19:14:13 -0700268 #... AND Clear All Devices Then Create New Device
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800269 [Teardown] Run Keywords Collect Logs
270 ... AND Stop Logging OltAdapterRestart
Hung-Wei Chiud3576762020-03-25 18:06:26 -0700271 # Add OLT and perform sanity test
Suchitra Vemuri59ad2772020-03-26 22:27:27 -0700272 #setup
Suchitra Vemuri91537c82020-03-29 15:03:26 -0700273 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri59ad2772020-03-26 22:27:27 -0700274 #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800275 #Set Global Variable ${of_id}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800276
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800277 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800278 ${src}= Set Variable ${hosts.src[${I}]}
279 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800280 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800281 ${onu_device_id}= Get Device ID From SN ${src['onu']}
282 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000283 ... ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800284
285 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700286 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000287 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
ubuntu6b6e7d42020-03-02 12:35:42 -0800288 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800289 ... ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier84834d42020-02-25 13:49:50 -0700290 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
291 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800292 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
293 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700294 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
ubuntu6b6e7d42020-03-02 12:35:42 -0800295 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800296 ... ${ONOS_SSH_PORT} ${onu_port}
297 END
298 # 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 +0100299 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 0
300 Wait Until Keyword Succeeds ${timeout} 2s Pods Do Not Exist By Label ${NAMESPACE} app
301 ... ${OLT_ADAPTER_APP_LABEL}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800302 # 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 +0100303 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800304 Wait Until Keyword Succeeds ${timeout} 2s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100305 ... Check Expected Available Deployment Replicas By Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800306
307 # Ensure the device is available in ONOS, this represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800308 FOR ${I} IN RANGE 0 ${olt_count}
309 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
310 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
311 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
312 ... ${olt_serial_number}
313 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
314 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
315 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800316
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800317 FOR ${I} IN RANGE 0 ${num_all_onus}
318 ${src}= Set Variable ${hosts.src[${I}]}
319 ${dst}= Set Variable ${hosts.dst[${I}]}
320 ${of_id}= Get ofID From OLT List ${src['olt']}
321 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000322 ... ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800323 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000324 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800325 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530326 # Verify subscriber access flows are added for the ONU port
327 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
328 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
329 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800330 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
331 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
332 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
333 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
334 ... ${dst['container_name']}
335 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
ubuntu6b6e7d42020-03-02 12:35:42 -0800336 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800337 END
338
hwchiu14c05102020-03-27 00:44:30 +0000339Verify restart ofagent container after subscriber is provisioned
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000340 [Documentation] Restart ofagent container after VOLTHA is operational.
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000341 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass7a846662020-03-19 20:42:59 +0530342 [Tags] functional VOL-2409 ofagentRestart
Andy Baviere187eda2020-04-20 15:00:02 -0700343 [Setup] Start Logging ofagentRestart
Andy Bavier4a8450e2020-02-04 08:58:37 -0700344 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700345 ... AND Stop Logging ofagentRestart
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000346 ... AND Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 1
Suchitra Vemuriceb002a2020-03-25 13:36:21 -0700347 # set timeout value
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000348 ${waitforRestart} Set Variable 120s
Andy Bavier4a8450e2020-02-04 08:58:37 -0700349 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000350 Log ${podStatusOutput}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700351 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530352 ${podName} Set Variable ofagent
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530353 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530354 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
355 ... app ${podName} Running
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530356 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
357 Run Keyword If ${has_dataplane} Clean Up Linux
358 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Andy Bavier4a8450e2020-02-04 08:58:37 -0700359 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000360 Log ${podStatusOutput}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700361 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000362 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530363 # Scale Down the Of-Agent Deployment
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000364 ${ofagent-deployment}= Catenate SEPARATOR=- ${NAMESPACE} voltha-ofagent
365 Scale K8s Deployment ${NAMESPACE} ${ofagent-deployment} 0
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530366 Sleep 30s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800367 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530368 ${src}= Set Variable ${hosts.src[${I}]}
369 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800370 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530371 ${onu_device_id}= Get Device ID From SN ${src['onu']}
372 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000373 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530374 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700375 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530376 ... ENABLED ACTIVE REACHABLE
377 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
378 # Check ONU port is Disabled in ONOS
379 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000380 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530381 # Verify EAPOL flows are present for the ONU port
382 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
383 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
384 # Verify ONU in AAA-Users
385 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
386 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
387 # Verify DHCP-Allocations
388 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
389 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530390 # Verify subscriber access flows are added for the ONU port
391 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
392 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
393 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530394 # Verify Ping
395 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True
396 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
397 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530398 END
399 # Scale Up the Of-Agent Deployment
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000400 Scale K8s Deployment ${NAMESPACE} ${ofagent-deployment} 1
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530401 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
402 ... Running
403 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
404 Run Keyword If ${has_dataplane} Clean Up Linux
405 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
406 Log to console Pod ${podName} restarted and sanity checks passed successfully
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000407
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000408Check ONU adapter crash not forcing authentication again
409 [Documentation] After ONU adapter restart, checks wpa log for 'authentication started'
410 ... message count to make sure auth not started again and validates EAP status and ping.
411 ... Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable
hwchiu14c05102020-03-27 00:44:30 +0000412 [Tags] functional ONUAdaptCrash
Andy Baviere187eda2020-04-20 15:00:02 -0700413 [Setup] Start Logging ONUAdaptCrash
Andy Bavierabeba262020-02-07 16:22:16 -0700414 [Teardown] Run Keywords Collect Logs
415 ... AND Stop Logging ONUAdaptCrash
hwchiu14c05102020-03-27 00:44:30 +0000416 # Wait for adapter to resync
Hardik Windlass5e214b22021-02-26 10:37:14 +0000417 # TBD: Need for this Sleep
hwchiu14c05102020-03-27 00:44:30 +0000418 Sleep 60s
419 # Restart the onu
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530420 ${podName} Set Variable adapter-open-onu
Hung-Wei Chiu2bee4d42020-04-24 11:31:50 -0700421 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
hwchiu14c05102020-03-27 00:44:30 +0000422 # Validate ONU Ports
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800423 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000424 ${src}= Set Variable ${hosts.src[${I}]}
425 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800426 ${of_id}= Get ofID From OLT List ${src['olt']}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000427 ${onu_device_id}= Get Device ID From SN ${src['onu']}
428 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000429 ... ${of_id} ${src['uni_id']}
Hardik Windlass39015672021-07-05 05:48:08 +0000430 Run Keyword And Continue On Failure Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000431 ... ${src['onu']} ${src['uni_id']}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000432 ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System
433 ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']}
434 ... ${src['container_type']} ${src['container_name']}
435 Run Keyword If ${has_dataplane} Should Contain ${output} SUCCESS
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000436 END
Hung-Wei Chiu2bee4d42020-04-24 11:31:50 -0700437 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
438 ... app ${podName} Running
hwchiu14c05102020-03-27 00:44:30 +0000439 # Wait for adapter to resync
Hardik Windlass5e214b22021-02-26 10:37:14 +0000440 # TBD: Need for this Sleep
hwchiu14c05102020-03-27 00:44:30 +0000441 Sleep 60s
Andy Bavier8da0e132020-04-13 10:25:16 -0700442 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800443 # Validate OLTs are active in ONOS
444 FOR ${I} IN RANGE 0 ${olt_count}
445 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
446 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
447 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
448 ... ${olt_serial_number}
449 END
hwchiu14c05102020-03-27 00:44:30 +0000450 # Perform all steps in Sanity Test except the subscriber addition
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800451 FOR ${I} IN RANGE 0 ${num_all_onus}
hwchiu14c05102020-03-27 00:44:30 +0000452 ${src}= Set Variable ${hosts.src[${I}]}
453 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800454 ${of_id}= Get ofID From OLT List ${src['olt']}
hwchiu14c05102020-03-27 00:44:30 +0000455 ${onu_device_id}= Get Device ID From SN ${src['onu']}
456 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000457 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
hwchiu14c05102020-03-27 00:44:30 +0000458 # Check ONU port is Enabled in ONOS
459 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000460 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
hwchiu14c05102020-03-27 00:44:30 +0000461 # Verify EAPOL flows are added for the ONU port
462 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
463 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
464 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700465 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
hwchiu14c05102020-03-27 00:44:30 +0000466 ... ENABLED ACTIVE REACHABLE
467 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
468 # Perform Authentication
469 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
470 ... /tmp/wpa ${src['dp_iface_name']} log
471 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
472 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
473 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
474 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
475 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
476 # Verify that no pending flows exist for the ONU port
477 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
478 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530479 # Verify subscriber access flows are added for the ONU port
480 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
481 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
482 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
hwchiu14c05102020-03-27 00:44:30 +0000483 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
484 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
485 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
486 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
487 ... ${dst['container_name']}
488 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
489 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
hwchiu14c05102020-03-27 00:44:30 +0000490 END
491
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700492Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart
493 [Documentation] Deploys an device instance and waits for it to authenticate. After
494 ... authentication is successful the rw-core deployment is scaled to 0 instances to
495 ... simulate a POD crash. The test then scales the rw-core back to a single instance
496 ... and configures ONOS for access. The test succeeds if the device is able to
497 ... complete the DHCP sequence.
498 [Tags] functional rwcore-restart
Andy Baviere187eda2020-04-20 15:00:02 -0700499 [Setup] Run Keywords Start Logging RwCoreFailAndRestart
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700500 ... AND Clear All Devices Then Create New Device
501 [Teardown] Run Keywords Collect Logs
502 ... AND Stop Logging RwCoreFailAndRestart
Suchitra Vemuri5d3383f2020-04-03 11:02:26 -0700503 #... AND Delete Device and Verify
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700504 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800505 FOR ${I} IN RANGE 0 ${olt_count}
506 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
507 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
508 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
509 ... ${olt_serial_number}
510 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
511 ... Get NNI Port in ONOS ${of_id}
512 # Set Global Variable ${nni_port}
513 END
514 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700515 ${src}= Set Variable ${hosts.src[${I}]}
516 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800517 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700518 ${onu_device_id}= Get Device ID From SN ${src['onu']}
519 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000520 ... ${of_id} ${src['uni_id']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700521 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700522 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000523 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700524 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
525 ... ${ONOS_SSH_PORT} ${onu_port}
526 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
527 ... /tmp/wpa ${src['dp_iface_name']} log
528 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
529 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
530 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
531 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
532 ... ${ONOS_SSH_PORT} ${onu_port}
533 END
534
535 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000536 Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-rw-core 0
537 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist ${NAMESPACE} ${NAMESPACE}-voltha-rw-core
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700538 # Ensure the ofagent POD goes "not-ready" as expected
539 Wait Until keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000540 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 0
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700541 # Scale up the core deployment and make sure both it and the ofagent deployment are back
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000542 Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-rw-core 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700543 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000544 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${NAMESPACE}-voltha-rw-core 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700545 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000546 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700547 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
548 # so restart the port forwarding for the API service
David Bainbridge07321ff2020-06-12 13:55:42 -0700549 Restart VOLTHA Port Forward voltha-api
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700550 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
551 # represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800552 FOR ${I} IN RANGE 0 ${olt_count}
553 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
554 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
555 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
556 ... ${olt_serial_number}
Girish Gowdrae4de3b32021-03-23 22:20:00 -0700557 Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800558 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
559 END
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700560
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800561 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier52094622020-05-12 15:54:24 -0700562 ${src}= Set Variable ${hosts.src[${I}]}
563 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800564 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier52094622020-05-12 15:54:24 -0700565 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000566 ... ${of_id} ${src['uni_id']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700567 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000568 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700569 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530570 # Verify subscriber access flows are added for the ONU port
571 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
572 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
573 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700574 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
575 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
576 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
577 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
578 ... ${dst['container_name']}
579 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
580 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
581 END
582
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700583Verify OLT Soft Reboot
584 [Documentation] Test soft reboot of the OLT using voltctl command
585 [Tags] VOL-2745 OLTSoftReboot functional
586 [Setup] Start Logging OLTSoftReboot
587 [Teardown] Run Keywords Collect Logs
588 ... AND Stop Logging OLTSoftReboot
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800589 FOR ${I} IN RANGE 0 ${olt_count}
590 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
591 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
592 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
593 ... Validate OLT Device ENABLED ACTIVE
594 ... REACHABLE ${olt_serial_number}
595 # Reboot the OLT using "voltctl device reboot" command
596 Reboot Device ${olt_device_id}
Andrea Campanella9d8d3a52021-06-17 12:18:23 +0200597 # Wait for the OLT to actually go down
598 Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED UNKNOWN UNREACHABLE
599 ... ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800600 END
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700601 #Verify that ping fails
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800602 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700603 ${src}= Set Variable ${hosts.src[${I}]}
604 ${dst}= Set Variable ${hosts.dst[${I}]}
605 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
606 ... Wait Until Keyword Succeeds 60s 2s
607 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
608 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
609 END
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700610 # Check OLT states
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800611 FOR ${I} IN RANGE 0 ${olt_count}
612 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
613 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
614 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
615 # Wait for the OLT to come back up
616 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
617 ... Check Remote System Reachability True ${olt_ssh_ip}
618 # Check OLT states
619 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
620 ... Validate OLT Device ENABLED ACTIVE
621 ... REACHABLE ${olt_serial_number}
622 END
623 # Waiting extra time for the ONUs to come up
624 Sleep 60s
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700625 #Check after reboot that ONUs are active, authenticated/DHCP/pingable
626 Run Keyword If ${has_dataplane} Clean Up Linux
627 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
628
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700629Verify restart ofagent container before subscriber is provisioned
630 [Documentation] Restart ofagent container before subscriber is provisioned.
631 [Tags] functional VOL-2962 ofagentRestart2
632 [Setup] Start Logging ofagentRestart2
633 [Teardown] Run Keywords Collect Logs
Suchitra Vemuri8130be82020-09-15 16:47:58 -0700634 ... AND Stop Logging ofagentRestart2
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000635 ... AND Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 1
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800636 Delete All Devices And Verify
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700637 setup
638 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800639 FOR ${I} IN RANGE 0 ${olt_count}
640 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
641 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
642 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
643 ... ${olt_serial_number}
644 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
645 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
646 END
647 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700648 ${src}= Set Variable ${hosts.src[${I}]}
649 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800650 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700651 ${onu_device_id}= Get Device ID From SN ${src['onu']}
652 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000653 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700654 # Bring up the device and verify it authenticates
655 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000656 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700657 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
658 ... ${ONOS_SSH_PORT} ${onu_port}
659 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
660 ... /tmp/wpa ${src['dp_iface_name']} log
661 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
662 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
663 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
664 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
665 ... ${ONOS_SSH_PORT} ${onu_port}
666 END
667 # Restart POD ofagent
668 ${waitforRestart} Set Variable 120s
669 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
670 Log ${podStatusOutput}
671 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
672 ${podName} Set Variable ofagent
673 Restart Pod ${NAMESPACE} ${podName}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700674 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
675 ... Running
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800676 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700677 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000678 #Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700679 #... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
680 ${src}= Set Variable ${hosts.src[${I}]}
681 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800682 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700683 ${onu_device_id}= Get Device ID From SN ${src['onu']}
684 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000685 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700686 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000687 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700688 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
689 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
690 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
691 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
692 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
693 ... ${dst['container_name']}
694 # Verify DHCP-Allocations
695 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
696 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700697 END
698
Hardik Windlassc082c422021-03-16 15:44:10 +0000699Verify OLT Grpc Disconnection
700 [Documentation] Restarts OLT Grpc Server and verifies everything works as before without any system disruption.
701 [Tags] functional VOL-3904 restartGrpcServer bbsim
702 [Setup] Start Logging restartGrpcServer
703 [Teardown] Run Keywords Collect Logs
704 ... AND Stop Logging restartGrpcServer
705 Delete All Devices And Verify
706 Setup
707 Run Keyword If ${has_dataplane} Clean Up Linux
708 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
709 FOR ${J} IN RANGE 0 ${num_olts}
710 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
711 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
712 Restart Grpc Server ${NAMESPACE} ${bbsim_pod} 5
713 END
714 # Repeat sanity test without subscriber changes
715 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test True
716 # Additional Verification
717 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
718 Setup
719 Run Keyword If ${has_dataplane} Clean Up Linux
720 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
721
Hema123aff52020-05-26 15:41:47 +0530722Verify ONU Soft Reboot
723 [Documentation] Test soft reboot of the ONU using voltctl command
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800724 [Tags] VOL-1957 ONUSoftReboot functional notready
Hema123aff52020-05-26 15:41:47 +0530725 [Setup] Start Logging ONUSoftReboot
726 #... AND Setup
Andy Bavier4a8450e2020-02-04 08:58:37 -0700727 [Teardown] Run Keywords Collect Logs
Hema123aff52020-05-26 15:41:47 +0530728 ... AND Stop Logging ONUSoftReboot
729 #... AND Delete Device and Verify
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800730 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000731 ${src}= Set Variable ${hosts.src[${I}]}
732 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800733 ${of_id}= Get ofID From OLT List ${src['olt']}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000734 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800735 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
736 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hema123aff52020-05-26 15:41:47 +0530737 Reboot Device ${onu_device_id}
738 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
739 ... Wait Until Keyword Succeeds 60s 2s
740 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
741 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
742 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000743 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hema123aff52020-05-26 15:41:47 +0530744 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800745 Verify ping is succesful except for given device ${num_all_onus} ${onu_device_id}
Hema123aff52020-05-26 15:41:47 +0530746 Sleep 40s
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800747 # Check ONU port is Enabled in ONOS
748 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000749 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800750 # Verify EAPOL flows are added for the ONU port
751 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800752 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800753 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700754 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800755 ... ENABLED ACTIVE REACHABLE
756 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hema123aff52020-05-26 15:41:47 +0530757 Run Keyword If ${has_dataplane} Clean Up Linux
758 # Perform Authentication
759 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
760 ... /tmp/wpa ${src['dp_iface_name']} log
761 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
762 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
763 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
764 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
765 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
766 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000767 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hema123aff52020-05-26 15:41:47 +0530768 ... volt-add-subscriber-access ${of_id} ${onu_port}
769 # Verify that no pending flows exist for the ONU port
770 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
771 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530772 # Verify subscriber access flows are added for the ONU port
773 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
774 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
775 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hema123aff52020-05-26 15:41:47 +0530776 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
777 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800778 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hema123aff52020-05-26 15:41:47 +0530779 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
780 ... ${dst['container_name']}
781 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
782 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000783 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800784
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800785
786*** Keywords ***
787Setup Suite
788 [Documentation] Set up the test suite
789 Common Test Suite Setup
HungWei Chiu1408fb92020-03-03 19:43:30 -0500790 #power_switch.robot needs it to support different vendor's power switch
Hung-Wei Chiufcc6d8e2020-03-10 12:05:11 -0700791 ${switch_type}= Get Variable Value ${web_power_switch.type}
792 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800793
794Clear All Devices Then Create New Device
795 [Documentation] Remove any devices from VOLTHA and ONOS
796 # Remove all devices from voltha and nos
797 Delete All Devices and Verify
798 # Execute normal test Setup Keyword
799 Setup
TorstenThieme4e2168e2021-06-22 14:01:47 +0000800
801Teardown Suite
802 [Documentation] Clean up ONOS SSH connections
803 Close All ONOS SSH Connections