blob: b1ae69fafe4d9034432216de0dc50fd87aebe560 [file] [log] [blame]
Hardik Windlassa3d04b92020-02-17 15:06:05 +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.
14# FIXME Can we use the same test against BBSim and Hardware?
15
16*** Settings ***
17Documentation Test various end-to-end scenarios
18Suite Setup Setup Suite
19Test Setup Setup
20Test Teardown Teardown
21Suite Teardown Teardown Suite
22Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
27Library ../../libraries/DependencyLibrary.py
28Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
30Resource ../../libraries/voltha.robot
31Resource ../../libraries/utils.robot
32Resource ../../libraries/k8s.robot
33Resource ../../variables/variables.robot
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070034Resource ../../libraries/power_switch.robot
Hardik Windlassa3d04b92020-02-17 15:06:05 +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
Hardik Windlass4288c6a2021-09-28 07:22:06 +000045${INFRA_NAMESPACE} default
Hardik Windlassa3d04b92020-02-17 15:06:05 +000046# For below variable value, using deployment name as using grep for
47# parsing radius pod name, we can also use full radius pod name
48${RESTART_POD_NAME} radius
Hardik Windlass5d537ad2021-11-16 06:01:54 +000049${timeout} 60s
Hardik Windlassa3d04b92020-02-17 15:06:05 +000050${of_id} 0
51${logical_id} 0
Andrea Campanella86e24062020-08-05 19:09:18 +020052${uprate} 0
53${dnrate} 0
Hardik Windlassa3d04b92020-02-17 15:06:05 +000054${has_dataplane} True
Hardik Windlassffbf0602020-04-24 23:14:45 +053055${teardown_device} True
Hardik Windlassa3d04b92020-02-17 15:06:05 +000056${scripts} ../../scripts
57
Andy Baviere19991a2020-05-08 10:42:40 -070058# For dataplane bandwidth testing
59${upper_margin_pct} 105 # Allow 5% over the limit
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080060${lower_margin_pct} 90 # Allow 8% under the limit
Andy Baviere19991a2020-05-08 10:42:40 -070061${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
Andy Bavierc80a2742020-08-28 10:59:05 -070062${udp_packet_bytes} 1470 # UDP payload in bytes
Andy Baviere19991a2020-05-08 10:42:40 -070063
Hardik Windlassa3d04b92020-02-17 15:06:05 +000064# Per-test logging on failure is turned off by default; set this variable to enable
65${container_log_dir} ${None}
66
Hardik Windlass43531332021-05-19 07:07:03 +000067# logging flag to enable Collect Logs, can be passed via the command line too
68# example: -v logging:False
69${logging} True
70
Hardik Windlass4ed54502021-05-14 07:34:15 +000071# Flag specific to Soak Jobs
72${SOAK_TEST} False
73${bbsim_port} 50060
74
Hardik Windlassa3d04b92020-02-17 15:06:05 +000075*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070076Reboot DT ONUs Physically
77 [Documentation] This test reboots ONUs physically before execution all the tests
78 ... Test case runs only on the PODs that are configured with PowerSwitch that
79 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
Suchitra Vemuri228f8802021-03-10 13:14:17 -080080 [Tags] functionalDt PowerSwitch RebootAllDTONUs soak
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070081 [Setup] Start Logging RebootAllDTONUs
Hardik Windlass43531332021-05-19 07:07:03 +000082 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070083 ... AND Stop Logging RebootAllDTONUs
84 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080085 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070086 ${src}= Set Variable ${hosts.src[${I}]}
87 ${dst}= Set Variable ${hosts.dst[${I}]}
88 Disable Switch Outlet ${src['power_switch_port']}
Hardik Windlass5e214b22021-02-26 10:37:14 +000089 Sleep 10s
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070090 Enable Switch Outlet ${src['power_switch_port']}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070091 END
92
Hardik Windlass4ed54502021-05-14 07:34:15 +000093Create Soak BBSim Device
94 [Documentation] This creates and enables the BBSim device as required by the soak testing
95 ... The BBSim OLT and ONUs created as part of this test are not part of active testing
96 ... but only to mock the load on Soak POD.
97 [Tags] soak
98 [Setup] Start Logging soakPodCreateBBSimLoad
Hardik Windlass43531332021-05-19 07:07:03 +000099 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass4ed54502021-05-14 07:34:15 +0000100 ... AND Stop Logging soakPodCreateBBSimLoad
101 ${num_bbsim} Get Length ${bbsim}
Hardik Windlassea4caf72021-07-30 07:22:12 +0000102 @{bbsim_olt_of_id_list}= Create List
Hardik Windlass4ed54502021-05-14 07:34:15 +0000103 FOR ${I} IN RANGE 0 ${num_bbsim}
104 ${ip} Evaluate ${bbsim}[${I}].get("ip")
105 ${serial_number} Evaluate ${bbsim}[${I}].get("serial")
106 ${bbsim_olt_device_id}= Create Device ${ip} ${bbsim_port}
107 Log ${bbsim_olt_device_id}
108 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass8b446492021-06-10 06:25:23 +0000109 ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${bbsim_olt_device_id} by_dev_id=True
Hardik Windlass4ed54502021-05-14 07:34:15 +0000110 Enable Device ${bbsim_olt_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000111 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass4ed54502021-05-14 07:34:15 +0000112 ... Validate OLT Device ENABLED ACTIVE REACHABLE ${serial_number}
Hardik Windlassea4caf72021-07-30 07:22:12 +0000113 ${bbsim_olt_of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
Hardik Windlass4ed54502021-05-14 07:34:15 +0000114 ... ${serial_number}
Hardik Windlassea4caf72021-07-30 07:22:12 +0000115 Log ${bbsim_olt_of_id}
116 Append To List ${bbsim_olt_of_id_list} ${bbsim_olt_of_id}
Hardik Windlass4ed54502021-05-14 07:34:15 +0000117 END
118 # Extra sleep time for ONUs to come up Active
Hardik Windlassea4caf72021-07-30 07:22:12 +0000119 Sleep 60s
120 FOR ${bbsim_olt_of_id} IN @{bbsim_olt_of_id_list}
121 Provision all subscribers on device ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${ONOS_SSH_IP} ${ONOS_REST_PORT}
122 ... ${bbsim_olt_of_id}
123 ${total_onus_per_bbsim_olt}= Count Enabled UNI Ports ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
124 ... ${bbsim_olt_of_id}
125 Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
126 ... ${bbsim_olt_of_id} dt ${total_onus_per_bbsim_olt} 1 true
127 ... false false false true
128 END
Hardik Windlass4ed54502021-05-14 07:34:15 +0000129
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000130Sanity E2E Test for OLT/ONU on POD for DT
131 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
132 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
133 ... Traffic sent with same vlan from different RGs,
134 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
135 ... Inner vlans from the RG should not change
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800136 [Tags] sanityDt soak
Hardik Windlass4ed54502021-05-14 07:34:15 +0000137 [Setup] Start Logging SanityTestDt
Hardik Windlass43531332021-05-19 07:07:03 +0000138 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000139 ... AND Stop Logging SanityTestDt
Hardik Windlass4ed54502021-05-14 07:34:15 +0000140 Setup ${SOAK_TEST}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000141 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000142 Perform Sanity Test DT
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000143
Hardik Windlass35706ba2020-02-20 08:16:42 +0000144Test Subscriber Delete and Add for DT
145 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
Hardik Windlass63d5e002020-03-06 21:07:09 +0530146 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000147 ... Delete a subscriber and validate that the pings do not succeed and state is purged
148 ... Disable and Enable the ONU (This is to replicate the existing DT behaviour)
149 ... Re-add the subscriber, and validate that the flows are present and pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800150 [Tags] functionalDt SubAddDeleteDt soak
Andy Baviere187eda2020-04-20 15:00:02 -0700151 [Setup] Start Logging SubAddDeleteDt
Hardik Windlass43531332021-05-19 07:07:03 +0000152 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass35706ba2020-02-20 08:16:42 +0000153 ... AND Stop Logging SubAddDeleteDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800154 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000155 ${src}= Set Variable ${hosts.src[${I}]}
156 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800157 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000158 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000159 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800160 ${olt_device_id}= Get OLTDeviceID From OLT List ${src['olt']}
Andrea Campanellad848de02020-11-24 10:23:41 +0100161 ${num_of_olt_onus}= Get Num of Onus From OLT SN ${src['olt']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000162 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
163 ... ${of_id}
164 # Remove Subscriber Access
TorstenThieme4e2168e2021-06-22 14:01:47 +0000165 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000166 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000167 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000168 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000169 ... 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']}
Andrea Campanellad848de02020-11-24 10:23:41 +0100171
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530172 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
Andrea Campanellad848de02020-11-24 10:23:41 +0100173 ${onos_flows_count}= Evaluate 4 * ( ${num_of_olt_onus} - 1 )
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530174 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
175 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Suchitra Vemuri93db32b2020-11-23 21:27:05 -0800176 ... ${of_id} ${onos_flows_count}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000177 # Verify VOLTHA flows for OLT equals twice the number of ONUS (minus ONU under test) + 1 for LLDP
Andrea Campanellad848de02020-11-24 10:23:41 +0100178 ${olt_flows}= Evaluate 2 * ( ${num_of_olt_onus} - 1 ) + 1
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000179 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows
180 ... ${olt_flows} ${olt_device_id}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000181 # Verify VOLTHA flows for ONU under test is Zero
182 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
183 ... ${onu_device_id} 0
184 # Disable and Re-Enable the ONU (To replicate DT current workflow)
185 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
186 Disable Device ${onu_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000187 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000188 ... Validate Device DISABLED UNKNOWN
189 ... REACHABLE ${src['onu']}
190 Enable Device ${onu_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000191 Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000192 ... Validate Device ENABLED ACTIVE
193 ... REACHABLE ${src['onu']}
194 # Add Subscriber Access
TorstenThieme4e2168e2021-06-22 14:01:47 +0000195 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000196 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530197 # Verify subscriber access flows are added for the ONU port
198 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530199 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
200 ... ${onu_port} ${nni_port} ${src['s_tag']}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000201 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000202 ... Validate Device ENABLED ACTIVE
203 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Girish Gowdrad2c0e9d2021-11-23 14:40:23 -0800204 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
205 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
206 # Workaround ends here for issue seen in VOL-4489.
Hardik Windlass35706ba2020-02-20 08:16:42 +0000207 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000208 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000209 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
210 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000211 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800212 # Verify flows for all OLTs
213 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
Hardik Windlass35706ba2020-02-20 08:16:42 +0000214
Hardik Windlass63d5e002020-03-06 21:07:09 +0530215Test Disable and Enable ONU for DT
216 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
217 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
218 ... Perform disable on the ONUs and validate that the pings do not succeed
219 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800220 [Tags] functionalDt DisableEnableONUDt soak
Andy Baviere187eda2020-04-20 15:00:02 -0700221 [Setup] Start Logging DisableEnableONUDt
Hardik Windlass43531332021-05-19 07:07:03 +0000222 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass63d5e002020-03-06 21:07:09 +0530223 ... AND Stop Logging DisableEnableONUDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800224 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530225 ${src}= Set Variable ${hosts.src[${I}]}
226 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800227 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530228 ${onu_device_id}= Get Device ID From SN ${src['onu']}
229 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
230 ... ${of_id}
231 Disable Device ${onu_device_id}
232 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
233 ... Validate Device DISABLED UNKNOWN
234 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000235 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000236 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530237 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530238 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000239 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530240 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
241 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
242 Sleep 5s
243 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700244 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530245 ... Validate Device ENABLED ACTIVE
246 ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000247 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000248 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Girish Gowdrac38824c2021-12-01 13:22:08 +0530249 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
250 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
251 # Workaround ends here for issue seen in VOL-4489.
Hardik Windlass63d5e002020-03-06 21:07:09 +0530252 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000253 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530254 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
255 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530256 END
257
Hardik Windlassaaea3402020-03-10 19:45:45 +0530258Test Disable and Delete OLT for DT
259 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
260 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
261 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
262 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Hardik Windlass43531332021-05-19 07:07:03 +0000263 [Tags] functionalDt DisableDeleteOLTDt soak
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700264 [Setup] Start Logging DisableDeleteOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000265 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlassaaea3402020-03-10 19:45:45 +0530266 ... AND Stop Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530267 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800268 FOR ${I} IN RANGE 0 ${olt_count}
269 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
270 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
271 Disable Device ${olt_device_id}
272 ${of_id}= Get ofID From OLT List ${olt_serial_number}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000273 Wait Until Keyword Succeeds ${timeout} 5s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800274 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
275 ... ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800276 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
277 # Validate ONUs
278 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
Andrea Campanella4e507882020-11-26 11:33:11 +0100279 ... ${num_onus} ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800280 # Verify ONOS Flows
Matteo Scandolo8b6dc262021-11-22 12:30:27 -0800281 # When we disable the device we shouldn't have any flows provisioned on it
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800282 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
283 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Matteo Scandolo8b6dc262021-11-22 12:30:27 -0800284 ... ${of_id} 0
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800285 # Verify VOLTHA Flows
Hardik Windlass3a294892021-11-23 17:05:29 +0000286 # OLT should only have 1 default flow for LLDP
287 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows 1
Matteo Scandolo8b6dc262021-11-22 12:30:27 -0800288 ... ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800289 ${List_ONU_Serial} Create List
290 Set Suite Variable ${List_ONU_Serial}
Andrea Campanella99a548b2020-11-18 09:50:32 +0100291 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} ${num_onus}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800292 Log ${List_ONU_Serial}
293 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
Matteo Scandolo8b6dc262021-11-22 12:30:27 -0800294 ... ${List_ONU_Serial} 0
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800295 # Delete OLT and Validate Empty Device List
296 Delete Device ${olt_device_id}
Andrea Campanella4e507882020-11-26 11:33:11 +0100297 # Check that the OLT and the ONUs are actually removed from the system
298 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed
299 ... ${olt_serial_number}
300 Run Keyword and Continue On Failure Validate all ONUS for OLT Removed ${num_all_onus} ${hosts}
301 ... ${olt_serial_number} ${timeout}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000302 Wait Until Keyword Succeeds ${timeout} 5s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800303 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800304 END
Hardik Windlassaaea3402020-03-10 19:45:45 +0530305 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Hardik Windlass43531332021-05-19 07:07:03 +0000306 Run Keyword Setup ${SOAK_TEST}
Suchitra Vemuriae9cecb2020-03-12 12:59:14 -0700307 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000308 Perform Sanity Test DT
Hardik Windlassaaea3402020-03-10 19:45:45 +0530309
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530310Test Disable and Enable OLT for DT
311 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
312 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
313 ... Perform disable on the OLT and validate that the pings do not succeed
314 ... Perform enable on the OLT and validate that the pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800315 [Tags] functionalDt DisableEnableOLTDt soak
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530316 [Setup] Start Logging DisableEnableOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000317 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530318 ... AND Stop Logging DisableEnableOLTDt
319 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800320 FOR ${I} IN RANGE 0 ${olt_count}
321 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
322 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
323 ${rc} ${output}= Run and Return Rc and Output
324 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
325 Should Be Equal As Integers ${rc} 0
326 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
327 ... ${olt_serial_number}
328 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800329 # Validate ONUs
330 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530331 ${src}= Set Variable ${hosts.src[${I}]}
332 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800333 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530334 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000335 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass7c801e62020-05-04 19:33:21 +0530336 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000337 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000338 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530339 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000340 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass7c801e62020-05-04 19:33:21 +0530341 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
342 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
343 # Remove Subscriber Access (To replicate DT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000344 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530345 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
346 # Delete ONU Device (To replicate DT workflow)
347 Delete Device ${onu_device_id}
348 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530349 Sleep 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530350 # Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800351 FOR ${I} IN RANGE 0 ${olt_count}
352 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
353 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
354 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800355 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
356 ... ${olt_serial_number}
357 #TODO: Update for PON_OLT ETHERNET_NNI
358 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
359 #... PON_OLT ETHERNET_NNI
360 END
Hardik Windlass7c801e62020-05-04 19:33:21 +0530361 # Waiting extra time for the ONUs to come up
362 Sleep 60s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800363 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000364 Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530365
366Test Delete and ReAdd OLT for DT
367 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
368 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
369 ... Disable and Delete the OLT
370 ... Create/Enable the same OLT again
371 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
Hardik Windlass43531332021-05-19 07:07:03 +0000372 [Tags] functionalDt DeleteReAddOLTDt soak
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530373 [Setup] Start Logging DeleteReAddOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000374 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530375 ... AND Stop Logging DeleteReAddOLTDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800376 FOR ${I} IN RANGE 0 ${olt_count}
377 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
378 ${of_id}= Get ofID From OLT List ${olt_serial_number}
379 Delete Device and Verify ${olt_serial_number}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000380 Wait Until Keyword Succeeds ${timeout} 5s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800381 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800382 END
383 # Recreate the OLTs
Hardik Windlass43531332021-05-19 07:07:03 +0000384 Setup ${SOAK_TEST}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800385 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000386 Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530387
388Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
389 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
390 ... This TC is to confirm that ONU removal is not impacting OLT
391 ... Devices will be removed during the execution of this TC
392 ... so calling setup at the end to add the devices back to avoid the confusion.
393 [Tags] functionalDt DisableDeleteONUOLTDt
394 [Setup] Start Logging DisableDeleteONUOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000395 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530396 ... AND Stop Logging DisableDeleteONUOLTDt
Suchitra Vemuri02170552021-03-23 16:40:50 -0700397 @{onu_reason}= Create List initial-mib-downloaded omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800398 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530399 ${src}= Set Variable ${hosts.src[${I}]}
400 ${dst}= Set Variable ${hosts.dst[${I}]}
401 ${onu_device_id}= Get Device ID From SN ${src['onu']}
402 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
403 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700404 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000405 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530406 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800407 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530408 Disable Device ${onu_device_id}
409 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
410 ... Validate Device DISABLED UNKNOWN
411 ... REACHABLE ${src['onu']} onu=false
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000412 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530413 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800414 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530415 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800416 # Disable all OLTs
417 FOR ${I} IN RANGE 0 ${olt_count}
418 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
419 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
420 ${rc} ${output}= Run and Return Rc and Output
421 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
422 Should Be Equal As Integers ${rc} 0
423 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
424 ... ${olt_serial_number}
425 END
426 # Validate ONUs after OLT disable
427 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530428 ${src}= Set Variable ${hosts.src[${I}]}
429 ${dst}= Set Variable ${hosts.dst[${I}]}
430 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000431 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530432 ... Validate Device DISABLED DISCOVERED
433 ... UNREACHABLE ${src['onu']} onu=false
434 Delete Device ${onu_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000435 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530436 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800437 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530438 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800439 # Delete all OLTs
440 Delete All Devices and Verify
441
442 #Delete Device ${olt_device_id}
443 #TODO: Fix the following assertion
444 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
445 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
446 #... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
447
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530448 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
449 Run Keyword Setup
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800450 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000451 Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530452
Andy Baviere19991a2020-05-08 10:42:40 -0700453Data plane verification using TCP for DT
454 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
455 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200456 [Tags] non-critical dataplaneDt BandwidthProfileTCPDt VOL-3061 soakDataplane
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700457 [Setup] Start Logging BandwidthProfileTCPDt
Hardik Windlass43531332021-05-19 07:07:03 +0000458 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700459 ... AND Stop Logging BandwidthProfileTCPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700460 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
461 ... physical pod. Skipping this test in BBSIM.
Hardik Windlass3280f2d2021-05-20 07:38:31 +0000462 Run Keyword If '${SOAK_TEST}'=='False' Clear All Devices Then Create New Device
Hardik Windlass62db9d92021-05-17 09:32:40 +0000463 ... ELSE Setup Soak
Suchitra Vemuria4e3e072020-11-06 14:23:47 -0800464 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000465 Perform Sanity Test DT
Suchitra Vemuria4e3e072020-11-06 14:23:47 -0800466
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800467 #${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
468 #... ${olt_serial_number}
469 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700470 ${src}= Set Variable ${hosts.src[${I}]}
471 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800472 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700473 # Check for iperf3 and jq tools
474 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
475 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
476 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
477
Andy Baviere19991a2020-05-08 10:42:40 -0700478 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
479 ... ${of_id}
480 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
481 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
482 ... upstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700483 ${us_cir} ${us_cbs} ${us_pir} ${us_pbs} ${us_gir}= Get Bandwidth Profile Details Ietf Rest
484 ... ${bandwidth_profile_name}
485 ${limiting_bw_value_upstream}= Set Variable If ${us_pir} != 0 ${us_pir} ${us_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700486 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
487 ... downstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700488 ${ds_cir} ${ds_cbs} ${ds_pir} ${ds_pbs} ${ds_gir}= Get Bandwidth Profile Details Ietf Rest
489 ... ${bandwidth_profile_name}
490 ${limiting_bw_value_dnstream}= Set Variable If ${ds_pir} != 0 ${ds_pir} ${ds_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700491
492 # Stream TCP packets from RG to server
493 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
494 ... args=-t 30
495 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
496
497 # Stream TCP packets from server to RG
498 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
499 ... args=-R -t 30
500 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
501
502 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
503 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
504 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
505 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
506
507 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
508 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700509 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
510 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
511 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700512 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
513 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
514 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
515 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
516 END
517
518Data plane verification using UDP for DT
519 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
520 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200521 [Tags] non-critical dataplaneDt BandwidthProfileUDPDt VOL-3061 soakDataplane
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700522 [Setup] Start Logging BandwidthProfileUDPDt
Hardik Windlass43531332021-05-19 07:07:03 +0000523 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700524 ... AND Stop Logging BandwidthProfileUDPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700525 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
526 ... physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800527 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700528 ${src}= Set Variable ${hosts.src[${I}]}
529 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800530 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700531
532 # Check for iperf3 and jq tools
533 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
534 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
535 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
536
Andy Baviere19991a2020-05-08 10:42:40 -0700537 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
538 ... ${of_id}
539 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
540 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
541 ... upstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700542 ${us_cir} ${us_cbs} ${us_pir} ${us_pbs} ${us_gir}= Get Bandwidth Profile Details Ietf Rest
543 ... ${bandwidth_profile_name}
544 ${limiting_bw_value_upstream}= Set Variable If ${us_pir} != 0 ${us_pir} ${us_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700545 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
546 ... downstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700547 ${ds_cir} ${ds_cbs} ${ds_pir} ${ds_pbs} ${ds_gir}= Get Bandwidth Profile Details Ietf Rest
548 ... ${bandwidth_profile_name}
549 ${limiting_bw_value_dnstream}= Set Variable If ${ds_pir} != 0 ${ds_pir} ${ds_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700550
551 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200552 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
553 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200554 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200555 ... Set Variable ${limiting_bw_value_upstream}
Andrea Campanella580e0492020-08-05 15:35:48 +0200556
Andy Baviere19991a2020-05-08 10:42:40 -0700557 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700558 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700559 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
560 ${actual_upstream_bw_used}= Evaluate
561 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
562
563 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200564 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
565 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200566 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200567 ... Set Variable ${limiting_bw_value_dnstream}
Andy Baviere19991a2020-05-08 10:42:40 -0700568 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700569 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700570 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
571 ${actual_dnstream_bw_used}= Evaluate
572 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
573
574 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
575 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
576 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
577 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
578
579 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
580 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700581 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
582 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
583 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700584 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
585 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
586 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
587 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
588 END
589
Andy Bavier7613b9a2020-07-08 07:25:47 -0700590Validate parsing of data traffic through voltha using tech profile
591 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
592 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
593 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700594 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Andy Bavier7613b9a2020-07-08 07:25:47 -0700595 ... the pbits are preserved by the PON.
Hardik Windlass62db9d92021-05-17 09:32:40 +0000596 [Tags] dataplaneDt TechProfileDt VOL-3291 soakDataplane
Andy Bavier7613b9a2020-07-08 07:25:47 -0700597 [Setup] Start Logging TechProfileDt
Hardik Windlass43531332021-05-19 07:07:03 +0000598 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavier7613b9a2020-07-08 07:25:47 -0700599 ... AND Stop Logging TechProfileDt
600 Pass Execution If '${has_dataplane}'=='False'
601 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800602 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700603 ${src}= Set Variable ${hosts.src[${I}]}
604 ${dst}= Set Variable ${hosts.dst[${I}]}
605
Andy Bavier275414a2020-07-16 13:07:17 -0700606 ${src_iface_name}= Fetch From Left ${src['dp_iface_name']} .
607
Andy Bavier7613b9a2020-07-08 07:25:47 -0700608 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
609 ${bng_user}= Get Variable Value ${dst['noroot_user']}
610 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
611 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
612 ... Skipping test: credentials for BNG login required in deployment config
613
614 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
615 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
616 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
617 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
618 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
619 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
620 Log Upstream test
621 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700622 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src_iface_name}
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700623 ... 0 tcp ${src['c_tag']} ${src['s_tag']} upstream vlan
Andy Bavier7613b9a2020-07-08 07:25:47 -0700624 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
625 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
626 Log Downstream test
627 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
628 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
629 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
630 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
631 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700632 ... ${rg_ip} ${src_iface_name} ${dst['dp_iface_name']}
633 ... 0 tcp ${src['c_tag']} ${src['s_tag']} downstream tcp
Andy Bavier7613b9a2020-07-08 07:25:47 -0700634 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
635 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
636 END
637
Hardik Windlass16cdf962020-04-29 15:26:50 +0530638Test Disable and Enable OLT PON Port for DT
639 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
640 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
641 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
642 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass43531332021-05-19 07:07:03 +0000643 [Tags] functionalDt DisableEnableOltPonPortDt VOL-2577 soak
Hardik Windlass16cdf962020-04-29 15:26:50 +0530644 [Setup] Start Logging DisableEnableOltPonPortDt
Hardik Windlass43531332021-05-19 07:07:03 +0000645 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass16cdf962020-04-29 15:26:50 +0530646 ... AND Stop Logging DisableEnableOltPonPortDt
Hardik Windlass41701e82021-01-12 17:44:44 +0000647 FOR ${I} IN RANGE 0 ${olt_count}
648 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
649 Disable Enable PON Port Per OLT DT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530650 END
651
Hardik Windlass91cc5292021-07-26 10:09:40 +0000652Data plane Bandwidth profile update verification for DT
653 [Documentation] Test bandwidth profile is updated for one subscriber and not changed for other subscribers.
654 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
655 ... Assumes Default and User_Bandwidth2 profiles are configured as bandwidth profiles
656 [Tags] non-critical dataplaneDt BandwidthProfileUpdateTCPDt VOL-2549
657 [Setup] Start Logging BandwidthProfileUpdateTCPDt
658 [Teardown] Run Keywords Collect Logs
659 ... AND Stop Logging BandwidthProfileUpdateTCPDt
660 ... AND Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis-DT.json
661 Pass Execution If '${has_dataplane}'=='False'
662 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
663 Delete All Devices And Verify
664 Run Keyword If ${has_dataplane} Clean Up Linux
665 Setup
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000666 Perform Sanity Test DT
Hardik Windlass91cc5292021-07-26 10:09:40 +0000667 # Update the Bandwidth Profile for the First Subscriber under test
668 ${src}= Set Variable ${hosts.src[${0}]}
669 ${dst}= Set Variable ${hosts.dst[${0}]}
670 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000671 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Hardik Windlass91cc5292021-07-26 10:09:40 +0000672 ${onu_device_id}= Get Device ID From SN ${src['onu']}
673 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
674 ... ${of_id} ${src['uni_id']}
675 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
676 ${oldBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
677 # Delete the existing subscriber
678 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
679 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
680 # Verify VOLTHA flows for ONU under test is Zero
681 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
682 ... ${onu_device_id} 0
683 # Disable and Re-Enable the ONU (To replicate DT current workflow)
684 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
685 Disable Device ${onu_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000686 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass91cc5292021-07-26 10:09:40 +0000687 ... Validate Device DISABLED UNKNOWN
688 ... REACHABLE ${src['onu']}
689 Enable Device ${onu_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000690 Wait Until Keyword Succeeds 360s 5s
Hardik Windlass91cc5292021-07-26 10:09:40 +0000691 ... Validate Device ENABLED ACTIVE
692 ... REACHABLE ${src['onu']}
693 # Change the bandwidth profile and load the configuration
694 ${newBwName} Set Variable If ${oldBwName} == 'Default' 'User_Bandwidth2' 'Default'
695 ${cmd} Catenate
696 ... sed 's/upstreamBandwidthProfile": "${oldBwName}"/upstreamBandwidthProfile": "${newBwName}"/g'
697 ... ${CURDIR}/../../tests/data/${POD_NAME}-sadis-DT.json > ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
698 ${rc} Run and Return RC ${cmd}
699 Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
700 # Re-add the subscriber with new bandwidth profile
701 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
702 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
703 # Verify subscriber access flows are added for the ONU port
704 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
705 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
706 ... ${onu_port} ${nni_port} ${src['s_tag']}
707 # Verify ONU state in voltha
708 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
709 ... ENABLED ACTIVE REACHABLE
710 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
711 # Verify Meters in ONOS
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000712 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass91cc5292021-07-26 10:09:40 +0000713 ... Verify Meters in ONOS Ietf ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
714 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
715 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
716 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
717 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
718 ... ${dst['container_name']}
719 # Verify new bandwidth profile is applied and other subscribers are working fine
720 ${checkBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
721 Should Be Equal ${checkBwName} ${newBwName} The bandwidth profile is not updated properly
722 FOR ${I} IN RANGE 0 ${num_all_onus}
723 ${src}= Set Variable ${hosts.src[${I}]}
724 ${dst}= Set Variable ${hosts.dst[${I}]}
725 ${of_id}= Get ofID From OLT List ${src['olt']}
726 # Check for iperf3 and jq tools
727 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
728 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
729 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
730
731 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
732 ... ${of_id}
733 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
734 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
735 ... upstreamBandwidthProfile
736 ${us_cir} ${us_cbs} ${us_pir} ${us_pbs} ${us_gir}= Get Bandwidth Profile Details Ietf Rest
737 ... ${bandwidth_profile_name}
738 ${limiting_bw_value_upstream}= Set Variable If ${us_pir} != 0 ${us_pir} ${us_gir}
739 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
740 ... downstreamBandwidthProfile
741 ${ds_cir} ${ds_cbs} ${ds_pir} ${ds_pbs} ${ds_gir}= Get Bandwidth Profile Details Ietf Rest
742 ... ${bandwidth_profile_name}
743 ${limiting_bw_value_dnstream}= Set Variable If ${ds_pir} != 0 ${ds_pir} ${ds_gir}
744
745 # Stream TCP packets from RG to server
746 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
747 ... args=-t 30
748 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
749
750 # Stream TCP packets from server to RG
751 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
752 ... args=-R -t 30
753 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
754
755 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
756 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
757 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
758 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
759
760 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
761 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
762 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
763 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
764 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
765 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
766 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
767 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
768 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
769 END
770
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000771
772Test ONU Delete and Auto-Discovery for DT
773 [Documentation] Tests the voltctl delete and Auto-Discovery of the ONU
774 [Tags] functionalDt VOL-3098 ONUAutoDiscoveryDt notready
775 [Setup] Start Logging ONUAutoDiscoveryDt
776 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
777 ... AND Stop Logging ONUAutoDiscoveryDt
778 Clear All Devices Then Create New Device
779 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
780 Run Keyword If ${has_dataplane} Clean Up Linux
781 Perform Sanity Test DT
782 FOR ${I} IN RANGE 0 ${num_all_onus}
783 ${src}= Set Variable ${hosts.src[${I}]}
784 ${dst}= Set Variable ${hosts.dst[${I}]}
785 ${onu_device_id}= Get Device ID From SN ${src['onu']}
786 ${of_id}= Get ofID From OLT List ${src['olt']}
787 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
788 # Delete ONU and Verify Ping Fails
789 Delete Device ${onu_device_id}
790 Run Keyword If ${has_dataplane} Verify ping is successful except for given device
791 ... ${num_all_onus} ${src['onu']}
792 # Verify that no pending flows exist for the ONU port
793 Wait Until Keyword Succeeds ${timeout} 2s
794 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
795 # ONU Auto-Discovery
796 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
797 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
798 # Check ONU port is Enabled in ONOS
799 Wait Until Keyword Succeeds ${timeout} 2s
800 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
801 ${onu_device_id}= Get Device ID From SN ${src['onu']}
802 Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
803 # Verify ONU state in voltha
804 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
805 ... Validate Device ENABLED ACTIVE REACHABLE
806 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
807 # Verify that no pending flows exist for the ONU port
808 Wait Until Keyword Succeeds ${timeout} 2s
809 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
810 # Verify subscriber access flows are added for the ONU port
811 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
812 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
813 ... ${onu_port} ${nni_port} ${src['s_tag']}
814 # Verify Meters in ONOS
815 Wait Until Keyword Succeeds ${timeout} 5s
816 ... Verify Meters in ONOS Ietf ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
817 Run Keyword If ${has_dataplane} Validate DHCP and Ping True
818 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
819 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
820 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
821 ... ${dst['container_name']}
822 END
823 # Verify flows for all OLTs
824 Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
825
826
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000827*** Keywords ***
828Setup Suite
829 [Documentation] Set up the test suite
830 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700831 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800832 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700833 #power_switch.robot needs it to support different vendor's power switch
834 ${switch_type}= Get Variable Value ${web_power_switch.type}
835 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000836
837Clear All Devices Then Create New Device
838 [Documentation] Remove any devices from VOLTHA and ONOS
839 # Remove all devices from voltha and nos
840 Delete All Devices and Verify
841 # Execute normal test Setup Keyword
842 Setup
Girish Gowdrad2c0e9d2021-11-23 14:40:23 -0800843