blob: e0e8eb768c5c680184d961757945ae81dc7800ec [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
Hardik Windlassd8ecbef2021-10-19 06:12:16 +000060# logging flag to enable Voltha Components Logging, can be passed via the command line too
61# example: -v logging:False
62${logging} True
63
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000064*** Test Cases ***
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080065Verify ONU after rebooting physically
66 [Documentation] Test the ONU functionality by physically turning on/off ONU.
67 ... Prerequisite : Subscriber are authenticated/DHCP/pingable state
68 ... Test case runs only on the PODs that are configured with PowerSwitch that
69 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
70 ... VOL-2634
71 [Tags] functional PowerSwitch
Andy Baviere187eda2020-04-20 15:00:02 -070072 [Setup] Start Logging ONUreboot_PowerSwitch
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080073 [Teardown] Run Keywords Collect Logs
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -080074 ... AND Stop Logging ONUreboot_PowerSwitch
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080075 ... AND Delete All Devices and Verify
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080076 # Add OLT device
77 setup
78 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
79 Run Keyword If ${has_dataplane} Clean Up Linux
80 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
81 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080082 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080083 ${src}= Set Variable ${hosts.src[${I}]}
84 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080085 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass0560f802020-05-06 23:06:53 +053086 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080087 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +000088 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080089 Disable Switch Outlet ${src['power_switch_port']}
90 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
91 ... Wait Until Keyword Succeeds 60s 2s
92 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
93 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +053094 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +000095 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass7c801e62020-05-04 19:33:21 +053096 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080097
98 Enable Switch Outlet ${src['power_switch_port']}
99 # Check ONU port is Enabled in ONOS
100 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000101 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800102 # Verify EAPOL flows are added for the ONU port
103 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800104 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800105 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700106 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800107 ... ENABLED ACTIVE REACHABLE
108 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlass7c801e62020-05-04 19:33:21 +0530109 Run Keyword If ${has_dataplane} Clean Up Linux
110 # Perform Authentication
111 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
112 ... /tmp/wpa ${src['dp_iface_name']} log
113 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
114 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
115 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
116 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
117 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
118 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000119 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530120 ... volt-add-subscriber-access ${of_id} ${onu_port}
121 # Verify that no pending flows exist for the ONU port
122 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
123 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530124 # Verify subscriber access flows are added for the ONU port
125 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
126 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
127 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530128 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
129 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800130 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530131 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
132 ... ${dst['container_name']}
133 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
134 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800135 END
Suchitra Vemurid7096132020-02-21 14:50:47 -0800136 # Deleting OLT after tests completes independently (as this test doesn't not run on each POD)
Suchitra Vemuri0656bc22020-03-21 19:07:49 -0700137 #Run Keyword If ${has_dataplane} Delete Device and Verify
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800138
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700139Verify OLT after rebooting physically
140 [Documentation] Test the physical reboot of the OLT
141 ... Prerequisite : Subscriber are authenticated/DHCP/pingable state
142 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
143 ... VOL-1956
144 [Tags] functional PhysicalOLTReboot
Andy Baviere187eda2020-04-20 15:00:02 -0700145 [Setup] Start Logging PhysicalOLTReboot
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700146 [Teardown] Run Keywords Collect Logs
147 ... AND Stop Logging PhysicalOLTReboot
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800148 ... AND Delete All Devices and Verify
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700149 # Add OLT device
150 setup
151 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
152 Run Keyword If ${has_dataplane} Clean Up Linux
153 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
154 # Reboot the OLT from the OLT CLI
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800155 FOR ${I} IN RANGE 0 ${olt_count}
156 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
157 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
158 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
159 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
160 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
161 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
Andrea Campanella5ef88142021-02-02 14:34:50 +0100162 ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=#
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800163 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800164 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700165 ${src}= Set Variable ${hosts.src[${I}]}
166 ${dst}= Set Variable ${hosts.dst[${I}]}
167 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
168 ... Wait Until Keyword Succeeds 60s 2s
169 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
170 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
171 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800172 # Wait for the OLTs to come back up
173 FOR ${I} IN RANGE 0 ${olt_count}
174 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
175 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
176 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
177 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
178 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
179 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
180 ... Check Remote System Reachability True ${olt_ssh_ip}
181 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
182 ... Validate OLT Device ENABLED ACTIVE
183 ... REACHABLE ${olt_serial_number}
184 END
Suchitra Vemuri64db9652020-03-22 21:11:13 -0700185 # Waiting extra time for the ONUs to come up
186 Sleep 60s
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700187 Run Keyword If ${has_dataplane} Clean Up Linux
188 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
189 # Deleting OLT after test completes
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800190 #Run Keyword If ${has_dataplane} Delete All Devices and Verify
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700191
Suchitra Vemuri05180cb2020-03-26 13:13:27 -0700192Verify restart openolt-adapter container after subscriber provisioning
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800193 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
194 ... Prerequisite : ONUs are authenticated and pingable.
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800195 [Tags] functional VOL-1958 Restart-OpenOlt released
Andy Baviere187eda2020-04-20 15:00:02 -0700196 [Setup] Start Logging Restart-OpenOlt
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800197 [Teardown] Run Keywords Collect Logs
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800198 ... AND Stop Logging Restart-OpenOlt
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800199 # Add OLT device
200 setup
201 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
202 Run Keyword If ${has_dataplane} Clean Up Linux
203 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
204 ${waitforRestart} Set Variable 120s
205 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
206 Log ${podStatusOutput}
207 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Andrea Campanella3dcce272021-01-15 16:04:47 +0100208 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530209 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530210 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
211 ... app ${podName} Running
Suchitra Vemuri312bfe02020-03-16 16:11:34 -0700212 # Wait for 1min after openolt adapter is restarted
Hardik Windlass5e214b22021-02-26 10:37:14 +0000213 # TBD: Need for this Sleep
Suchitra Vemuri312bfe02020-03-16 16:11:34 -0700214 Sleep 60s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800215 Run Keyword If ${has_dataplane} Clean Up Linux
216 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800217 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
218 Log ${podStatusOutput}
219 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
220 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
221 Log to console Pod ${podName} restarted and sanity checks passed successfully
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800222
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800223Check OLT/ONU Authentication After Radius Pod Restart
224 [Documentation] After radius restart, triggers reassociation, checks status and
225 ... authentication, validates dhcp and ping. Note : wpa reassociate works only when
226 ... wpa supplicant is running in background hence it is recommended to remove
227 ... teardown from previous test or uncomment 'Teardown None'.
228 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
229 [Tags] functional RadiusRestart released
Andy Baviere187eda2020-04-20 15:00:02 -0700230 [Setup] Start Logging RadiusRestart
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800231 [Teardown] Run Keywords Collect Logs
232 ... AND Stop Logging RadiusRestart
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800233 ${waitforRestart} Set Variable 120s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530234 ${podName} Set Variable radius
Matteo Scandolo10acf562021-05-03 15:35:16 -0700235 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${INFRA_NAMESPACE} app ${podName}
236 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pods Status By Label ${INFRA_NAMESPACE}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530237 ... app ${podName} Running
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800238 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800239 ${src}= Set Variable ${hosts.src[${I}]}
240 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800241 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800242 ${onu_device_id}= Get Device ID From SN ${src['onu']}
243 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000244 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800245 Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800246 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800247 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
248 ... Validate Authentication After Reassociate True ${src['dp_iface_name']}
249 ... ${src['ip']} ${src['user']} ${src['pass']}
250 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800251 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800252 ... ${ONOS_SSH_PORT} ${onu_port}
253 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
254 ... Validate DHCP and Ping True True ${src['dp_iface_name']}
255 ... ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
256 ... ${src['ip']} ${src['user']} ${src['pass']}
257 ... ${src['container_type']} ${src['container_name']}
258 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']}
259 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
260 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
ubuntu6b6e7d42020-03-02 12:35:42 -0800261 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800262 END
263
Suchitra Vemuri05180cb2020-03-26 13:13:27 -0700264Verify openolt adapter restart before subscriber provisioning
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800265 [Documentation] Deploys an device instance and waits for it to authenticate. After
266 ... authentication is successful the rw-core deployment is scaled to 0 instances to
267 ... simulate a POD crash. The test then scales the rw-core back to a single instance
268 ... and configures ONOS for access. The test succeeds if the device is able to
269 ... complete the DHCP sequence.
Hung-Wei Chiud3576762020-03-25 18:06:26 -0700270 [Tags] functional olt-adapter-restart
Andy Baviere187eda2020-04-20 15:00:02 -0700271 [Setup] Start Logging OltAdapterRestart
Suchitra Vemuria0c086f2020-03-29 19:14:13 -0700272 #... AND Clear All Devices Then Create New Device
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800273 [Teardown] Run Keywords Collect Logs
274 ... AND Stop Logging OltAdapterRestart
Hung-Wei Chiud3576762020-03-25 18:06:26 -0700275 # Add OLT and perform sanity test
Suchitra Vemuri59ad2772020-03-26 22:27:27 -0700276 #setup
Suchitra Vemuri91537c82020-03-29 15:03:26 -0700277 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri59ad2772020-03-26 22:27:27 -0700278 #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800279 #Set Global Variable ${of_id}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800280
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800281 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800282 ${src}= Set Variable ${hosts.src[${I}]}
283 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800284 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800285 ${onu_device_id}= Get Device ID From SN ${src['onu']}
286 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000287 ... ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800288
289 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700290 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000291 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
ubuntu6b6e7d42020-03-02 12:35:42 -0800292 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800293 ... ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier84834d42020-02-25 13:49:50 -0700294 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
295 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800296 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
297 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700298 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
ubuntu6b6e7d42020-03-02 12:35:42 -0800299 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800300 ... ${ONOS_SSH_PORT} ${onu_port}
301 END
302 # 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 +0100303 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 0
304 Wait Until Keyword Succeeds ${timeout} 2s Pods Do Not Exist By Label ${NAMESPACE} app
305 ... ${OLT_ADAPTER_APP_LABEL}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800306 # 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 +0100307 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800308 Wait Until Keyword Succeeds ${timeout} 2s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100309 ... Check Expected Available Deployment Replicas By Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800310
311 # Ensure the device is available in ONOS, this represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800312 FOR ${I} IN RANGE 0 ${olt_count}
313 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
314 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
315 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
316 ... ${olt_serial_number}
317 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
318 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
319 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800320
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800321 FOR ${I} IN RANGE 0 ${num_all_onus}
322 ${src}= Set Variable ${hosts.src[${I}]}
323 ${dst}= Set Variable ${hosts.dst[${I}]}
324 ${of_id}= Get ofID From OLT List ${src['olt']}
325 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000326 ... ${of_id} ${src['uni_id']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800327 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000328 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800329 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530330 # Verify subscriber access flows are added for the ONU port
331 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
332 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
333 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800334 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
335 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
336 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
337 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
338 ... ${dst['container_name']}
339 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
ubuntu6b6e7d42020-03-02 12:35:42 -0800340 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800341 END
342
hwchiu14c05102020-03-27 00:44:30 +0000343Verify restart ofagent container after subscriber is provisioned
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000344 [Documentation] Restart ofagent container after VOLTHA is operational.
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000345 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass7a846662020-03-19 20:42:59 +0530346 [Tags] functional VOL-2409 ofagentRestart
Andy Baviere187eda2020-04-20 15:00:02 -0700347 [Setup] Start Logging ofagentRestart
Andy Bavier4a8450e2020-02-04 08:58:37 -0700348 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700349 ... AND Stop Logging ofagentRestart
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000350 ... AND Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 1
Suchitra Vemuriceb002a2020-03-25 13:36:21 -0700351 # set timeout value
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000352 ${waitforRestart} Set Variable 120s
Andy Bavier4a8450e2020-02-04 08:58:37 -0700353 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000354 Log ${podStatusOutput}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700355 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530356 ${podName} Set Variable ofagent
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530357 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530358 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
359 ... app ${podName} Running
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530360 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
361 Run Keyword If ${has_dataplane} Clean Up Linux
362 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Andy Bavier4a8450e2020-02-04 08:58:37 -0700363 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000364 Log ${podStatusOutput}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700365 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000366 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530367 # Scale Down the Of-Agent Deployment
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000368 ${ofagent-deployment}= Catenate SEPARATOR=- ${NAMESPACE} voltha-ofagent
369 Scale K8s Deployment ${NAMESPACE} ${ofagent-deployment} 0
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530370 Sleep 30s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800371 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530372 ${src}= Set Variable ${hosts.src[${I}]}
373 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800374 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530375 ${onu_device_id}= Get Device ID From SN ${src['onu']}
376 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000377 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530378 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700379 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530380 ... ENABLED ACTIVE REACHABLE
381 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
382 # Check ONU port is Disabled in ONOS
383 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000384 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530385 # Verify EAPOL flows are present for the ONU port
386 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
387 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
388 # Verify ONU in AAA-Users
389 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
390 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
391 # Verify DHCP-Allocations
392 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
393 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530394 # Verify subscriber access flows are added for the ONU port
395 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
396 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
397 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530398 # Verify Ping
399 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True
400 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
401 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530402 END
403 # Scale Up the Of-Agent Deployment
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000404 Scale K8s Deployment ${NAMESPACE} ${ofagent-deployment} 1
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530405 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
406 ... Running
407 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
408 Run Keyword If ${has_dataplane} Clean Up Linux
409 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
410 Log to console Pod ${podName} restarted and sanity checks passed successfully
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000411
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000412Check ONU adapter crash not forcing authentication again
413 [Documentation] After ONU adapter restart, checks wpa log for 'authentication started'
414 ... message count to make sure auth not started again and validates EAP status and ping.
415 ... Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable
hwchiu14c05102020-03-27 00:44:30 +0000416 [Tags] functional ONUAdaptCrash
Andy Baviere187eda2020-04-20 15:00:02 -0700417 [Setup] Start Logging ONUAdaptCrash
Andy Bavierabeba262020-02-07 16:22:16 -0700418 [Teardown] Run Keywords Collect Logs
419 ... AND Stop Logging ONUAdaptCrash
hwchiu14c05102020-03-27 00:44:30 +0000420 # Wait for adapter to resync
Hardik Windlass5e214b22021-02-26 10:37:14 +0000421 # TBD: Need for this Sleep
hwchiu14c05102020-03-27 00:44:30 +0000422 Sleep 60s
423 # Restart the onu
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530424 ${podName} Set Variable adapter-open-onu
Hung-Wei Chiu2bee4d42020-04-24 11:31:50 -0700425 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
hwchiu14c05102020-03-27 00:44:30 +0000426 # Validate ONU Ports
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800427 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000428 ${src}= Set Variable ${hosts.src[${I}]}
429 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800430 ${of_id}= Get ofID From OLT List ${src['olt']}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000431 ${onu_device_id}= Get Device ID From SN ${src['onu']}
432 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000433 ... ${of_id} ${src['uni_id']}
Hardik Windlass39015672021-07-05 05:48:08 +0000434 Run Keyword And Continue On Failure Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000435 ... ${src['onu']} ${src['uni_id']}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000436 ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System
437 ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']}
438 ... ${src['container_type']} ${src['container_name']}
439 Run Keyword If ${has_dataplane} Should Contain ${output} SUCCESS
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000440 END
Hung-Wei Chiu2bee4d42020-04-24 11:31:50 -0700441 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
442 ... app ${podName} Running
hwchiu14c05102020-03-27 00:44:30 +0000443 # Wait for adapter to resync
Hardik Windlass5e214b22021-02-26 10:37:14 +0000444 # TBD: Need for this Sleep
hwchiu14c05102020-03-27 00:44:30 +0000445 Sleep 60s
Andy Bavier8da0e132020-04-13 10:25:16 -0700446 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800447 # Validate OLTs are active in ONOS
448 FOR ${I} IN RANGE 0 ${olt_count}
449 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
450 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
451 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
452 ... ${olt_serial_number}
453 END
hwchiu14c05102020-03-27 00:44:30 +0000454 # Perform all steps in Sanity Test except the subscriber addition
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800455 FOR ${I} IN RANGE 0 ${num_all_onus}
hwchiu14c05102020-03-27 00:44:30 +0000456 ${src}= Set Variable ${hosts.src[${I}]}
457 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800458 ${of_id}= Get ofID From OLT List ${src['olt']}
hwchiu14c05102020-03-27 00:44:30 +0000459 ${onu_device_id}= Get Device ID From SN ${src['onu']}
460 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000461 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
hwchiu14c05102020-03-27 00:44:30 +0000462 # Check ONU port is Enabled in ONOS
463 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000464 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
hwchiu14c05102020-03-27 00:44:30 +0000465 # Verify EAPOL flows are added for the ONU port
466 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
467 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
468 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700469 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
hwchiu14c05102020-03-27 00:44:30 +0000470 ... ENABLED ACTIVE REACHABLE
471 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
472 # Perform Authentication
473 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
474 ... /tmp/wpa ${src['dp_iface_name']} log
475 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
476 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
477 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
478 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
479 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
480 # Verify that no pending flows exist for the ONU port
481 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
482 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530483 # Verify subscriber access flows are added for the ONU port
484 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
485 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
486 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
hwchiu14c05102020-03-27 00:44:30 +0000487 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
488 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
489 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
490 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
491 ... ${dst['container_name']}
492 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
493 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
hwchiu14c05102020-03-27 00:44:30 +0000494 END
495
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700496Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart
497 [Documentation] Deploys an device instance and waits for it to authenticate. After
498 ... authentication is successful the rw-core deployment is scaled to 0 instances to
499 ... simulate a POD crash. The test then scales the rw-core back to a single instance
500 ... and configures ONOS for access. The test succeeds if the device is able to
501 ... complete the DHCP sequence.
502 [Tags] functional rwcore-restart
Andy Baviere187eda2020-04-20 15:00:02 -0700503 [Setup] Run Keywords Start Logging RwCoreFailAndRestart
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700504 ... AND Clear All Devices Then Create New Device
505 [Teardown] Run Keywords Collect Logs
506 ... AND Stop Logging RwCoreFailAndRestart
Suchitra Vemuri5d3383f2020-04-03 11:02:26 -0700507 #... AND Delete Device and Verify
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700508 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800509 FOR ${I} IN RANGE 0 ${olt_count}
510 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
511 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
512 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
513 ... ${olt_serial_number}
514 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
515 ... Get NNI Port in ONOS ${of_id}
516 # Set Global Variable ${nni_port}
517 END
518 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700519 ${src}= Set Variable ${hosts.src[${I}]}
520 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800521 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700522 ${onu_device_id}= Get Device ID From SN ${src['onu']}
523 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000524 ... ${of_id} ${src['uni_id']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700525 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700526 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000527 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700528 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
529 ... ${ONOS_SSH_PORT} ${onu_port}
530 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
531 ... /tmp/wpa ${src['dp_iface_name']} log
532 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
533 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
534 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
535 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
536 ... ${ONOS_SSH_PORT} ${onu_port}
537 END
538
539 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000540 Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-rw-core 0
541 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist ${NAMESPACE} ${NAMESPACE}-voltha-rw-core
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700542 # Ensure the ofagent POD goes "not-ready" as expected
543 Wait Until keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000544 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 0
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700545 # Scale up the core deployment and make sure both it and the ofagent deployment are back
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000546 Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-rw-core 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700547 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000548 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${NAMESPACE}-voltha-rw-core 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700549 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000550 ... Check Expected Available Deployment Replicas ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700551 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
552 # so restart the port forwarding for the API service
David Bainbridge07321ff2020-06-12 13:55:42 -0700553 Restart VOLTHA Port Forward voltha-api
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700554 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
555 # represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800556 FOR ${I} IN RANGE 0 ${olt_count}
557 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
558 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
559 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
560 ... ${olt_serial_number}
Girish Gowdrae4de3b32021-03-23 22:20:00 -0700561 Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800562 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
563 END
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700564
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800565 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier52094622020-05-12 15:54:24 -0700566 ${src}= Set Variable ${hosts.src[${I}]}
567 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800568 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier52094622020-05-12 15:54:24 -0700569 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000570 ... ${of_id} ${src['uni_id']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700571 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000572 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700573 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530574 # Verify subscriber access flows are added for the ONU port
575 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
576 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
577 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700578 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
579 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
580 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
581 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
582 ... ${dst['container_name']}
583 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
584 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
585 END
586
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700587Verify OLT Soft Reboot
588 [Documentation] Test soft reboot of the OLT using voltctl command
589 [Tags] VOL-2745 OLTSoftReboot functional
590 [Setup] Start Logging OLTSoftReboot
591 [Teardown] Run Keywords Collect Logs
592 ... AND Stop Logging OLTSoftReboot
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800593 FOR ${I} IN RANGE 0 ${olt_count}
594 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
595 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
596 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
597 ... Validate OLT Device ENABLED ACTIVE
598 ... REACHABLE ${olt_serial_number}
599 # Reboot the OLT using "voltctl device reboot" command
600 Reboot Device ${olt_device_id}
Andrea Campanella9d8d3a52021-06-17 12:18:23 +0200601 # Wait for the OLT to actually go down
602 Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED UNKNOWN UNREACHABLE
603 ... ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800604 END
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700605 #Verify that ping fails
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800606 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700607 ${src}= Set Variable ${hosts.src[${I}]}
608 ${dst}= Set Variable ${hosts.dst[${I}]}
609 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
610 ... Wait Until Keyword Succeeds 60s 2s
611 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
612 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
613 END
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700614 # Check OLT states
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800615 FOR ${I} IN RANGE 0 ${olt_count}
616 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
617 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
618 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
619 # Wait for the OLT to come back up
620 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
621 ... Check Remote System Reachability True ${olt_ssh_ip}
622 # Check OLT states
623 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
624 ... Validate OLT Device ENABLED ACTIVE
625 ... REACHABLE ${olt_serial_number}
626 END
627 # Waiting extra time for the ONUs to come up
628 Sleep 60s
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700629 #Check after reboot that ONUs are active, authenticated/DHCP/pingable
630 Run Keyword If ${has_dataplane} Clean Up Linux
631 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
632
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700633Verify restart ofagent container before subscriber is provisioned
634 [Documentation] Restart ofagent container before subscriber is provisioned.
635 [Tags] functional VOL-2962 ofagentRestart2
636 [Setup] Start Logging ofagentRestart2
637 [Teardown] Run Keywords Collect Logs
Suchitra Vemuri8130be82020-09-15 16:47:58 -0700638 ... AND Stop Logging ofagentRestart2
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000639 ... AND Scale K8s Deployment ${NAMESPACE} ${NAMESPACE}-voltha-ofagent 1
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800640 Delete All Devices And Verify
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700641 setup
642 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800643 FOR ${I} IN RANGE 0 ${olt_count}
644 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
645 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
646 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
647 ... ${olt_serial_number}
648 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
649 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
650 END
651 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700652 ${src}= Set Variable ${hosts.src[${I}]}
653 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800654 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700655 ${onu_device_id}= Get Device ID From SN ${src['onu']}
656 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000657 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700658 # Bring up the device and verify it authenticates
659 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000660 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700661 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
662 ... ${ONOS_SSH_PORT} ${onu_port}
663 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
664 ... /tmp/wpa ${src['dp_iface_name']} log
665 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
666 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
667 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
668 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
669 ... ${ONOS_SSH_PORT} ${onu_port}
670 END
671 # Restart POD ofagent
672 ${waitforRestart} Set Variable 120s
673 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
674 Log ${podStatusOutput}
675 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
676 ${podName} Set Variable ofagent
677 Restart Pod ${NAMESPACE} ${podName}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700678 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
679 ... Running
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800680 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700681 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000682 #Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700683 #... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
684 ${src}= Set Variable ${hosts.src[${I}]}
685 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800686 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700687 ${onu_device_id}= Get Device ID From SN ${src['onu']}
688 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000689 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700690 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000691 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700692 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
693 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
694 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
695 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
696 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
697 ... ${dst['container_name']}
698 # Verify DHCP-Allocations
699 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
700 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700701 END
702
Hardik Windlassc082c422021-03-16 15:44:10 +0000703Verify OLT Grpc Disconnection
704 [Documentation] Restarts OLT Grpc Server and verifies everything works as before without any system disruption.
705 [Tags] functional VOL-3904 restartGrpcServer bbsim
706 [Setup] Start Logging restartGrpcServer
707 [Teardown] Run Keywords Collect Logs
708 ... AND Stop Logging restartGrpcServer
709 Delete All Devices And Verify
710 Setup
711 Run Keyword If ${has_dataplane} Clean Up Linux
712 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
713 FOR ${J} IN RANGE 0 ${num_olts}
714 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
715 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
716 Restart Grpc Server ${NAMESPACE} ${bbsim_pod} 5
717 END
718 # Repeat sanity test without subscriber changes
719 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test True
720 # Additional Verification
721 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
722 Setup
723 Run Keyword If ${has_dataplane} Clean Up Linux
724 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
725
Hema123aff52020-05-26 15:41:47 +0530726Verify ONU Soft Reboot
727 [Documentation] Test soft reboot of the ONU using voltctl command
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800728 [Tags] VOL-1957 ONUSoftReboot functional notready
Hema123aff52020-05-26 15:41:47 +0530729 [Setup] Start Logging ONUSoftReboot
730 #... AND Setup
Andy Bavier4a8450e2020-02-04 08:58:37 -0700731 [Teardown] Run Keywords Collect Logs
Hema123aff52020-05-26 15:41:47 +0530732 ... AND Stop Logging ONUSoftReboot
733 #... AND Delete Device and Verify
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800734 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000735 ${src}= Set Variable ${hosts.src[${I}]}
736 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800737 ${of_id}= Get ofID From OLT List ${src['olt']}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000738 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800739 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
740 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hema123aff52020-05-26 15:41:47 +0530741 Reboot Device ${onu_device_id}
742 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
743 ... Wait Until Keyword Succeeds 60s 2s
744 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
745 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
746 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000747 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hema123aff52020-05-26 15:41:47 +0530748 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800749 Verify ping is succesful except for given device ${num_all_onus} ${onu_device_id}
Hema123aff52020-05-26 15:41:47 +0530750 Sleep 40s
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800751 # Check ONU port is Enabled in ONOS
752 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000753 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800754 # Verify EAPOL flows are added for the ONU port
755 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800756 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800757 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700758 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800759 ... ENABLED ACTIVE REACHABLE
760 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hema123aff52020-05-26 15:41:47 +0530761 Run Keyword If ${has_dataplane} Clean Up Linux
762 # Perform Authentication
763 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
764 ... /tmp/wpa ${src['dp_iface_name']} log
765 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
766 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
767 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
768 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
769 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
770 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000771 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hema123aff52020-05-26 15:41:47 +0530772 ... volt-add-subscriber-access ${of_id} ${onu_port}
773 # Verify that no pending flows exist for the ONU port
774 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
775 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530776 # Verify subscriber access flows are added for the ONU port
777 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
778 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
779 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hema123aff52020-05-26 15:41:47 +0530780 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
781 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800782 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hema123aff52020-05-26 15:41:47 +0530783 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
784 ... ${dst['container_name']}
785 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
786 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000787 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800788
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800789
790*** Keywords ***
791Setup Suite
792 [Documentation] Set up the test suite
793 Common Test Suite Setup
HungWei Chiu1408fb92020-03-03 19:43:30 -0500794 #power_switch.robot needs it to support different vendor's power switch
Hung-Wei Chiufcc6d8e2020-03-10 12:05:11 -0700795 ${switch_type}= Get Variable Value ${web_power_switch.type}
796 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800797
798Clear All Devices Then Create New Device
799 [Documentation] Remove any devices from VOLTHA and ONOS
800 # Remove all devices from voltha and nos
801 Delete All Devices and Verify
802 # Execute normal test Setup Keyword
803 Setup
TorstenThieme4e2168e2021-06-22 14:01:47 +0000804
805Teardown Suite
806 [Documentation] Clean up ONOS SSH connections
807 Close All ONOS SSH Connections