blob: 1d470fb35157fce81e459378fe3632d633d9f654 [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
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 Vemuri9a6dd6d2020-02-28 17:46:26 -080076 ... AND Stop Logging ONUreboot_PowerSwitch
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080077 ... AND Delete All Devices and Verify
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080078 # Add OLT device
79 setup
80 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
81 Run Keyword If ${has_dataplane} Clean Up Linux
82 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
83 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080084 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080085 ${src}= Set Variable ${hosts.src[${I}]}
86 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080087 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass0560f802020-05-06 23:06:53 +053088 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080089 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +000090 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080091 Disable Switch Outlet ${src['power_switch_port']}
92 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
93 ... Wait Until Keyword Succeeds 60s 2s
94 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
95 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +053096 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +000097 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass7c801e62020-05-04 19:33:21 +053098 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080099
100 Enable Switch Outlet ${src['power_switch_port']}
101 # Check ONU port is Enabled in ONOS
102 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000103 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800104 # Verify EAPOL flows are added for the ONU port
105 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700106 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800107 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700108 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800109 ... ENABLED ACTIVE REACHABLE
110 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlass7c801e62020-05-04 19:33:21 +0530111 Run Keyword If ${has_dataplane} Clean Up Linux
112 # Perform Authentication
113 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
114 ... /tmp/wpa ${src['dp_iface_name']} log
115 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
116 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
117 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
118 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
119 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
120 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000121 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530122 ... volt-add-subscriber-access ${of_id} ${onu_port}
123 # Verify that no pending flows exist for the ONU port
124 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
125 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530126 # Verify subscriber access flows are added for the ONU port
127 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
128 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
129 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530130 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
131 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800132 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530133 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
134 ... ${dst['container_name']}
135 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
136 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800137 END
Suchitra Vemurid7096132020-02-21 14:50:47 -0800138 # Deleting OLT after tests completes independently (as this test doesn't not run on each POD)
Suchitra Vemuri0656bc22020-03-21 19:07:49 -0700139 #Run Keyword If ${has_dataplane} Delete Device and Verify
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800140
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700141Verify OLT after rebooting physically
142 [Documentation] Test the physical reboot of the OLT
143 ... Prerequisite : Subscriber are authenticated/DHCP/pingable state
144 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
145 ... VOL-1956
146 [Tags] functional PhysicalOLTReboot
Andy Baviere187eda2020-04-20 15:00:02 -0700147 [Setup] Start Logging PhysicalOLTReboot
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700148 [Teardown] Run Keywords Collect Logs
149 ... AND Stop Logging PhysicalOLTReboot
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800150 ... AND Delete All Devices and Verify
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700151 # Add OLT device
152 setup
153 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
154 Run Keyword If ${has_dataplane} Clean Up Linux
155 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
156 # Reboot the OLT from the OLT CLI
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800157 FOR ${I} IN RANGE 0 ${olt_count}
158 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
159 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
160 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
161 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
162 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
163 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
Andrea Campanella5ef88142021-02-02 14:34:50 +0100164 ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=#
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800165 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800166 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700167 ${src}= Set Variable ${hosts.src[${I}]}
168 ${dst}= Set Variable ${hosts.dst[${I}]}
169 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
170 ... Wait Until Keyword Succeeds 60s 2s
171 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
172 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
173 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800174 # Wait for the OLTs to come back up
175 FOR ${I} IN RANGE 0 ${olt_count}
176 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
177 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
178 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
179 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
180 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
181 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
182 ... Check Remote System Reachability True ${olt_ssh_ip}
183 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
184 ... Validate OLT Device ENABLED ACTIVE
185 ... REACHABLE ${olt_serial_number}
186 END
Suchitra Vemuri64db9652020-03-22 21:11:13 -0700187 # Waiting extra time for the ONUs to come up
188 Sleep 60s
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700189 Run Keyword If ${has_dataplane} Clean Up Linux
190 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
191 # Deleting OLT after test completes
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800192 #Run Keyword If ${has_dataplane} Delete All Devices and Verify
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700193
Suchitra Vemuri05180cb2020-03-26 13:13:27 -0700194Verify restart openolt-adapter container after subscriber provisioning
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800195 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
196 ... Prerequisite : ONUs are authenticated and pingable.
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800197 [Tags] functional VOL-1958 Restart-OpenOlt released
Andy Baviere187eda2020-04-20 15:00:02 -0700198 [Setup] Start Logging Restart-OpenOlt
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800199 [Teardown] Run Keywords Collect Logs
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800200 ... AND Stop Logging Restart-OpenOlt
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800201 # Add OLT device
202 setup
203 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
204 Run Keyword If ${has_dataplane} Clean Up Linux
205 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
206 ${waitforRestart} Set Variable 120s
207 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
208 Log ${podStatusOutput}
209 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Andrea Campanella3dcce272021-01-15 16:04:47 +0100210 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530211 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530212 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
213 ... app ${podName} Running
Suchitra Vemuri312bfe02020-03-16 16:11:34 -0700214 # Wait for 1min after openolt adapter is restarted
Hardik Windlass5e214b22021-02-26 10:37:14 +0000215 # TBD: Need for this Sleep
Suchitra Vemuri312bfe02020-03-16 16:11:34 -0700216 Sleep 60s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800217 Run Keyword If ${has_dataplane} Clean Up Linux
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700218 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test ${suppressaddsubscriber}
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800219 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
220 Log ${podStatusOutput}
221 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
222 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
223 Log to console Pod ${podName} restarted and sanity checks passed successfully
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800224
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800225Check OLT/ONU Authentication After Radius Pod Restart
226 [Documentation] After radius restart, triggers reassociation, checks status and
227 ... authentication, validates dhcp and ping. Note : wpa reassociate works only when
228 ... wpa supplicant is running in background hence it is recommended to remove
229 ... teardown from previous test or uncomment 'Teardown None'.
230 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
231 [Tags] functional RadiusRestart released
Andy Baviere187eda2020-04-20 15:00:02 -0700232 [Setup] Start Logging RadiusRestart
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800233 [Teardown] Run Keywords Collect Logs
234 ... AND Stop Logging RadiusRestart
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800235 ${waitforRestart} Set Variable 120s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530236 ${podName} Set Variable radius
Matteo Scandolo10acf562021-05-03 15:35:16 -0700237 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${INFRA_NAMESPACE} app ${podName}
238 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pods Status By Label ${INFRA_NAMESPACE}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530239 ... app ${podName} Running
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800240 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800241 ${src}= Set Variable ${hosts.src[${I}]}
242 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800243 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800244 ${onu_device_id}= Get Device ID From SN ${src['onu']}
245 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000246 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800247 Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700248 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
249 ... ${src['c_tag']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800250 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
251 ... Validate Authentication After Reassociate True ${src['dp_iface_name']}
252 ... ${src['ip']} ${src['user']} ${src['pass']}
253 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800254 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800255 ... ${ONOS_SSH_PORT} ${onu_port}
256 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
257 ... Validate DHCP and Ping True True ${src['dp_iface_name']}
258 ... ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
259 ... ${src['ip']} ${src['user']} ${src['pass']}
260 ... ${src['container_type']} ${src['container_name']}
261 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']}
262 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
263 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
ubuntu6b6e7d42020-03-02 12:35:42 -0800264 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800265 END
266
Suchitra Vemuri05180cb2020-03-26 13:13:27 -0700267Verify openolt adapter restart before subscriber provisioning
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800268 [Documentation] Deploys an device instance and waits for it to authenticate. After
269 ... authentication is successful the rw-core deployment is scaled to 0 instances to
270 ... simulate a POD crash. The test then scales the rw-core back to a single instance
271 ... and configures ONOS for access. The test succeeds if the device is able to
272 ... complete the DHCP sequence.
Hung-Wei Chiud3576762020-03-25 18:06:26 -0700273 [Tags] functional olt-adapter-restart
Andy Baviere187eda2020-04-20 15:00:02 -0700274 [Setup] Start Logging OltAdapterRestart
Suchitra Vemuria0c086f2020-03-29 19:14:13 -0700275 #... AND Clear All Devices Then Create New Device
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800276 [Teardown] Run Keywords Collect Logs
277 ... AND Stop Logging OltAdapterRestart
Hung-Wei Chiud3576762020-03-25 18:06:26 -0700278 # Add OLT and perform sanity test
Suchitra Vemuri59ad2772020-03-26 22:27:27 -0700279 #setup
Suchitra Vemuri91537c82020-03-29 15:03:26 -0700280 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri59ad2772020-03-26 22:27:27 -0700281 #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800282 #Set Global Variable ${of_id}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800283
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800284 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800285 ${src}= Set Variable ${hosts.src[${I}]}
286 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800287 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800288 ${onu_device_id}= Get Device ID From SN ${src['onu']}
289 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000290 ... ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800291
292 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700293 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000294 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
ubuntu6b6e7d42020-03-02 12:35:42 -0800295 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700296 ... ${ONOS_SSH_PORT} ${of_id} ${onu_port} ${src['c_tag']}
Andy Bavier84834d42020-02-25 13:49:50 -0700297 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
298 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800299 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
300 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700301 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
ubuntu6b6e7d42020-03-02 12:35:42 -0800302 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800303 ... ${ONOS_SSH_PORT} ${onu_port}
304 END
305 # 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 +0100306 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 0
307 Wait Until Keyword Succeeds ${timeout} 2s Pods Do Not Exist By Label ${NAMESPACE} app
308 ... ${OLT_ADAPTER_APP_LABEL}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800309 # 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 +0100310 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800311 Wait Until Keyword Succeeds ${timeout} 2s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100312 ... Check Expected Available Deployment Replicas By Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800313
314 # Ensure the device is available in ONOS, this represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800315 FOR ${I} IN RANGE 0 ${olt_count}
316 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
317 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
318 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
319 ... ${olt_serial_number}
320 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
321 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
322 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800323
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800324 FOR ${I} IN RANGE 0 ${num_all_onus}
325 ${src}= Set Variable ${hosts.src[${I}]}
326 ${dst}= Set Variable ${hosts.dst[${I}]}
327 ${of_id}= Get ofID From OLT List ${src['olt']}
328 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000329 ... ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800330 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000331 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800332 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530333 # Verify subscriber access flows are added for the ONU port
334 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
335 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
336 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800337 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
338 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
339 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
340 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
341 ... ${dst['container_name']}
342 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
ubuntu6b6e7d42020-03-02 12:35:42 -0800343 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800344 END
345
hwchiu14c05102020-03-27 00:44:30 +0000346Verify restart ofagent container after subscriber is provisioned
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000347 [Documentation] Restart ofagent container after VOLTHA is operational.
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000348 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass7a846662020-03-19 20:42:59 +0530349 [Tags] functional VOL-2409 ofagentRestart
Andy Baviere187eda2020-04-20 15:00:02 -0700350 [Setup] Start Logging ofagentRestart
Andy Bavier4a8450e2020-02-04 08:58:37 -0700351 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700352 ... AND Stop Logging ofagentRestart
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000353 ... AND Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 1
Suchitra Vemuriceb002a2020-03-25 13:36:21 -0700354 # set timeout value
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000355 ${waitforRestart} Set Variable 120s
Andy Bavier4a8450e2020-02-04 08:58:37 -0700356 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000357 Log ${podStatusOutput}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700358 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530359 ${podName} Set Variable ofagent
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530360 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530361 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
362 ... app ${podName} Running
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530363 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
364 Run Keyword If ${has_dataplane} Clean Up Linux
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700365 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test ${suppressaddsubscriber}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700366 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000367 Log ${podStatusOutput}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700368 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000369 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530370 # Scale Down the Of-Agent Deployment
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000371 ${ofagent-deployment}= Catenate SEPARATOR=- ${NAMESPACE} voltha-ofagent
372 Scale K8s Deployment ${NAMESPACE} ${ofagent-deployment} 0
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530373 Sleep 30s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800374 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530375 ${src}= Set Variable ${hosts.src[${I}]}
376 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800377 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530378 ${onu_device_id}= Get Device ID From SN ${src['onu']}
379 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000380 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530381 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700382 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530383 ... ENABLED ACTIVE REACHABLE
384 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
385 # Check ONU port is Disabled in ONOS
386 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000387 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530388 # Verify EAPOL flows are present for the ONU port
389 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700390 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
391 ... ${src['c_tag']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530392 # Verify ONU in AAA-Users
393 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
394 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
395 # Verify DHCP-Allocations
396 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
397 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530398 # Verify subscriber access flows are added for the ONU port
399 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
400 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
401 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530402 # Verify Ping
403 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True
404 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
405 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530406 END
407 # Scale Up the Of-Agent Deployment
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000408 Scale K8s Deployment ${NAMESPACE} ${ofagent-deployment} 1
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530409 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
410 ... Running
411 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
412 Run Keyword If ${has_dataplane} Clean Up Linux
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700413 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test ${suppressaddsubscriber}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530414 Log to console Pod ${podName} restarted and sanity checks passed successfully
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000415
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000416Check ONU adapter crash not forcing authentication again
417 [Documentation] After ONU adapter restart, checks wpa log for 'authentication started'
418 ... message count to make sure auth not started again and validates EAP status and ping.
419 ... Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable
hwchiu14c05102020-03-27 00:44:30 +0000420 [Tags] functional ONUAdaptCrash
Andy Baviere187eda2020-04-20 15:00:02 -0700421 [Setup] Start Logging ONUAdaptCrash
Andy Bavierabeba262020-02-07 16:22:16 -0700422 [Teardown] Run Keywords Collect Logs
423 ... AND Stop Logging ONUAdaptCrash
hwchiu14c05102020-03-27 00:44:30 +0000424 # Wait for adapter to resync
Hardik Windlass5e214b22021-02-26 10:37:14 +0000425 # TBD: Need for this Sleep
hwchiu14c05102020-03-27 00:44:30 +0000426 Sleep 60s
427 # Restart the onu
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530428 ${podName} Set Variable adapter-open-onu
Hung-Wei Chiu2bee4d42020-04-24 11:31:50 -0700429 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
hwchiu14c05102020-03-27 00:44:30 +0000430 # Validate ONU Ports
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800431 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000432 ${src}= Set Variable ${hosts.src[${I}]}
433 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800434 ${of_id}= Get ofID From OLT List ${src['olt']}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000435 ${onu_device_id}= Get Device ID From SN ${src['onu']}
436 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000437 ... ${of_id} ${src['uni_id']}
Hardik Windlass39015672021-07-05 05:48:08 +0000438 Run Keyword And Continue On Failure Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000439 ... ${src['onu']} ${src['uni_id']}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000440 ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System
441 ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']}
442 ... ${src['container_type']} ${src['container_name']}
443 Run Keyword If ${has_dataplane} Should Contain ${output} SUCCESS
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000444 END
Hung-Wei Chiu2bee4d42020-04-24 11:31:50 -0700445 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
446 ... app ${podName} Running
hwchiu14c05102020-03-27 00:44:30 +0000447 # Wait for adapter to resync
Hardik Windlass5e214b22021-02-26 10:37:14 +0000448 # TBD: Need for this Sleep
hwchiu14c05102020-03-27 00:44:30 +0000449 Sleep 60s
Andy Bavier8da0e132020-04-13 10:25:16 -0700450 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800451 # Validate OLTs are active in ONOS
452 FOR ${I} IN RANGE 0 ${olt_count}
453 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
454 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
455 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
456 ... ${olt_serial_number}
457 END
hwchiu14c05102020-03-27 00:44:30 +0000458 # Perform all steps in Sanity Test except the subscriber addition
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800459 FOR ${I} IN RANGE 0 ${num_all_onus}
hwchiu14c05102020-03-27 00:44:30 +0000460 ${src}= Set Variable ${hosts.src[${I}]}
461 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800462 ${of_id}= Get ofID From OLT List ${src['olt']}
hwchiu14c05102020-03-27 00:44:30 +0000463 ${onu_device_id}= Get Device ID From SN ${src['onu']}
464 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000465 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
hwchiu14c05102020-03-27 00:44:30 +0000466 # Check ONU port is Enabled in ONOS
467 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000468 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
hwchiu14c05102020-03-27 00:44:30 +0000469 # Verify EAPOL flows are added for the ONU port
470 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700471 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
472 ... ${src['c_tag']}
hwchiu14c05102020-03-27 00:44:30 +0000473 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700474 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
hwchiu14c05102020-03-27 00:44:30 +0000475 ... ENABLED ACTIVE REACHABLE
476 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
477 # Perform Authentication
478 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
479 ... /tmp/wpa ${src['dp_iface_name']} log
480 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
481 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
482 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
483 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
484 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
485 # Verify that no pending flows exist for the ONU port
486 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
487 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530488 # Verify subscriber access flows are added for the ONU port
489 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
490 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
491 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
hwchiu14c05102020-03-27 00:44:30 +0000492 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
493 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
494 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
495 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
496 ... ${dst['container_name']}
497 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
498 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
hwchiu14c05102020-03-27 00:44:30 +0000499 END
500
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700501Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart
502 [Documentation] Deploys an device instance and waits for it to authenticate. After
503 ... authentication is successful the rw-core deployment is scaled to 0 instances to
504 ... simulate a POD crash. The test then scales the rw-core back to a single instance
505 ... and configures ONOS for access. The test succeeds if the device is able to
506 ... complete the DHCP sequence.
507 [Tags] functional rwcore-restart
Andy Baviere187eda2020-04-20 15:00:02 -0700508 [Setup] Run Keywords Start Logging RwCoreFailAndRestart
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700509 ... AND Clear All Devices Then Create New Device
510 [Teardown] Run Keywords Collect Logs
511 ... AND Stop Logging RwCoreFailAndRestart
Suchitra Vemuri5d3383f2020-04-03 11:02:26 -0700512 #... AND Delete Device and Verify
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700513 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800514 FOR ${I} IN RANGE 0 ${olt_count}
515 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
516 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
517 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
518 ... ${olt_serial_number}
519 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
520 ... Get NNI Port in ONOS ${of_id}
521 # Set Global Variable ${nni_port}
522 END
523 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700524 ${src}= Set Variable ${hosts.src[${I}]}
525 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800526 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700527 ${onu_device_id}= Get Device ID From SN ${src['onu']}
528 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000529 ... ${of_id} ${src['uni_id']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700530 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700531 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000532 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700533 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700534 ... ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700535 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
536 ... /tmp/wpa ${src['dp_iface_name']} log
537 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
538 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
539 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
540 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
541 ... ${ONOS_SSH_PORT} ${onu_port}
542 END
543
544 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000545 Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-rw-core 0
546 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist ${NAMESPACE} ${NAMESPACE}-voltha-rw-core
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700547 # Ensure the ofagent POD goes "not-ready" as expected
548 Wait Until keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000549 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 0
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700550 # Scale up the core deployment and make sure both it and the ofagent deployment are back
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000551 Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-rw-core 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700552 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000553 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${NAMESPACE}-voltha-rw-core 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700554 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000555 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700556 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
557 # so restart the port forwarding for the API service
David Bainbridge07321ff2020-06-12 13:55:42 -0700558 Restart VOLTHA Port Forward voltha-api
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700559 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
560 # represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800561 FOR ${I} IN RANGE 0 ${olt_count}
562 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
563 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
564 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
565 ... ${olt_serial_number}
Girish Gowdrae4de3b32021-03-23 22:20:00 -0700566 Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800567 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
568 END
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700569
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800570 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier52094622020-05-12 15:54:24 -0700571 ${src}= Set Variable ${hosts.src[${I}]}
572 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800573 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier52094622020-05-12 15:54:24 -0700574 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000575 ... ${of_id} ${src['uni_id']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700576 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000577 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700578 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530579 # Verify subscriber access flows are added for the ONU port
580 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
581 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
582 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700583 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
584 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
585 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
586 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
587 ... ${dst['container_name']}
588 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
589 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
590 END
591
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700592Verify OLT Soft Reboot
593 [Documentation] Test soft reboot of the OLT using voltctl command
594 [Tags] VOL-2745 OLTSoftReboot functional
595 [Setup] Start Logging OLTSoftReboot
596 [Teardown] Run Keywords Collect Logs
597 ... AND Stop Logging OLTSoftReboot
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800598 FOR ${I} IN RANGE 0 ${olt_count}
599 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
600 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
601 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
602 ... Validate OLT Device ENABLED ACTIVE
603 ... REACHABLE ${olt_serial_number}
604 # Reboot the OLT using "voltctl device reboot" command
605 Reboot Device ${olt_device_id}
Andrea Campanella9d8d3a52021-06-17 12:18:23 +0200606 # Wait for the OLT to actually go down
607 Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED UNKNOWN UNREACHABLE
608 ... ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800609 END
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700610 #Verify that ping fails
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800611 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700612 ${src}= Set Variable ${hosts.src[${I}]}
613 ${dst}= Set Variable ${hosts.dst[${I}]}
614 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
615 ... Wait Until Keyword Succeeds 60s 2s
616 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
617 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
618 END
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700619 # Check OLT states
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800620 FOR ${I} IN RANGE 0 ${olt_count}
621 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
622 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
623 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
624 # Wait for the OLT to come back up
625 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
626 ... Check Remote System Reachability True ${olt_ssh_ip}
627 # Check OLT states
628 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
629 ... Validate OLT Device ENABLED ACTIVE
630 ... REACHABLE ${olt_serial_number}
631 END
632 # Waiting extra time for the ONUs to come up
633 Sleep 60s
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700634 #Check after reboot that ONUs are active, authenticated/DHCP/pingable
635 Run Keyword If ${has_dataplane} Clean Up Linux
636 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
637
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700638Verify restart ofagent container before subscriber is provisioned
639 [Documentation] Restart ofagent container before subscriber is provisioned.
640 [Tags] functional VOL-2962 ofagentRestart2
641 [Setup] Start Logging ofagentRestart2
642 [Teardown] Run Keywords Collect Logs
Suchitra Vemuri8130be82020-09-15 16:47:58 -0700643 ... AND Stop Logging ofagentRestart2
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000644 ... AND Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 1
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800645 Delete All Devices And Verify
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700646 setup
647 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800648 FOR ${I} IN RANGE 0 ${olt_count}
649 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
650 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
651 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
652 ... ${olt_serial_number}
653 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
654 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
655 END
656 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700657 ${src}= Set Variable ${hosts.src[${I}]}
658 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800659 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700660 ${onu_device_id}= Get Device ID From SN ${src['onu']}
661 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000662 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700663 # Bring up the device and verify it authenticates
664 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000665 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700666 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700667 ... ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700668 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
669 ... /tmp/wpa ${src['dp_iface_name']} log
670 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
671 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
672 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
673 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
674 ... ${ONOS_SSH_PORT} ${onu_port}
675 END
676 # Restart POD ofagent
677 ${waitforRestart} Set Variable 120s
678 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
679 Log ${podStatusOutput}
680 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
681 ${podName} Set Variable ofagent
682 Restart Pod ${NAMESPACE} ${podName}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700683 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
684 ... Running
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800685 FOR ${I} IN RANGE 0 ${num_all_onus}
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 ${src}= Set Variable ${hosts.src[${I}]}
690 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800691 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700692 ${onu_device_id}= Get Device ID From SN ${src['onu']}
693 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000694 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700695 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000696 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700697 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
698 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
699 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
700 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
701 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
702 ... ${dst['container_name']}
703 # Verify DHCP-Allocations
704 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
705 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700706 END
707
Hardik Windlassc082c422021-03-16 15:44:10 +0000708Verify OLT Grpc Disconnection
709 [Documentation] Restarts OLT Grpc Server and verifies everything works as before without any system disruption.
710 [Tags] functional VOL-3904 restartGrpcServer bbsim
711 [Setup] Start Logging restartGrpcServer
712 [Teardown] Run Keywords Collect Logs
713 ... AND Stop Logging restartGrpcServer
714 Delete All Devices And Verify
715 Setup
716 Run Keyword If ${has_dataplane} Clean Up Linux
717 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
718 FOR ${J} IN RANGE 0 ${num_olts}
719 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
720 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
721 Restart Grpc Server ${NAMESPACE} ${bbsim_pod} 5
722 END
723 # Repeat sanity test without subscriber changes
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700724 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test ${suppressaddsubscriber}
Hardik Windlassc082c422021-03-16 15:44:10 +0000725 # Additional Verification
726 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
727 Setup
728 Run Keyword If ${has_dataplane} Clean Up Linux
729 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
730
Hema123aff52020-05-26 15:41:47 +0530731Verify ONU Soft Reboot
732 [Documentation] Test soft reboot of the ONU using voltctl command
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800733 [Tags] VOL-1957 ONUSoftReboot functional notready
Hema123aff52020-05-26 15:41:47 +0530734 [Setup] Start Logging ONUSoftReboot
735 #... AND Setup
Andy Bavier4a8450e2020-02-04 08:58:37 -0700736 [Teardown] Run Keywords Collect Logs
Hema123aff52020-05-26 15:41:47 +0530737 ... AND Stop Logging ONUSoftReboot
738 #... AND Delete Device and Verify
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800739 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000740 ${src}= Set Variable ${hosts.src[${I}]}
741 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800742 ${of_id}= Get ofID From OLT List ${src['olt']}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000743 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800744 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
745 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hema123aff52020-05-26 15:41:47 +0530746 Reboot Device ${onu_device_id}
747 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
748 ... Wait Until Keyword Succeeds 60s 2s
749 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
750 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
751 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000752 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hema123aff52020-05-26 15:41:47 +0530753 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800754 Verify ping is succesful except for given device ${num_all_onus} ${onu_device_id}
Hema123aff52020-05-26 15:41:47 +0530755 Sleep 40s
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800756 # Check ONU port is Enabled in ONOS
757 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000758 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800759 # Verify EAPOL flows are added for the ONU port
760 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700761 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800762 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700763 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800764 ... ENABLED ACTIVE REACHABLE
765 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hema123aff52020-05-26 15:41:47 +0530766 Run Keyword If ${has_dataplane} Clean Up Linux
767 # Perform Authentication
768 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
769 ... /tmp/wpa ${src['dp_iface_name']} log
770 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
771 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
772 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
773 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
774 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
775 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000776 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hema123aff52020-05-26 15:41:47 +0530777 ... volt-add-subscriber-access ${of_id} ${onu_port}
778 # Verify that no pending flows exist for the ONU port
779 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
780 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530781 # Verify subscriber access flows are added for the ONU port
782 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
783 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
784 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hema123aff52020-05-26 15:41:47 +0530785 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
786 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800787 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hema123aff52020-05-26 15:41:47 +0530788 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
789 ... ${dst['container_name']}
790 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
791 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000792 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800793
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800794
795*** Keywords ***
796Setup Suite
797 [Documentation] Set up the test suite
798 Common Test Suite Setup
HungWei Chiu1408fb92020-03-03 19:43:30 -0500799 #power_switch.robot needs it to support different vendor's power switch
Hung-Wei Chiufcc6d8e2020-03-10 12:05:11 -0700800 ${switch_type}= Get Variable Value ${web_power_switch.type}
801 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800802
803Clear All Devices Then Create New Device
804 [Documentation] Remove any devices from VOLTHA and ONOS
805 # Remove all devices from voltha and nos
806 Delete All Devices and Verify
807 # Execute normal test Setup Keyword
808 Setup
TorstenThieme4e2168e2021-06-22 14:01:47 +0000809
810Teardown Suite
811 [Documentation] Clean up ONOS SSH connections
812 Close All ONOS SSH Connections