blob: 11fc497488dd614ac6204ed1a1a5172bb5c2c6e5 [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
Hardik Windlassc4d1fd62022-04-12 13:12:28 +000057# flag to reboot OLT through Power Switch
58${power_cycle_olt} False
Hardik Windlassa3d04b92020-02-17 15:06:05 +000059
Andy Baviere19991a2020-05-08 10:42:40 -070060# For dataplane bandwidth testing
61${upper_margin_pct} 105 # Allow 5% over the limit
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080062${lower_margin_pct} 90 # Allow 8% under the limit
Andy Baviere19991a2020-05-08 10:42:40 -070063${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
Andy Bavierc80a2742020-08-28 10:59:05 -070064${udp_packet_bytes} 1470 # UDP payload in bytes
Andy Baviere19991a2020-05-08 10:42:40 -070065
Hardik Windlassa3d04b92020-02-17 15:06:05 +000066# Per-test logging on failure is turned off by default; set this variable to enable
67${container_log_dir} ${None}
68
Hardik Windlass43531332021-05-19 07:07:03 +000069# logging flag to enable Collect Logs, can be passed via the command line too
70# example: -v logging:False
71${logging} True
72
Hardik Windlass4ed54502021-05-14 07:34:15 +000073# Flag specific to Soak Jobs
74${SOAK_TEST} False
75${bbsim_port} 50060
76
Hardik Windlassa3d04b92020-02-17 15:06:05 +000077*** Test Cases ***
Hardik Windlassc4d1fd62022-04-12 13:12:28 +000078Reboot DT ONUs and OLTs Physically
79 [Documentation] This test reboots ONUs and OLTs physically before execution all the tests
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070080 ... Test case runs only on the PODs that are configured with PowerSwitch that
81 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
Hardik Windlassc4d1fd62022-04-12 13:12:28 +000082 [Tags] functionalDt PowerSwitch RebootAllDTONUsOLTs soak
83 [Setup] Start Logging RebootAllDTONUsOLTs
Hardik Windlass43531332021-05-19 07:07:03 +000084 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlassc4d1fd62022-04-12 13:12:28 +000085 ... AND Stop Logging RebootAllDTONUsOLTs
86 Perform Reboot ONUs and OLTs Physically ${power_cycle_olt}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070087
Hardik Windlass4ed54502021-05-14 07:34:15 +000088Create Soak BBSim Device
89 [Documentation] This creates and enables the BBSim device as required by the soak testing
90 ... The BBSim OLT and ONUs created as part of this test are not part of active testing
91 ... but only to mock the load on Soak POD.
92 [Tags] soak
93 [Setup] Start Logging soakPodCreateBBSimLoad
Hardik Windlass43531332021-05-19 07:07:03 +000094 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass4ed54502021-05-14 07:34:15 +000095 ... AND Stop Logging soakPodCreateBBSimLoad
96 ${num_bbsim} Get Length ${bbsim}
Hardik Windlassea4caf72021-07-30 07:22:12 +000097 @{bbsim_olt_of_id_list}= Create List
Hardik Windlass4ed54502021-05-14 07:34:15 +000098 FOR ${I} IN RANGE 0 ${num_bbsim}
99 ${ip} Evaluate ${bbsim}[${I}].get("ip")
100 ${serial_number} Evaluate ${bbsim}[${I}].get("serial")
101 ${bbsim_olt_device_id}= Create Device ${ip} ${bbsim_port}
102 Log ${bbsim_olt_device_id}
103 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass8b446492021-06-10 06:25:23 +0000104 ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${bbsim_olt_device_id} by_dev_id=True
Hardik Windlass4ed54502021-05-14 07:34:15 +0000105 Enable Device ${bbsim_olt_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000106 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass4ed54502021-05-14 07:34:15 +0000107 ... Validate OLT Device ENABLED ACTIVE REACHABLE ${serial_number}
Hardik Windlassea4caf72021-07-30 07:22:12 +0000108 ${bbsim_olt_of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
Hardik Windlass4ed54502021-05-14 07:34:15 +0000109 ... ${serial_number}
Hardik Windlassea4caf72021-07-30 07:22:12 +0000110 Log ${bbsim_olt_of_id}
111 Append To List ${bbsim_olt_of_id_list} ${bbsim_olt_of_id}
Hardik Windlass4ed54502021-05-14 07:34:15 +0000112 END
113 # Extra sleep time for ONUs to come up Active
Hardik Windlassea4caf72021-07-30 07:22:12 +0000114 Sleep 60s
115 FOR ${bbsim_olt_of_id} IN @{bbsim_olt_of_id_list}
116 Provision all subscribers on device ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${ONOS_SSH_IP} ${ONOS_REST_PORT}
117 ... ${bbsim_olt_of_id}
118 ${total_onus_per_bbsim_olt}= Count Enabled UNI Ports ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
119 ... ${bbsim_olt_of_id}
120 Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
121 ... ${bbsim_olt_of_id} dt ${total_onus_per_bbsim_olt} 1 true
122 ... false false false true
123 END
Hardik Windlass4ed54502021-05-14 07:34:15 +0000124
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000125Sanity E2E Test for OLT/ONU on POD for DT
126 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
127 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
128 ... Traffic sent with same vlan from different RGs,
129 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
130 ... Inner vlans from the RG should not change
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800131 [Tags] sanityDt soak
Hardik Windlass4ed54502021-05-14 07:34:15 +0000132 [Setup] Start Logging SanityTestDt
Hardik Windlass43531332021-05-19 07:07:03 +0000133 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000134 ... AND Stop Logging SanityTestDt
Hardik Windlass4ed54502021-05-14 07:34:15 +0000135 Setup ${SOAK_TEST}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000136 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000137 Perform Sanity Test DT
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000138
Hardik Windlass35706ba2020-02-20 08:16:42 +0000139Test Subscriber Delete and Add for DT
140 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
Hardik Windlass63d5e002020-03-06 21:07:09 +0530141 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000142 ... Delete a subscriber and validate that the pings do not succeed and state is purged
143 ... Disable and Enable the ONU (This is to replicate the existing DT behaviour)
144 ... Re-add the subscriber, and validate that the flows are present and pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800145 [Tags] functionalDt SubAddDeleteDt soak
Girish Gowdrafbdddc12021-12-17 15:39:55 +0530146 [Setup] Run Keywords Start Logging SubAddDeleteDt
147 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Hardik Windlass43531332021-05-19 07:07:03 +0000148 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass35706ba2020-02-20 08:16:42 +0000149 ... AND Stop Logging SubAddDeleteDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800150 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000151 ${src}= Set Variable ${hosts.src[${I}]}
152 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800153 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000154 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000155 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800156 ${olt_device_id}= Get OLTDeviceID From OLT List ${src['olt']}
Andrea Campanellad848de02020-11-24 10:23:41 +0100157 ${num_of_olt_onus}= Get Num of Onus From OLT SN ${src['olt']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000158 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Emrehan UZUNabef5182021-11-26 10:54:24 +0000159 ... ${of_id} ${src['uni_id']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000160 # Remove Subscriber Access
TorstenThieme4e2168e2021-06-22 14:01:47 +0000161 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000162 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000163 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000164 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000165 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
166 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Andrea Campanellad848de02020-11-24 10:23:41 +0100167
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530168 # 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 +0100169 ${onos_flows_count}= Evaluate 4 * ( ${num_of_olt_onus} - 1 )
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530170 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
171 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Suchitra Vemuri93db32b2020-11-23 21:27:05 -0800172 ... ${of_id} ${onos_flows_count}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000173 # 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 +0100174 ${olt_flows}= Evaluate 2 * ( ${num_of_olt_onus} - 1 ) + 1
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000175 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows
176 ... ${olt_flows} ${olt_device_id}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000177 # Verify VOLTHA flows for ONU under test is Zero
178 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
179 ... ${onu_device_id} 0
180 # Disable and Re-Enable the ONU (To replicate DT current workflow)
181 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
182 Disable Device ${onu_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000183 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000184 ... Validate Device DISABLED UNKNOWN
185 ... REACHABLE ${src['onu']}
186 Enable Device ${onu_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000187 Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000188 ... Validate Device ENABLED ACTIVE
189 ... REACHABLE ${src['onu']}
190 # Add Subscriber Access
TorstenThieme4e2168e2021-06-22 14:01:47 +0000191 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000192 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530193 # Verify subscriber access flows are added for the ONU port
194 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530195 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
196 ... ${onu_port} ${nni_port} ${src['s_tag']}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000197 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000198 ... Validate Device ENABLED ACTIVE
199 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Girish Gowdrad2c0e9d2021-11-23 14:40:23 -0800200 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
201 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
202 # Workaround ends here for issue seen in VOL-4489.
Hardik Windlass35706ba2020-02-20 08:16:42 +0000203 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000204 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000205 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
206 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000207 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800208 # Verify flows for all OLTs
209 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
Hardik Windlass35706ba2020-02-20 08:16:42 +0000210
Hardik Windlass63d5e002020-03-06 21:07:09 +0530211Test Disable and Enable ONU for DT
212 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
213 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
214 ... Perform disable on the ONUs and validate that the pings do not succeed
215 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800216 [Tags] functionalDt DisableEnableONUDt soak
Girish Gowdra8fd96962021-12-14 16:20:04 +0530217 [Setup] Run Keywords Start Logging DisableEnableONUDt
218 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Hardik Windlass43531332021-05-19 07:07:03 +0000219 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass63d5e002020-03-06 21:07:09 +0530220 ... AND Stop Logging DisableEnableONUDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800221 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530222 ${src}= Set Variable ${hosts.src[${I}]}
223 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800224 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530225 ${onu_device_id}= Get Device ID From SN ${src['onu']}
226 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Emrehan UZUNabef5182021-11-26 10:54:24 +0000227 ... ${of_id} ${src['uni_id']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530228 Disable Device ${onu_device_id}
229 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
230 ... Validate Device DISABLED UNKNOWN
Hardik Windlass42c84232022-01-27 04:58:27 +0000231 ... REACHABLE ${src['onu']} onu=True onu_reason=tech-profile-config-delete-success
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000232 Wait Until Keyword Succeeds ${timeout} 2s
Emrehan UZUNabef5182021-11-26 10:54:24 +0000233 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530234 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530235 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000236 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530237 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
238 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
239 Sleep 5s
240 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700241 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530242 ... Validate Device ENABLED ACTIVE
243 ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000244 Wait Until Keyword Succeeds ${timeout} 2s
Emrehan UZUNabef5182021-11-26 10:54:24 +0000245 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Girish Gowdrac38824c2021-12-01 13:22:08 +0530246 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
247 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
248 # Workaround ends here for issue seen in VOL-4489.
Hardik Windlass63d5e002020-03-06 21:07:09 +0530249 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000250 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530251 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
252 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530253 END
254
Hardik Windlassaaea3402020-03-10 19:45:45 +0530255Test Disable and Delete OLT for DT
256 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
257 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
258 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
259 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Hardik Windlass43531332021-05-19 07:07:03 +0000260 [Tags] functionalDt DisableDeleteOLTDt soak
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700261 [Setup] Start Logging DisableDeleteOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000262 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlassaaea3402020-03-10 19:45:45 +0530263 ... AND Stop Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530264 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800265 FOR ${I} IN RANGE 0 ${olt_count}
266 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
267 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
268 Disable Device ${olt_device_id}
269 ${of_id}= Get ofID From OLT List ${olt_serial_number}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000270 Wait Until Keyword Succeeds ${timeout} 5s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800271 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
272 ... ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800273 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
274 # Validate ONUs
275 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
Andrea Campanella4e507882020-11-26 11:33:11 +0100276 ... ${num_onus} ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800277 # Verify ONOS Flows
Matteo Scandolo8b6dc262021-11-22 12:30:27 -0800278 # When we disable the device we shouldn't have any flows provisioned on it
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800279 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
280 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Matteo Scandolo8b6dc262021-11-22 12:30:27 -0800281 ... ${of_id} 0
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800282 # Verify VOLTHA Flows
Hardik Windlass3a294892021-11-23 17:05:29 +0000283 # OLT should only have 1 default flow for LLDP
284 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows 1
Matteo Scandolo8b6dc262021-11-22 12:30:27 -0800285 ... ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800286 ${List_ONU_Serial} Create List
287 Set Suite Variable ${List_ONU_Serial}
Andrea Campanella99a548b2020-11-18 09:50:32 +0100288 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} ${num_onus}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800289 Log ${List_ONU_Serial}
290 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
Matteo Scandolo8b6dc262021-11-22 12:30:27 -0800291 ... ${List_ONU_Serial} 0
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800292 # Delete OLT and Validate Empty Device List
293 Delete Device ${olt_device_id}
Andrea Campanella4e507882020-11-26 11:33:11 +0100294 # Check that the OLT and the ONUs are actually removed from the system
295 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed
296 ... ${olt_serial_number}
297 Run Keyword and Continue On Failure Validate all ONUS for OLT Removed ${num_all_onus} ${hosts}
298 ... ${olt_serial_number} ${timeout}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000299 Wait Until Keyword Succeeds ${timeout} 5s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800300 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800301 END
Hardik Windlassaaea3402020-03-10 19:45:45 +0530302 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Hardik Windlass43531332021-05-19 07:07:03 +0000303 Run Keyword Setup ${SOAK_TEST}
Suchitra Vemuriae9cecb2020-03-12 12:59:14 -0700304 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000305 Perform Sanity Test DT
Hardik Windlassaaea3402020-03-10 19:45:45 +0530306
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530307Test Disable and Enable OLT for DT
308 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
309 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
310 ... Perform disable on the OLT and validate that the pings do not succeed
311 ... Perform enable on the OLT and validate that the pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800312 [Tags] functionalDt DisableEnableOLTDt soak
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530313 [Setup] Start Logging DisableEnableOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000314 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530315 ... AND Stop Logging DisableEnableOLTDt
316 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800317 FOR ${I} IN RANGE 0 ${olt_count}
318 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
319 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
320 ${rc} ${output}= Run and Return Rc and Output
321 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
322 Should Be Equal As Integers ${rc} 0
323 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
324 ... ${olt_serial_number}
325 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800326 # Validate ONUs
327 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530328 ${src}= Set Variable ${hosts.src[${I}]}
329 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800330 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530331 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000332 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Emrehan UZUNabef5182021-11-26 10:54:24 +0000333 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000334 Wait Until Keyword Succeeds ${timeout} 2s
Emrehan UZUNabef5182021-11-26 10:54:24 +0000335 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530336 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000337 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass7c801e62020-05-04 19:33:21 +0530338 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
339 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
340 # Remove Subscriber Access (To replicate DT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000341 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530342 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
343 # Delete ONU Device (To replicate DT workflow)
344 Delete Device ${onu_device_id}
345 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530346 Sleep 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530347 # Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800348 FOR ${I} IN RANGE 0 ${olt_count}
349 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
350 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
351 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800352 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
353 ... ${olt_serial_number}
354 #TODO: Update for PON_OLT ETHERNET_NNI
355 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
356 #... PON_OLT ETHERNET_NNI
357 END
Hardik Windlass7c801e62020-05-04 19:33:21 +0530358 # Waiting extra time for the ONUs to come up
359 Sleep 60s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800360 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000361 Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530362
363Test Delete and ReAdd OLT for DT
364 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
365 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
366 ... Disable and Delete the OLT
367 ... Create/Enable the same OLT again
368 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
Hardik Windlass43531332021-05-19 07:07:03 +0000369 [Tags] functionalDt DeleteReAddOLTDt soak
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530370 [Setup] Start Logging DeleteReAddOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000371 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530372 ... AND Stop Logging DeleteReAddOLTDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800373 FOR ${I} IN RANGE 0 ${olt_count}
374 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
375 ${of_id}= Get ofID From OLT List ${olt_serial_number}
376 Delete Device and Verify ${olt_serial_number}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000377 Wait Until Keyword Succeeds ${timeout} 5s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800378 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800379 END
380 # Recreate the OLTs
Hardik Windlass43531332021-05-19 07:07:03 +0000381 Setup ${SOAK_TEST}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800382 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000383 Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530384
385Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
386 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
387 ... This TC is to confirm that ONU removal is not impacting OLT
388 ... Devices will be removed during the execution of this TC
389 ... so calling setup at the end to add the devices back to avoid the confusion.
390 [Tags] functionalDt DisableDeleteONUOLTDt
Girish Gowdra8fd96962021-12-14 16:20:04 +0530391 [Setup] Run Keywords Start Logging DisableDeleteONUOLTDt
392 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Hardik Windlass43531332021-05-19 07:07:03 +0000393 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530394 ... AND Stop Logging DisableDeleteONUOLTDt
Suchitra Vemuri02170552021-03-23 16:40:50 -0700395 @{onu_reason}= Create List initial-mib-downloaded omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800396 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530397 ${src}= Set Variable ${hosts.src[${I}]}
398 ${dst}= Set Variable ${hosts.dst[${I}]}
399 ${onu_device_id}= Get Device ID From SN ${src['onu']}
400 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
401 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700402 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000403 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530404 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800405 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530406 Disable Device ${onu_device_id}
407 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
408 ... Validate Device DISABLED UNKNOWN
409 ... REACHABLE ${src['onu']} onu=false
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000410 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530411 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800412 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530413 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800414 # Disable all OLTs
415 FOR ${I} IN RANGE 0 ${olt_count}
416 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
417 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
418 ${rc} ${output}= Run and Return Rc and Output
419 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
420 Should Be Equal As Integers ${rc} 0
421 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
422 ... ${olt_serial_number}
423 END
424 # Validate ONUs after OLT disable
425 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530426 ${src}= Set Variable ${hosts.src[${I}]}
427 ${dst}= Set Variable ${hosts.dst[${I}]}
428 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000429 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530430 ... Validate Device DISABLED DISCOVERED
431 ... UNREACHABLE ${src['onu']} onu=false
432 Delete Device ${onu_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000433 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530434 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800435 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530436 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800437 # Delete all OLTs
438 Delete All Devices and Verify
439
440 #Delete Device ${olt_device_id}
441 #TODO: Fix the following assertion
442 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
443 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
444 #... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
445
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530446 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
447 Run Keyword Setup
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800448 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000449 Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530450
Andy Baviere19991a2020-05-08 10:42:40 -0700451Data plane verification using TCP for DT
452 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
453 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200454 [Tags] non-critical dataplaneDt BandwidthProfileTCPDt VOL-3061 soakDataplane
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700455 [Setup] Start Logging BandwidthProfileTCPDt
Hardik Windlass43531332021-05-19 07:07:03 +0000456 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700457 ... AND Stop Logging BandwidthProfileTCPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700458 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
459 ... physical pod. Skipping this test in BBSIM.
Hardik Windlass3280f2d2021-05-20 07:38:31 +0000460 Run Keyword If '${SOAK_TEST}'=='False' Clear All Devices Then Create New Device
Hardik Windlass62db9d92021-05-17 09:32:40 +0000461 ... ELSE Setup Soak
Suchitra Vemuria4e3e072020-11-06 14:23:47 -0800462 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000463 Perform Sanity Test DT
Suchitra Vemuria4e3e072020-11-06 14:23:47 -0800464
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800465 #${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
466 #... ${olt_serial_number}
467 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700468 ${src}= Set Variable ${hosts.src[${I}]}
469 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800470 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700471 # Check for iperf3 and jq tools
472 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
473 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
474 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
475
Andy Baviere19991a2020-05-08 10:42:40 -0700476 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Emrehan UZUNabef5182021-11-26 10:54:24 +0000477 ... ${of_id} ${src['uni_id']}
Andy Baviere19991a2020-05-08 10:42:40 -0700478 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
479 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
480 ... upstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700481 ${us_cir} ${us_cbs} ${us_pir} ${us_pbs} ${us_gir}= Get Bandwidth Profile Details Ietf Rest
482 ... ${bandwidth_profile_name}
483 ${limiting_bw_value_upstream}= Set Variable If ${us_pir} != 0 ${us_pir} ${us_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700484 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
485 ... downstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700486 ${ds_cir} ${ds_cbs} ${ds_pir} ${ds_pbs} ${ds_gir}= Get Bandwidth Profile Details Ietf Rest
487 ... ${bandwidth_profile_name}
488 ${limiting_bw_value_dnstream}= Set Variable If ${ds_pir} != 0 ${ds_pir} ${ds_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700489
490 # Stream TCP packets from RG to server
491 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
492 ... args=-t 30
493 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
494
495 # Stream TCP packets from server to RG
496 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
497 ... args=-R -t 30
498 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
499
500 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
501 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
502 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
503 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
504
505 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
506 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700507 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
508 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
509 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700510 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
511 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
512 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
513 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
514 END
515
516Data plane verification using UDP for DT
517 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
518 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200519 [Tags] non-critical dataplaneDt BandwidthProfileUDPDt VOL-3061 soakDataplane
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700520 [Setup] Start Logging BandwidthProfileUDPDt
Hardik Windlass43531332021-05-19 07:07:03 +0000521 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700522 ... AND Stop Logging BandwidthProfileUDPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700523 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
524 ... physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800525 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700526 ${src}= Set Variable ${hosts.src[${I}]}
527 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800528 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700529
530 # Check for iperf3 and jq tools
531 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
532 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
533 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
534
Andy Baviere19991a2020-05-08 10:42:40 -0700535 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Emrehan UZUNabef5182021-11-26 10:54:24 +0000536 ... ${of_id} ${src['uni_id']}
Andy Baviere19991a2020-05-08 10:42:40 -0700537 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
538 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
539 ... upstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700540 ${us_cir} ${us_cbs} ${us_pir} ${us_pbs} ${us_gir}= Get Bandwidth Profile Details Ietf Rest
541 ... ${bandwidth_profile_name}
542 ${limiting_bw_value_upstream}= Set Variable If ${us_pir} != 0 ${us_pir} ${us_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700543 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
544 ... downstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700545 ${ds_cir} ${ds_cbs} ${ds_pir} ${ds_pbs} ${ds_gir}= Get Bandwidth Profile Details Ietf Rest
546 ... ${bandwidth_profile_name}
547 ${limiting_bw_value_dnstream}= Set Variable If ${ds_pir} != 0 ${ds_pir} ${ds_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700548
549 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200550 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
551 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200552 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200553 ... Set Variable ${limiting_bw_value_upstream}
Andrea Campanella580e0492020-08-05 15:35:48 +0200554
Andy Baviere19991a2020-05-08 10:42:40 -0700555 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700556 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700557 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
558 ${actual_upstream_bw_used}= Evaluate
559 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
560
561 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200562 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
563 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200564 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200565 ... Set Variable ${limiting_bw_value_dnstream}
Andy Baviere19991a2020-05-08 10:42:40 -0700566 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700567 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700568 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
569 ${actual_dnstream_bw_used}= Evaluate
570 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
571
572 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
573 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
574 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
575 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
576
577 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
578 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700579 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
580 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
581 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700582 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
583 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
584 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
585 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
586 END
587
Andy Bavier7613b9a2020-07-08 07:25:47 -0700588Validate parsing of data traffic through voltha using tech profile
589 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
590 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
591 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700592 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Andy Bavier7613b9a2020-07-08 07:25:47 -0700593 ... the pbits are preserved by the PON.
Hardik Windlass62db9d92021-05-17 09:32:40 +0000594 [Tags] dataplaneDt TechProfileDt VOL-3291 soakDataplane
Andy Bavier7613b9a2020-07-08 07:25:47 -0700595 [Setup] Start Logging TechProfileDt
Hardik Windlass43531332021-05-19 07:07:03 +0000596 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavier7613b9a2020-07-08 07:25:47 -0700597 ... AND Stop Logging TechProfileDt
598 Pass Execution If '${has_dataplane}'=='False'
599 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800600 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700601 ${src}= Set Variable ${hosts.src[${I}]}
602 ${dst}= Set Variable ${hosts.dst[${I}]}
603
Andy Bavier275414a2020-07-16 13:07:17 -0700604 ${src_iface_name}= Fetch From Left ${src['dp_iface_name']} .
605
Andy Bavier7613b9a2020-07-08 07:25:47 -0700606 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
607 ${bng_user}= Get Variable Value ${dst['noroot_user']}
608 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
609 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
610 ... Skipping test: credentials for BNG login required in deployment config
611
612 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
613 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
614 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
615 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
616 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
617 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
618 Log Upstream test
619 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700620 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src_iface_name}
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700621 ... 0 tcp ${src['c_tag']} ${src['s_tag']} upstream vlan
Andy Bavier7613b9a2020-07-08 07:25:47 -0700622 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
623 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
624 Log Downstream test
625 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
626 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
627 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
628 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
629 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700630 ... ${rg_ip} ${src_iface_name} ${dst['dp_iface_name']}
631 ... 0 tcp ${src['c_tag']} ${src['s_tag']} downstream tcp
Andy Bavier7613b9a2020-07-08 07:25:47 -0700632 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
633 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
634 END
635
Hardik Windlass16cdf962020-04-29 15:26:50 +0530636Test Disable and Enable OLT PON Port for DT
637 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
638 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
639 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
640 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass43531332021-05-19 07:07:03 +0000641 [Tags] functionalDt DisableEnableOltPonPortDt VOL-2577 soak
Girish Gowdra8fd96962021-12-14 16:20:04 +0530642 [Setup] Run Keywords Start Logging DisableEnableOltPonPortDt
643 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Hardik Windlass43531332021-05-19 07:07:03 +0000644 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass16cdf962020-04-29 15:26:50 +0530645 ... AND Stop Logging DisableEnableOltPonPortDt
Hardik Windlass41701e82021-01-12 17:44:44 +0000646 FOR ${I} IN RANGE 0 ${olt_count}
647 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
648 Disable Enable PON Port Per OLT DT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530649 END
650
Hardik Windlass91cc5292021-07-26 10:09:40 +0000651Data plane Bandwidth profile update verification for DT
652 [Documentation] Test bandwidth profile is updated for one subscriber and not changed for other subscribers.
653 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
654 ... Assumes Default and User_Bandwidth2 profiles are configured as bandwidth profiles
655 [Tags] non-critical dataplaneDt BandwidthProfileUpdateTCPDt VOL-2549
656 [Setup] Start Logging BandwidthProfileUpdateTCPDt
657 [Teardown] Run Keywords Collect Logs
658 ... AND Stop Logging BandwidthProfileUpdateTCPDt
659 ... AND Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis-DT.json
660 Pass Execution If '${has_dataplane}'=='False'
661 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
662 Delete All Devices And Verify
663 Run Keyword If ${has_dataplane} Clean Up Linux
664 Setup
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000665 Perform Sanity Test DT
Hardik Windlass91cc5292021-07-26 10:09:40 +0000666 # Update the Bandwidth Profile for the First Subscriber under test
667 ${src}= Set Variable ${hosts.src[${0}]}
668 ${dst}= Set Variable ${hosts.dst[${0}]}
669 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000670 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Hardik Windlass91cc5292021-07-26 10:09:40 +0000671 ${onu_device_id}= Get Device ID From SN ${src['onu']}
672 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
673 ... ${of_id} ${src['uni_id']}
674 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
675 ${oldBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
676 # Delete the existing subscriber
677 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
678 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
679 # Verify VOLTHA flows for ONU under test is Zero
680 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
681 ... ${onu_device_id} 0
682 # Disable and Re-Enable the ONU (To replicate DT current workflow)
683 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
684 Disable Device ${onu_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000685 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass91cc5292021-07-26 10:09:40 +0000686 ... Validate Device DISABLED UNKNOWN
687 ... REACHABLE ${src['onu']}
688 Enable Device ${onu_device_id}
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000689 Wait Until Keyword Succeeds 360s 5s
Hardik Windlass91cc5292021-07-26 10:09:40 +0000690 ... Validate Device ENABLED ACTIVE
691 ... REACHABLE ${src['onu']}
692 # Change the bandwidth profile and load the configuration
693 ${newBwName} Set Variable If ${oldBwName} == 'Default' 'User_Bandwidth2' 'Default'
694 ${cmd} Catenate
695 ... sed 's/upstreamBandwidthProfile": "${oldBwName}"/upstreamBandwidthProfile": "${newBwName}"/g'
696 ... ${CURDIR}/../../tests/data/${POD_NAME}-sadis-DT.json > ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
697 ${rc} Run and Return RC ${cmd}
698 Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
699 # Re-add the subscriber with new bandwidth profile
700 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
701 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
702 # Verify subscriber access flows are added for the ONU port
703 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
704 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
705 ... ${onu_port} ${nni_port} ${src['s_tag']}
706 # Verify ONU state in voltha
707 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
708 ... ENABLED ACTIVE REACHABLE
709 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
710 # Verify Meters in ONOS
Hardik Windlass5d537ad2021-11-16 06:01:54 +0000711 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass91cc5292021-07-26 10:09:40 +0000712 ... Verify Meters in ONOS Ietf ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Hardik Windlass3f75b602021-12-14 05:55:18 +0000713 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
714 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
715 # Workaround ends here for issue seen in VOL-4489.
Hardik Windlass91cc5292021-07-26 10:09:40 +0000716 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
717 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
718 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
719 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
720 ... ${dst['container_name']}
721 # Verify new bandwidth profile is applied and other subscribers are working fine
722 ${checkBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
723 Should Be Equal ${checkBwName} ${newBwName} The bandwidth profile is not updated properly
724 FOR ${I} IN RANGE 0 ${num_all_onus}
725 ${src}= Set Variable ${hosts.src[${I}]}
726 ${dst}= Set Variable ${hosts.dst[${I}]}
727 ${of_id}= Get ofID From OLT List ${src['olt']}
728 # Check for iperf3 and jq tools
729 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
730 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
731 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
732
733 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Emrehan UZUNabef5182021-11-26 10:54:24 +0000734 ... ${of_id} ${src['uni_id']}
Hardik Windlass91cc5292021-07-26 10:09:40 +0000735 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
736 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
737 ... upstreamBandwidthProfile
738 ${us_cir} ${us_cbs} ${us_pir} ${us_pbs} ${us_gir}= Get Bandwidth Profile Details Ietf Rest
739 ... ${bandwidth_profile_name}
740 ${limiting_bw_value_upstream}= Set Variable If ${us_pir} != 0 ${us_pir} ${us_gir}
741 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
742 ... downstreamBandwidthProfile
743 ${ds_cir} ${ds_cbs} ${ds_pir} ${ds_pbs} ${ds_gir}= Get Bandwidth Profile Details Ietf Rest
744 ... ${bandwidth_profile_name}
745 ${limiting_bw_value_dnstream}= Set Variable If ${ds_pir} != 0 ${ds_pir} ${ds_gir}
746
747 # Stream TCP packets from RG to server
748 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
749 ... args=-t 30
750 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
751
752 # Stream TCP packets from server to RG
753 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
754 ... args=-R -t 30
755 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
756
757 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
758 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
759 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
760 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
761
762 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
763 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
764 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
765 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
766 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
767 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
768 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
769 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
770 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
771 END
772
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000773
774Test ONU Delete and Auto-Discovery for DT
775 [Documentation] Tests the voltctl delete and Auto-Discovery of the ONU
Andrea Campanella92e21b02022-01-04 15:32:04 +0100776 [Tags] functionalDt VOL-3098 ONUAutoDiscoveryDt
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000777 [Setup] Start Logging ONUAutoDiscoveryDt
778 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
779 ... AND Stop Logging ONUAutoDiscoveryDt
780 Clear All Devices Then Create New Device
781 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
782 Run Keyword If ${has_dataplane} Clean Up Linux
783 Perform Sanity Test DT
784 FOR ${I} IN RANGE 0 ${num_all_onus}
785 ${src}= Set Variable ${hosts.src[${I}]}
786 ${dst}= Set Variable ${hosts.dst[${I}]}
787 ${onu_device_id}= Get Device ID From SN ${src['onu']}
788 ${of_id}= Get ofID From OLT List ${src['olt']}
Andrea Campanella92e21b02022-01-04 15:32:04 +0100789 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
790 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000791 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Hardik Windlass7a9e1f22022-03-09 05:33:34 +0000792 # Remove Subscriber
793 Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
794 ... volt-remove-subscriber-access ${of_id} ${onu_port}
795 # Additional sleep to let subscriber delete process
796 Sleep 10s
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000797 # Delete ONU and Verify Ping Fails
798 Delete Device ${onu_device_id}
799 Run Keyword If ${has_dataplane} Verify ping is successful except for given device
800 ... ${num_all_onus} ${src['onu']}
801 # Verify that no pending flows exist for the ONU port
802 Wait Until Keyword Succeeds ${timeout} 2s
803 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
804 # ONU Auto-Discovery
805 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Emrehan UZUNabef5182021-11-26 10:54:24 +0000806 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000807 # Check ONU port is Enabled in ONOS
808 Wait Until Keyword Succeeds ${timeout} 2s
Emrehan UZUNabef5182021-11-26 10:54:24 +0000809 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000810 ${onu_device_id}= Get Device ID From SN ${src['onu']}
811 Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
Hardik Windlass7a9e1f22022-03-09 05:33:34 +0000812 # Re-Add Subscriber
813 Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
814 ... volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000815 # Verify ONU state in voltha
816 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
817 ... Validate Device ENABLED ACTIVE REACHABLE
818 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
819 # Verify that no pending flows exist for the ONU port
820 Wait Until Keyword Succeeds ${timeout} 2s
821 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
822 # Verify subscriber access flows are added for the ONU port
823 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
824 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
825 ... ${onu_port} ${nni_port} ${src['s_tag']}
826 # Verify Meters in ONOS
827 Wait Until Keyword Succeeds ${timeout} 5s
828 ... Verify Meters in ONOS Ietf ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
829 Run Keyword If ${has_dataplane} Validate DHCP and Ping True
830 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
831 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
832 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
833 ... ${dst['container_name']}
834 END
835 # Verify flows for all OLTs
836 Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
837
838
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000839*** Keywords ***
840Setup Suite
841 [Documentation] Set up the test suite
842 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700843 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800844 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700845 #power_switch.robot needs it to support different vendor's power switch
846 ${switch_type}= Get Variable Value ${web_power_switch.type}
847 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000848
849Clear All Devices Then Create New Device
850 [Documentation] Remove any devices from VOLTHA and ONOS
851 # Remove all devices from voltha and nos
852 Delete All Devices and Verify
853 # Execute normal test Setup Keyword
854 Setup
Girish Gowdrad2c0e9d2021-11-23 14:40:23 -0800855