blob: b92cd447aea986409ce3b1a14f4ba133476dbbe4 [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
20#Suite Teardown Teardown Suite
21Library 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
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000034
35*** Variables ***
36${POD_NAME} flex-ocp-cord
37${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
38${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
39#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
40${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
41${HELM_CHARTS_DIR} ~/helm-charts
42${VOLTHA_POD_NUM} 8
43${NAMESPACE} voltha
Suchitra Vemurica1c5d32020-04-09 18:45:29 -070044${DEFAULTSPACE} default
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000045# For below variable value, using deployment name as using grep for
46# parsing radius pod name, we can also use full radius pod name
47${RESTART_POD_NAME} radius
48${timeout} 60s
49${of_id} 0
50${logical_id} 0
Suchitra Vemuri109feb12020-01-23 16:25:02 -080051${has_dataplane} True
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000052${teardown_device} False
53${scripts} ../../scripts
54
Andy Bavierabeba262020-02-07 16:22:16 -070055# Per-test logging on failure is turned off by default; set this variable to enable
56${container_log_dir} ${None}
57
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000058*** Test Cases ***
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080059Verify ONU after rebooting physically
60 [Documentation] Test the ONU functionality by physically turning on/off ONU.
61 ... Prerequisite : Subscriber are authenticated/DHCP/pingable state
62 ... Test case runs only on the PODs that are configured with PowerSwitch that
63 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
64 ... VOL-2634
65 [Tags] functional PowerSwitch
Andy Baviere187eda2020-04-20 15:00:02 -070066 [Setup] Start Logging ONUreboot_PowerSwitch
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080067 [Teardown] Run Keywords Collect Logs
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -080068 ... AND Stop Logging ONUreboot_PowerSwitch
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080069 ... AND Delete All Devices and Verify
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080070 # Add OLT device
71 setup
72 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
73 Run Keyword If ${has_dataplane} Clean Up Linux
74 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
75 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080076 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080077 ${src}= Set Variable ${hosts.src[${I}]}
78 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080079 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass0560f802020-05-06 23:06:53 +053080 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080081 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
82 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
83 Disable Switch Outlet ${src['power_switch_port']}
84 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
85 ... Wait Until Keyword Succeeds 60s 2s
86 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
87 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +053088 # Remove Subscriber Access (To replicate ATT workflow)
89 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
90 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080091
92 Enable Switch Outlet ${src['power_switch_port']}
93 # Check ONU port is Enabled in ONOS
94 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -070095 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080096 # Verify EAPOL flows are added for the ONU port
97 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -080098 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -080099 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700100 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800101 ... ENABLED ACTIVE REACHABLE
102 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlass7c801e62020-05-04 19:33:21 +0530103 Run Keyword If ${has_dataplane} Clean Up Linux
104 # Perform Authentication
105 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
106 ... /tmp/wpa ${src['dp_iface_name']} log
107 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
108 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
109 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
110 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
111 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
112 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
113 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
114 ... volt-add-subscriber-access ${of_id} ${onu_port}
115 # Verify that no pending flows exist for the ONU port
116 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
117 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530118 # Verify subscriber access flows are added for the ONU port
119 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
120 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
121 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530122 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
123 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800124 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530125 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
126 ... ${dst['container_name']}
127 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
128 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800129 END
Suchitra Vemurid7096132020-02-21 14:50:47 -0800130 # Deleting OLT after tests completes independently (as this test doesn't not run on each POD)
Suchitra Vemuri0656bc22020-03-21 19:07:49 -0700131 #Run Keyword If ${has_dataplane} Delete Device and Verify
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800132
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700133Verify OLT after rebooting physically
134 [Documentation] Test the physical reboot of the OLT
135 ... Prerequisite : Subscriber are authenticated/DHCP/pingable state
136 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
137 ... VOL-1956
138 [Tags] functional PhysicalOLTReboot
Andy Baviere187eda2020-04-20 15:00:02 -0700139 [Setup] Start Logging PhysicalOLTReboot
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700140 [Teardown] Run Keywords Collect Logs
141 ... AND Stop Logging PhysicalOLTReboot
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800142 ... AND Delete All Devices and Verify
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700143 # Add OLT device
144 setup
145 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
146 Run Keyword If ${has_dataplane} Clean Up Linux
147 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
148 # Reboot the OLT from the OLT CLI
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800149 FOR ${I} IN RANGE 0 ${olt_count}
150 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
151 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
152 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
153 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
154 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
155 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
Andrea Campanella5ef88142021-02-02 14:34:50 +0100156 ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=#
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800157 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800158 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700159 ${src}= Set Variable ${hosts.src[${I}]}
160 ${dst}= Set Variable ${hosts.dst[${I}]}
161 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
162 ... Wait Until Keyword Succeeds 60s 2s
163 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
164 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
165 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800166 # Wait for the OLTs to come back up
167 FOR ${I} IN RANGE 0 ${olt_count}
168 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
169 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
170 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
171 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
172 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
173 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
174 ... Check Remote System Reachability True ${olt_ssh_ip}
175 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
176 ... Validate OLT Device ENABLED ACTIVE
177 ... REACHABLE ${olt_serial_number}
178 END
Suchitra Vemuri64db9652020-03-22 21:11:13 -0700179 # Waiting extra time for the ONUs to come up
180 Sleep 60s
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700181 Run Keyword If ${has_dataplane} Clean Up Linux
182 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
183 # Deleting OLT after test completes
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800184 #Run Keyword If ${has_dataplane} Delete All Devices and Verify
Suchitra Vemuri784e1ae2020-03-16 18:40:25 -0700185
Suchitra Vemuri05180cb2020-03-26 13:13:27 -0700186Verify restart openolt-adapter container after subscriber provisioning
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800187 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
188 ... Prerequisite : ONUs are authenticated and pingable.
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800189 [Tags] functional VOL-1958 Restart-OpenOlt released
Andy Baviere187eda2020-04-20 15:00:02 -0700190 [Setup] Start Logging Restart-OpenOlt
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800191 [Teardown] Run Keywords Collect Logs
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800192 ... AND Stop Logging Restart-OpenOlt
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800193 # Add OLT device
194 setup
195 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
196 Run Keyword If ${has_dataplane} Clean Up Linux
197 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
198 ${waitforRestart} Set Variable 120s
199 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
200 Log ${podStatusOutput}
201 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Andrea Campanella3dcce272021-01-15 16:04:47 +0100202 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530203 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
204 Sleep 5s
205 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
206 ... app ${podName} Running
Suchitra Vemuri312bfe02020-03-16 16:11:34 -0700207 # Wait for 1min after openolt adapter is restarted
208 Sleep 60s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800209 Run Keyword If ${has_dataplane} Clean Up Linux
210 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800211 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
212 Log ${podStatusOutput}
213 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
214 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
215 Log to console Pod ${podName} restarted and sanity checks passed successfully
Suchitra Vemuri60be98b2020-02-19 16:41:21 -0800216
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800217Check OLT/ONU Authentication After Radius Pod Restart
218 [Documentation] After radius restart, triggers reassociation, checks status and
219 ... authentication, validates dhcp and ping. Note : wpa reassociate works only when
220 ... wpa supplicant is running in background hence it is recommended to remove
221 ... teardown from previous test or uncomment 'Teardown None'.
222 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
223 [Tags] functional RadiusRestart released
Andy Baviere187eda2020-04-20 15:00:02 -0700224 [Setup] Start Logging RadiusRestart
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800225 [Teardown] Run Keywords Collect Logs
226 ... AND Stop Logging RadiusRestart
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800227 ${waitforRestart} Set Variable 120s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530228 ${podName} Set Variable radius
229 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${DEFAULTSPACE} app ${podName}
230 Sleep 5s
231 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pods Status By Label ${DEFAULTSPACE}
232 ... app ${podName} Running
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800233 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800234 ${src}= Set Variable ${hosts.src[${I}]}
235 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800236 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800237 ${onu_device_id}= Get Device ID From SN ${src['onu']}
238 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
239 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
240 Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800241 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800242 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
243 ... Validate Authentication After Reassociate True ${src['dp_iface_name']}
244 ... ${src['ip']} ${src['user']} ${src['pass']}
245 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800246 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800247 ... ${ONOS_SSH_PORT} ${onu_port}
248 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
249 ... Validate DHCP and Ping True True ${src['dp_iface_name']}
250 ... ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
251 ... ${src['ip']} ${src['user']} ${src['pass']}
252 ... ${src['container_type']} ${src['container_name']}
253 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']}
254 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
255 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
ubuntu6b6e7d42020-03-02 12:35:42 -0800256 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800257 END
258
Suchitra Vemuri05180cb2020-03-26 13:13:27 -0700259Verify openolt adapter restart before subscriber provisioning
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800260 [Documentation] Deploys an device instance and waits for it to authenticate. After
261 ... authentication is successful the rw-core deployment is scaled to 0 instances to
262 ... simulate a POD crash. The test then scales the rw-core back to a single instance
263 ... and configures ONOS for access. The test succeeds if the device is able to
264 ... complete the DHCP sequence.
Hung-Wei Chiud3576762020-03-25 18:06:26 -0700265 [Tags] functional olt-adapter-restart
Andy Baviere187eda2020-04-20 15:00:02 -0700266 [Setup] Start Logging OltAdapterRestart
Suchitra Vemuria0c086f2020-03-29 19:14:13 -0700267 #... AND Clear All Devices Then Create New Device
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800268 [Teardown] Run Keywords Collect Logs
269 ... AND Stop Logging OltAdapterRestart
Hung-Wei Chiud3576762020-03-25 18:06:26 -0700270 # Add OLT and perform sanity test
Suchitra Vemuri59ad2772020-03-26 22:27:27 -0700271 #setup
Suchitra Vemuri91537c82020-03-29 15:03:26 -0700272 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri59ad2772020-03-26 22:27:27 -0700273 #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800274 #Set Global Variable ${of_id}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800275
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800276 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800277 ${src}= Set Variable ${hosts.src[${I}]}
278 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800279 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800280 ${onu_device_id}= Get Device ID From SN ${src['onu']}
281 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
282 ... ${of_id}
283
284 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700285 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800286 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed
ubuntu6b6e7d42020-03-02 12:35:42 -0800287 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800288 ... ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier84834d42020-02-25 13:49:50 -0700289 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
290 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800291 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
292 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700293 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
ubuntu6b6e7d42020-03-02 12:35:42 -0800294 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800295 ... ${ONOS_SSH_PORT} ${onu_port}
296 END
297 # 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 +0100298 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 0
299 Wait Until Keyword Succeeds ${timeout} 2s Pods Do Not Exist By Label ${NAMESPACE} app
300 ... ${OLT_ADAPTER_APP_LABEL}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800301 # 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 +0100302 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800303 Wait Until Keyword Succeeds ${timeout} 2s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100304 ... Check Expected Available Deployment Replicas By Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800305
306 # Ensure the device is available in ONOS, this represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800307 FOR ${I} IN RANGE 0 ${olt_count}
308 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
309 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
310 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
311 ... ${olt_serial_number}
312 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
313 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
314 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800315
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800316 FOR ${I} IN RANGE 0 ${num_all_onus}
317 ${src}= Set Variable ${hosts.src[${I}]}
318 ${dst}= Set Variable ${hosts.dst[${I}]}
319 ${of_id}= Get ofID From OLT List ${src['olt']}
320 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
321 ... ${of_id}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800322 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
ubuntu6b6e7d42020-03-02 12:35:42 -0800323 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800324 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530325 # Verify subscriber access flows are added for the ONU port
326 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
327 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
328 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800329 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
330 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
331 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
332 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
333 ... ${dst['container_name']}
334 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
ubuntu6b6e7d42020-03-02 12:35:42 -0800335 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800336 END
337
hwchiu14c05102020-03-27 00:44:30 +0000338Verify restart ofagent container after subscriber is provisioned
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000339 [Documentation] Restart ofagent container after VOLTHA is operational.
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000340 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass7a846662020-03-19 20:42:59 +0530341 [Tags] functional VOL-2409 ofagentRestart
Andy Baviere187eda2020-04-20 15:00:02 -0700342 [Setup] Start Logging ofagentRestart
Andy Bavier4a8450e2020-02-04 08:58:37 -0700343 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700344 ... AND Stop Logging ofagentRestart
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530345 ... AND Scale K8s Deployment ${NAMESPACE} voltha-voltha-ofagent 1
Suchitra Vemuriceb002a2020-03-25 13:36:21 -0700346 # set timeout value
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000347 ${waitforRestart} Set Variable 120s
Andy Bavier4a8450e2020-02-04 08:58:37 -0700348 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000349 Log ${podStatusOutput}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700350 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530351 ${podName} Set Variable ofagent
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530352 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000353 Sleep 60s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530354 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
355 ... app ${podName} Running
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530356 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
357 Run Keyword If ${has_dataplane} Clean Up Linux
358 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Andy Bavier4a8450e2020-02-04 08:58:37 -0700359 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000360 Log ${podStatusOutput}
Andy Bavier4a8450e2020-02-04 08:58:37 -0700361 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000362 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530363 # Scale Down the Of-Agent Deployment
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530364 Scale K8s Deployment ${NAMESPACE} voltha-voltha-ofagent 0
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530365 Sleep 30s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800366 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530367 ${src}= Set Variable ${hosts.src[${I}]}
368 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800369 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530370 ${onu_device_id}= Get Device ID From SN ${src['onu']}
371 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
372 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
373 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700374 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530375 ... ENABLED ACTIVE REACHABLE
376 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
377 # Check ONU port is Disabled in ONOS
378 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700379 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530380 # Verify EAPOL flows are present for the ONU port
381 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
382 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
383 # Verify ONU in AAA-Users
384 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
385 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
386 # Verify DHCP-Allocations
387 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
388 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530389 # Verify subscriber access flows are added for the ONU port
390 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
391 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
392 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530393 # Verify Ping
394 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True
395 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
396 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530397 END
398 # Scale Up the Of-Agent Deployment
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530399 Scale K8s Deployment ${NAMESPACE} voltha-voltha-ofagent 1
Hardik Windlass8f2aadc2020-03-16 20:16:39 +0530400 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
401 ... Running
402 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
403 Run Keyword If ${has_dataplane} Clean Up Linux
404 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
405 Log to console Pod ${podName} restarted and sanity checks passed successfully
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000406
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000407Check ONU adapter crash not forcing authentication again
408 [Documentation] After ONU adapter restart, checks wpa log for 'authentication started'
409 ... message count to make sure auth not started again and validates EAP status and ping.
410 ... Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable
hwchiu14c05102020-03-27 00:44:30 +0000411 [Tags] functional ONUAdaptCrash
Andy Baviere187eda2020-04-20 15:00:02 -0700412 [Setup] Start Logging ONUAdaptCrash
Andy Bavierabeba262020-02-07 16:22:16 -0700413 [Teardown] Run Keywords Collect Logs
414 ... AND Stop Logging ONUAdaptCrash
hwchiu14c05102020-03-27 00:44:30 +0000415 # Wait for adapter to resync
416 Sleep 60s
417 # Restart the onu
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530418 ${podName} Set Variable adapter-open-onu
Hung-Wei Chiu2bee4d42020-04-24 11:31:50 -0700419 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
hwchiu14c05102020-03-27 00:44:30 +0000420 # Validate ONU Ports
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800421 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000422 ${src}= Set Variable ${hosts.src[${I}]}
423 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800424 ${of_id}= Get ofID From OLT List ${src['olt']}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000425 ${onu_device_id}= Get Device ID From SN ${src['onu']}
426 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
427 ... ${of_id}
hwchiu14c05102020-03-27 00:44:30 +0000428 Run Keyword And Continue On Failure Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700429 ... ${src['onu']}
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000430 ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System
431 ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']}
432 ... ${src['container_type']} ${src['container_name']}
433 Run Keyword If ${has_dataplane} Should Contain ${output} SUCCESS
Gayathri.Selvanc0b37022020-02-06 05:17:00 +0000434 END
Hung-Wei Chiu2bee4d42020-04-24 11:31:50 -0700435 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
436 ... app ${podName} Running
hwchiu14c05102020-03-27 00:44:30 +0000437 # Wait for adapter to resync
438 Sleep 60s
Andy Bavier8da0e132020-04-13 10:25:16 -0700439 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800440 # Validate OLTs are active in ONOS
441 FOR ${I} IN RANGE 0 ${olt_count}
442 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
443 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
444 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
445 ... ${olt_serial_number}
446 END
hwchiu14c05102020-03-27 00:44:30 +0000447 # Perform all steps in Sanity Test except the subscriber addition
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800448 FOR ${I} IN RANGE 0 ${num_all_onus}
hwchiu14c05102020-03-27 00:44:30 +0000449 ${src}= Set Variable ${hosts.src[${I}]}
450 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800451 ${of_id}= Get ofID From OLT List ${src['olt']}
hwchiu14c05102020-03-27 00:44:30 +0000452 ${onu_device_id}= Get Device ID From SN ${src['onu']}
453 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
454 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
455 # Check ONU port is Enabled in ONOS
456 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700457 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
hwchiu14c05102020-03-27 00:44:30 +0000458 # Verify EAPOL flows are added for the ONU port
459 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
460 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
461 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700462 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
hwchiu14c05102020-03-27 00:44:30 +0000463 ... ENABLED ACTIVE REACHABLE
464 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
465 # Perform Authentication
466 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
467 ... /tmp/wpa ${src['dp_iface_name']} log
468 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
469 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
470 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
471 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
472 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
473 # Verify that no pending flows exist for the ONU port
474 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
475 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530476 # Verify subscriber access flows are added for the ONU port
477 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
478 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
479 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
hwchiu14c05102020-03-27 00:44:30 +0000480 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
481 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
482 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
483 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
484 ... ${dst['container_name']}
485 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
486 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
hwchiu14c05102020-03-27 00:44:30 +0000487 END
488
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700489Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart
490 [Documentation] Deploys an device instance and waits for it to authenticate. After
491 ... authentication is successful the rw-core deployment is scaled to 0 instances to
492 ... simulate a POD crash. The test then scales the rw-core back to a single instance
493 ... and configures ONOS for access. The test succeeds if the device is able to
494 ... complete the DHCP sequence.
495 [Tags] functional rwcore-restart
Andy Baviere187eda2020-04-20 15:00:02 -0700496 [Setup] Run Keywords Start Logging RwCoreFailAndRestart
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700497 ... AND Clear All Devices Then Create New Device
498 [Teardown] Run Keywords Collect Logs
499 ... AND Stop Logging RwCoreFailAndRestart
Suchitra Vemuri5d3383f2020-04-03 11:02:26 -0700500 #... AND Delete Device and Verify
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700501 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800502 FOR ${I} IN RANGE 0 ${olt_count}
503 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
504 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
505 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
506 ... ${olt_serial_number}
507 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
508 ... Get NNI Port in ONOS ${of_id}
509 # Set Global Variable ${nni_port}
510 END
511 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700512 ${src}= Set Variable ${hosts.src[${I}]}
513 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800514 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700515 ${onu_device_id}= Get Device ID From SN ${src['onu']}
516 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
517 ... ${of_id}
518 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700519 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700520 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed
521 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
522 ... ${ONOS_SSH_PORT} ${onu_port}
523 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
524 ... /tmp/wpa ${src['dp_iface_name']} log
525 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
526 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
527 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
528 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
529 ... ${ONOS_SSH_PORT} ${onu_port}
530 END
531
532 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530533 Scale K8s Deployment voltha voltha-voltha-rw-core 0
534 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-voltha-rw-core
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700535 # Ensure the ofagent POD goes "not-ready" as expected
536 Wait Until keyword Succeeds ${timeout} 2s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530537 ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 0
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700538 # Scale up the core deployment and make sure both it and the ofagent deployment are back
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530539 Scale K8s Deployment voltha voltha-voltha-rw-core 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700540 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530541 ... Check Expected Available Deployment Replicas voltha voltha-voltha-rw-core 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700542 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530543 ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 1
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700544 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
545 # so restart the port forwarding for the API service
David Bainbridge07321ff2020-06-12 13:55:42 -0700546 Restart VOLTHA Port Forward voltha-api
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700547 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
548 # represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800549 FOR ${I} IN RANGE 0 ${olt_count}
550 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
551 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
552 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
553 ... ${olt_serial_number}
554 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
555 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
556 END
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700557
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800558 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier52094622020-05-12 15:54:24 -0700559 ${src}= Set Variable ${hosts.src[${I}]}
560 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800561 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier52094622020-05-12 15:54:24 -0700562 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
563 ... ${of_id}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700564 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
565 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
566 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530567 # Verify subscriber access flows are added for the ONU port
568 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
569 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
570 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuriebf65322020-04-03 10:09:41 -0700571 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
572 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
573 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
574 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
575 ... ${dst['container_name']}
576 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
577 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
578 END
579
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700580Verify OLT Soft Reboot
581 [Documentation] Test soft reboot of the OLT using voltctl command
582 [Tags] VOL-2745 OLTSoftReboot functional
583 [Setup] Start Logging OLTSoftReboot
584 [Teardown] Run Keywords Collect Logs
585 ... AND Stop Logging OLTSoftReboot
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800586 FOR ${I} IN RANGE 0 ${olt_count}
587 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
588 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
589 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
590 ... Validate OLT Device ENABLED ACTIVE
591 ... REACHABLE ${olt_serial_number}
592 # Reboot the OLT using "voltctl device reboot" command
593 Reboot Device ${olt_device_id}
594 END
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700595 #Verify that ping fails
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800596 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700597 ${src}= Set Variable ${hosts.src[${I}]}
598 ${dst}= Set Variable ${hosts.dst[${I}]}
599 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
600 ... Wait Until Keyword Succeeds 60s 2s
601 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
602 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
603 END
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700604 # Check OLT states
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800605 FOR ${I} IN RANGE 0 ${olt_count}
606 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
607 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
608 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
609 # Wait for the OLT to come back up
610 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
611 ... Check Remote System Reachability True ${olt_ssh_ip}
612 # Check OLT states
613 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
614 ... Validate OLT Device ENABLED ACTIVE
615 ... REACHABLE ${olt_serial_number}
616 END
617 # Waiting extra time for the ONUs to come up
618 Sleep 60s
Suchitra Vemuri19e942f2020-08-11 18:04:28 -0700619 #Check after reboot that ONUs are active, authenticated/DHCP/pingable
620 Run Keyword If ${has_dataplane} Clean Up Linux
621 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
622
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700623Verify restart ofagent container before subscriber is provisioned
624 [Documentation] Restart ofagent container before subscriber is provisioned.
625 [Tags] functional VOL-2962 ofagentRestart2
626 [Setup] Start Logging ofagentRestart2
627 [Teardown] Run Keywords Collect Logs
Suchitra Vemuri8130be82020-09-15 16:47:58 -0700628 ... AND Stop Logging ofagentRestart2
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700629 ... AND Scale K8s Deployment ${NAMESPACE} voltha-voltha-ofagent 1
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800630 Delete All Devices And Verify
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700631 setup
632 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800633 FOR ${I} IN RANGE 0 ${olt_count}
634 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
635 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
636 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
637 ... ${olt_serial_number}
638 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
639 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
640 END
641 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700642 ${src}= Set Variable ${hosts.src[${I}]}
643 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800644 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700645 ${onu_device_id}= Get Device ID From SN ${src['onu']}
646 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
647 ... ${of_id}
648 # Bring up the device and verify it authenticates
649 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
650 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed
651 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
652 ... ${ONOS_SSH_PORT} ${onu_port}
653 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
654 ... /tmp/wpa ${src['dp_iface_name']} log
655 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
656 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
657 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
658 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
659 ... ${ONOS_SSH_PORT} ${onu_port}
660 END
661 # Restart POD ofagent
662 ${waitforRestart} Set Variable 120s
663 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
664 Log ${podStatusOutput}
665 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
666 ${podName} Set Variable ofagent
667 Restart Pod ${NAMESPACE} ${podName}
668 Sleep 60s
669 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
670 ... Running
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800671 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700672 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
673 #Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
674 #... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
675 ${src}= Set Variable ${hosts.src[${I}]}
676 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800677 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700678 ${onu_device_id}= Get Device ID From SN ${src['onu']}
679 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
680 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
681 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
682 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
683 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
684 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
685 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
686 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
687 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
688 ... ${dst['container_name']}
689 # Verify DHCP-Allocations
690 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
691 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri10e737e2020-08-14 14:59:10 -0700692 END
693
Hema123aff52020-05-26 15:41:47 +0530694Verify ONU Soft Reboot
695 [Documentation] Test soft reboot of the ONU using voltctl command
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800696 [Tags] VOL-1957 ONUSoftReboot functional notready
Hema123aff52020-05-26 15:41:47 +0530697 [Setup] Start Logging ONUSoftReboot
698 #... AND Setup
Andy Bavier4a8450e2020-02-04 08:58:37 -0700699 [Teardown] Run Keywords Collect Logs
Hema123aff52020-05-26 15:41:47 +0530700 ... AND Stop Logging ONUSoftReboot
701 #... AND Delete Device and Verify
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800702 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000703 ${src}= Set Variable ${hosts.src[${I}]}
704 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800705 ${of_id}= Get ofID From OLT List ${src['olt']}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000706 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800707 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
708 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hema123aff52020-05-26 15:41:47 +0530709 Reboot Device ${onu_device_id}
710 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
711 ... Wait Until Keyword Succeeds 60s 2s
712 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
713 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
714 # Remove Subscriber Access (To replicate ATT workflow)
715 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
716 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800717 Verify ping is succesful except for given device ${num_all_onus} ${onu_device_id}
Hema123aff52020-05-26 15:41:47 +0530718 Sleep 40s
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800719 # Check ONU port is Enabled in ONOS
720 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700721 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800722 # Verify EAPOL flows are added for the ONU port
723 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800724 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800725 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700726 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800727 ... ENABLED ACTIVE REACHABLE
728 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hema123aff52020-05-26 15:41:47 +0530729 Run Keyword If ${has_dataplane} Clean Up Linux
730 # Perform Authentication
731 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
732 ... /tmp/wpa ${src['dp_iface_name']} log
733 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
734 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
735 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
736 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
737 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
738 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
739 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
740 ... volt-add-subscriber-access ${of_id} ${onu_port}
741 # Verify that no pending flows exist for the ONU port
742 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
743 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530744 # Verify subscriber access flows are added for the ONU port
745 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
746 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
747 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hema123aff52020-05-26 15:41:47 +0530748 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
749 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuricd2f64f2020-02-18 18:30:27 -0800750 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hema123aff52020-05-26 15:41:47 +0530751 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
752 ... ${dst['container_name']}
753 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
754 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000755 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800756
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800757
758*** Keywords ***
759Setup Suite
760 [Documentation] Set up the test suite
761 Common Test Suite Setup
HungWei Chiu1408fb92020-03-03 19:43:30 -0500762 #power_switch.robot needs it to support different vendor's power switch
Hung-Wei Chiufcc6d8e2020-03-10 12:05:11 -0700763 ${switch_type}= Get Variable Value ${web_power_switch.type}
764 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800765
766Clear All Devices Then Create New Device
767 [Documentation] Remove any devices from VOLTHA and ONOS
768 # Remove all devices from voltha and nos
769 Delete All Devices and Verify
770 # Execute normal test Setup Keyword
771 Setup