blob: 7f0338517b591b177b70b0f5a8501a163896c8d8 [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
45# For below variable value, using deployment name as using grep for
46# parsing radius pod name, we can also use full radius pod name
47${RESTART_POD_NAME} radius
Suchitra Vemurie9c6ca62020-07-27 16:44:53 -070048${timeout} 360s
Hardik Windlassa3d04b92020-02-17 15:06:05 +000049${of_id} 0
50${logical_id} 0
Andrea Campanella86e24062020-08-05 19:09:18 +020051${uprate} 0
52${dnrate} 0
Hardik Windlassa3d04b92020-02-17 15:06:05 +000053${has_dataplane} True
Hardik Windlassffbf0602020-04-24 23:14:45 +053054${teardown_device} True
Hardik Windlassa3d04b92020-02-17 15:06:05 +000055${scripts} ../../scripts
56
Andy Baviere19991a2020-05-08 10:42:40 -070057# For dataplane bandwidth testing
58${upper_margin_pct} 105 # Allow 5% over the limit
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080059${lower_margin_pct} 90 # Allow 8% under the limit
Andy Baviere19991a2020-05-08 10:42:40 -070060${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
Andy Bavierc80a2742020-08-28 10:59:05 -070061${udp_packet_bytes} 1470 # UDP payload in bytes
Andy Baviere19991a2020-05-08 10:42:40 -070062
Hardik Windlassa3d04b92020-02-17 15:06:05 +000063# Per-test logging on failure is turned off by default; set this variable to enable
64${container_log_dir} ${None}
65
Hardik Windlass4ed54502021-05-14 07:34:15 +000066# Flag specific to Soak Jobs
67${SOAK_TEST} False
68${bbsim_port} 50060
69
Hardik Windlassa3d04b92020-02-17 15:06:05 +000070*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070071Reboot DT ONUs Physically
72 [Documentation] This test reboots ONUs physically before execution all the tests
73 ... Test case runs only on the PODs that are configured with PowerSwitch that
74 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
Suchitra Vemuri228f8802021-03-10 13:14:17 -080075 [Tags] functionalDt PowerSwitch RebootAllDTONUs soak
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070076 [Setup] Start Logging RebootAllDTONUs
77 [Teardown] Run Keywords Collect Logs
78 ... AND Stop Logging RebootAllDTONUs
79 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080080 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070081 ${src}= Set Variable ${hosts.src[${I}]}
82 ${dst}= Set Variable ${hosts.dst[${I}]}
83 Disable Switch Outlet ${src['power_switch_port']}
Hardik Windlass5e214b22021-02-26 10:37:14 +000084 Sleep 10s
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070085 Enable Switch Outlet ${src['power_switch_port']}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070086 END
87
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
94 [Teardown] Run Keywords Collect Logs
95 ... AND Stop Logging soakPodCreateBBSimLoad
96 ${num_bbsim} Get Length ${bbsim}
97 FOR ${I} IN RANGE 0 ${num_bbsim}
98 ${ip} Evaluate ${bbsim}[${I}].get("ip")
99 ${serial_number} Evaluate ${bbsim}[${I}].get("serial")
100 ${bbsim_olt_device_id}= Create Device ${ip} ${bbsim_port}
101 Log ${bbsim_olt_device_id}
102 Wait Until Keyword Succeeds ${timeout} 5s
103 ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${bbsim_olt_device_id}
104 Enable Device ${bbsim_olt_device_id}
105 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
106 ... Validate OLT Device ENABLED ACTIVE REACHABLE ${serial_number}
107 ${olt_of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
108 ... ${serial_number}
109 Log ${olt_of_id}
110 END
111 # Extra sleep time for ONUs to come up Active
112 Sleep 30s
113
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000114Sanity E2E Test for OLT/ONU on POD for DT
115 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
116 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
117 ... Traffic sent with same vlan from different RGs,
118 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
119 ... Inner vlans from the RG should not change
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800120 [Tags] sanityDt soak
Hardik Windlass4ed54502021-05-14 07:34:15 +0000121 [Setup] Start Logging SanityTestDt
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000122 [Teardown] Run Keywords Collect Logs
123 ... AND Stop Logging SanityTestDt
Hardik Windlass4ed54502021-05-14 07:34:15 +0000124 Setup ${SOAK_TEST}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000125 Run Keyword If ${has_dataplane} Clean Up Linux
126 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
127
Hardik Windlass35706ba2020-02-20 08:16:42 +0000128Test Subscriber Delete and Add for DT
129 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
Hardik Windlass63d5e002020-03-06 21:07:09 +0530130 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000131 ... Delete a subscriber and validate that the pings do not succeed and state is purged
132 ... Disable and Enable the ONU (This is to replicate the existing DT behaviour)
133 ... Re-add the subscriber, and validate that the flows are present and pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800134 [Tags] functionalDt SubAddDeleteDt soak
Andy Baviere187eda2020-04-20 15:00:02 -0700135 [Setup] Start Logging SubAddDeleteDt
Hardik Windlass35706ba2020-02-20 08:16:42 +0000136 [Teardown] Run Keywords Collect Logs
137 ... AND Stop Logging SubAddDeleteDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800138 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000139 ${src}= Set Variable ${hosts.src[${I}]}
140 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800141 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000142 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800143 ${olt_device_id}= Get OLTDeviceID From OLT List ${src['olt']}
Andrea Campanellad848de02020-11-24 10:23:41 +0100144 ${num_of_olt_onus}= Get Num of Onus From OLT SN ${src['olt']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000145 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
146 ... ${of_id}
147 # Remove Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -0800148 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000149 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000150 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
151 ... Wait Until Keyword Succeeds 60s 2s
152 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
153 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Andrea Campanellad848de02020-11-24 10:23:41 +0100154
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530155 # 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 +0100156 ${onos_flows_count}= Evaluate 4 * ( ${num_of_olt_onus} - 1 )
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530157 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
158 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Suchitra Vemuri93db32b2020-11-23 21:27:05 -0800159 ... ${of_id} ${onos_flows_count}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000160 # 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 +0100161 ${olt_flows}= Evaluate 2 * ( ${num_of_olt_onus} - 1 ) + 1
Hardik Windlass35706ba2020-02-20 08:16:42 +0000162 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800163 ... ${olt_device_id}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000164 # Verify VOLTHA flows for ONU under test is Zero
165 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
166 ... ${onu_device_id} 0
167 # Disable and Re-Enable the ONU (To replicate DT current workflow)
168 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
169 Disable Device ${onu_device_id}
170 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
171 ... Validate Device DISABLED UNKNOWN
172 ... REACHABLE ${src['onu']}
173 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700174 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000175 ... Validate Device ENABLED ACTIVE
176 ... REACHABLE ${src['onu']}
177 # Add Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -0800178 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000179 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530180 # Verify subscriber access flows are added for the ONU port
181 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530182 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
183 ... ${onu_port} ${nni_port} ${src['s_tag']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700184 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000185 ... Validate Device ENABLED ACTIVE
186 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530187 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000188 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
189 ... Wait Until Keyword Succeeds 60s 2s
190 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
191 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000192 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800193 # Verify flows for all OLTs
194 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
Hardik Windlass35706ba2020-02-20 08:16:42 +0000195
Hardik Windlass63d5e002020-03-06 21:07:09 +0530196Test Disable and Enable ONU for DT
197 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
198 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
199 ... Perform disable on the ONUs and validate that the pings do not succeed
200 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800201 [Tags] functionalDt DisableEnableONUDt soak
Andy Baviere187eda2020-04-20 15:00:02 -0700202 [Setup] Start Logging DisableEnableONUDt
Hardik Windlass63d5e002020-03-06 21:07:09 +0530203 [Teardown] Run Keywords Collect Logs
204 ... AND Stop Logging DisableEnableONUDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800205 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530206 ${src}= Set Variable ${hosts.src[${I}]}
207 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800208 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530209 ${onu_device_id}= Get Device ID From SN ${src['onu']}
210 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
211 ... ${of_id}
212 Disable Device ${onu_device_id}
213 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
214 ... Validate Device DISABLED UNKNOWN
215 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock
216 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700217 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530218 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530219 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
220 ... Wait Until Keyword Succeeds 60s 2s
221 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
222 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
223 Sleep 5s
224 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700225 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530226 ... Validate Device ENABLED ACTIVE
227 ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled
228 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700229 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530230 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530231 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
232 ... Wait Until Keyword Succeeds 60s 2s
233 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
234 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530235 END
236
Hardik Windlassaaea3402020-03-10 19:45:45 +0530237Test Disable and Delete OLT for DT
238 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
239 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
240 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
241 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Suchitra Vemurif2388ad2020-03-15 21:44:44 -0700242 [Tags] functionalDt DisableDeleteOLTDt
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700243 [Setup] Start Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530244 [Teardown] Run Keywords Collect Logs
245 ... AND Stop Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530246 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800247 FOR ${I} IN RANGE 0 ${olt_count}
248 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
249 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
250 Disable Device ${olt_device_id}
251 ${of_id}= Get ofID From OLT List ${olt_serial_number}
252 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
253 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
254 ... ${olt_serial_number}
255 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
256 ... ${olt_serial_number}
257 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
258 # Validate ONUs
259 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
Andrea Campanella4e507882020-11-26 11:33:11 +0100260 ... ${num_onus} ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800261 # Verify ONOS Flows
262 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
263 ${onos_flows_count}= Evaluate 4 * ${num_onus}
264 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
265 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
266 ... ${of_id} ${onos_flows_count}
267 # Verify VOLTHA Flows
268 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
269 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
270 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
271 ${onu_flows}= Set Variable 2
272 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
273 ... ${olt_device_id}
274 ${List_ONU_Serial} Create List
275 Set Suite Variable ${List_ONU_Serial}
Andrea Campanella99a548b2020-11-18 09:50:32 +0100276 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} ${num_onus}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800277 Log ${List_ONU_Serial}
278 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
279 ... ${List_ONU_Serial} ${onu_flows}
280 # Delete OLT and Validate Empty Device List
281 Delete Device ${olt_device_id}
Andrea Campanella4e507882020-11-26 11:33:11 +0100282 # Check that the OLT and the ONUs are actually removed from the system
283 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed
284 ... ${olt_serial_number}
285 Run Keyword and Continue On Failure Validate all ONUS for OLT Removed ${num_all_onus} ${hosts}
286 ... ${olt_serial_number} ${timeout}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800287 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
288 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800289 END
Hardik Windlassaaea3402020-03-10 19:45:45 +0530290 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
291 Run Keyword Setup
Suchitra Vemuriae9cecb2020-03-12 12:59:14 -0700292 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800293 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
294 #Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlassaaea3402020-03-10 19:45:45 +0530295
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530296Test Disable and Enable OLT for DT
297 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
298 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
299 ... Perform disable on the OLT and validate that the pings do not succeed
300 ... Perform enable on the OLT and validate that the pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800301 [Tags] functionalDt DisableEnableOLTDt soak
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530302 [Setup] Start Logging DisableEnableOLTDt
303 [Teardown] Run Keywords Collect Logs
304 ... AND Stop Logging DisableEnableOLTDt
305 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800306 FOR ${I} IN RANGE 0 ${olt_count}
307 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
308 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
309 ${rc} ${output}= Run and Return Rc and Output
310 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
311 Should Be Equal As Integers ${rc} 0
312 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
313 ... ${olt_serial_number}
314 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800315 # Validate ONUs
316 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530317 ${src}= Set Variable ${hosts.src[${I}]}
318 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800319 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530320 ${onu_device_id}= Get Device ID From SN ${src['onu']}
321 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
322 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
323 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700324 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530325 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
326 ... Wait Until Keyword Succeeds 60s 2s
327 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
328 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
329 # Remove Subscriber Access (To replicate DT workflow)
330 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
331 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
332 # Delete ONU Device (To replicate DT workflow)
333 Delete Device ${onu_device_id}
334 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530335 Sleep 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530336 # Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800337 FOR ${I} IN RANGE 0 ${olt_count}
338 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
339 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
340 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800341 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
342 ... ${olt_serial_number}
343 #TODO: Update for PON_OLT ETHERNET_NNI
344 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
345 #... PON_OLT ETHERNET_NNI
346 END
Hardik Windlass7c801e62020-05-04 19:33:21 +0530347 # Waiting extra time for the ONUs to come up
348 Sleep 60s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800349 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass7c801e62020-05-04 19:33:21 +0530350 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530351
352Test Delete and ReAdd OLT for DT
353 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
354 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
355 ... Disable and Delete the OLT
356 ... Create/Enable the same OLT again
357 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
358 [Tags] functionalDt DeleteReAddOLTDt
359 [Setup] Start Logging DeleteReAddOLTDt
360 [Teardown] Run Keywords Collect Logs
361 ... AND Stop Logging DeleteReAddOLTDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800362 FOR ${I} IN RANGE 0 ${olt_count}
363 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
364 ${of_id}= Get ofID From OLT List ${olt_serial_number}
365 Delete Device and Verify ${olt_serial_number}
366 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
367 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800368 END
369 # Recreate the OLTs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530370 Setup
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800371 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530372 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
373
374Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
375 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
376 ... This TC is to confirm that ONU removal is not impacting OLT
377 ... Devices will be removed during the execution of this TC
378 ... so calling setup at the end to add the devices back to avoid the confusion.
379 [Tags] functionalDt DisableDeleteONUOLTDt
380 [Setup] Start Logging DisableDeleteONUOLTDt
381 [Teardown] Run Keywords Collect Logs
382 ... AND Stop Logging DisableDeleteONUOLTDt
Suchitra Vemuri02170552021-03-23 16:40:50 -0700383 @{onu_reason}= Create List initial-mib-downloaded omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800384 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530385 ${src}= Set Variable ${hosts.src[${I}]}
386 ${dst}= Set Variable ${hosts.dst[${I}]}
387 ${onu_device_id}= Get Device ID From SN ${src['onu']}
388 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
389 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700390 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530391 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
392 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800393 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530394 Disable Device ${onu_device_id}
395 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
396 ... Validate Device DISABLED UNKNOWN
397 ... REACHABLE ${src['onu']} onu=false
398 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
399 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800400 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530401 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800402 # Disable all OLTs
403 FOR ${I} IN RANGE 0 ${olt_count}
404 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
405 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
406 ${rc} ${output}= Run and Return Rc and Output
407 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
408 Should Be Equal As Integers ${rc} 0
409 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
410 ... ${olt_serial_number}
411 END
412 # Validate ONUs after OLT disable
413 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530414 ${src}= Set Variable ${hosts.src[${I}]}
415 ${dst}= Set Variable ${hosts.dst[${I}]}
416 ${onu_device_id}= Get Device ID From SN ${src['onu']}
417 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
418 ... Validate Device DISABLED DISCOVERED
419 ... UNREACHABLE ${src['onu']} onu=false
420 Delete Device ${onu_device_id}
421 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
422 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800423 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530424 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800425 # Delete all OLTs
426 Delete All Devices and Verify
427
428 #Delete Device ${olt_device_id}
429 #TODO: Fix the following assertion
430 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
431 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
432 #... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
433
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530434 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
435 Run Keyword Setup
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800436 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530437 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530438
Andy Baviere19991a2020-05-08 10:42:40 -0700439Data plane verification using TCP for DT
440 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
441 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Hardik Windlass62db9d92021-05-17 09:32:40 +0000442 [Tags] dataplaneDt BandwidthProfileTCPDt VOL-3061 soakDataplane
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700443 [Setup] Start Logging BandwidthProfileTCPDt
444 [Teardown] Run Keywords Collect Logs
445 ... AND Stop Logging BandwidthProfileTCPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700446 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
447 ... physical pod. Skipping this test in BBSIM.
Hardik Windlass62db9d92021-05-17 09:32:40 +0000448 Run Keyword If 'SOAK_TEST'=='False' Clear All Devices Then Create New Device
449 ... ELSE Setup Soak
Suchitra Vemuria4e3e072020-11-06 14:23:47 -0800450 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria4e3e072020-11-06 14:23:47 -0800451 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
452
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800453 #${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
454 #... ${olt_serial_number}
455 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700456 ${src}= Set Variable ${hosts.src[${I}]}
457 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800458 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700459 # Check for iperf3 and jq tools
460 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
461 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
462 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
463
Andy Baviere19991a2020-05-08 10:42:40 -0700464 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
465 ... ${of_id}
466 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
467 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
468 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700469 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Andy Baviere19991a2020-05-08 10:42:40 -0700470 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
471 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700472 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Andy Baviere19991a2020-05-08 10:42:40 -0700473
474 # Stream TCP packets from RG to server
475 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
476 ... args=-t 30
477 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
478
479 # Stream TCP packets from server to RG
480 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
481 ... args=-R -t 30
482 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
483
484 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
485 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
486 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
487 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
488
489 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
490 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700491 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
492 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
493 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700494 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
495 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
496 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
497 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
498 END
499
500Data plane verification using UDP for DT
501 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
502 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Hardik Windlass62db9d92021-05-17 09:32:40 +0000503 [Tags] dataplaneDt BandwidthProfileUDPDt VOL-3061 soakDataplane
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700504 [Setup] Start Logging BandwidthProfileUDPDt
505 [Teardown] Run Keywords Collect Logs
506 ... AND Stop Logging BandwidthProfileUDPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700507 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
508 ... physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800509 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700510 ${src}= Set Variable ${hosts.src[${I}]}
511 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800512 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700513
514 # Check for iperf3 and jq tools
515 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
516 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
517 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
518
Andy Baviere19991a2020-05-08 10:42:40 -0700519 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
520 ... ${of_id}
521 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
522 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
523 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700524 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Andy Baviere19991a2020-05-08 10:42:40 -0700525 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
526 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700527 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Andy Baviere19991a2020-05-08 10:42:40 -0700528
529 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200530 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
531 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200532 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200533 ... Set Variable ${limiting_bw_value_upstream}
Andrea Campanella580e0492020-08-05 15:35:48 +0200534
Andy Baviere19991a2020-05-08 10:42:40 -0700535 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700536 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700537 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
538 ${actual_upstream_bw_used}= Evaluate
539 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
540
541 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200542 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
543 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200544 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200545 ... Set Variable ${limiting_bw_value_dnstream}
Andy Baviere19991a2020-05-08 10:42:40 -0700546 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700547 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700548 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
549 ${actual_dnstream_bw_used}= Evaluate
550 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
551
552 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
553 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
554 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
555 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
556
557 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
558 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700559 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
560 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
561 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700562 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
563 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
564 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
565 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
566 END
567
Andy Bavier7613b9a2020-07-08 07:25:47 -0700568Validate parsing of data traffic through voltha using tech profile
569 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
570 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
571 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700572 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Andy Bavier7613b9a2020-07-08 07:25:47 -0700573 ... the pbits are preserved by the PON.
Hardik Windlass62db9d92021-05-17 09:32:40 +0000574 [Tags] dataplaneDt TechProfileDt VOL-3291 soakDataplane
Andy Bavier7613b9a2020-07-08 07:25:47 -0700575 [Setup] Start Logging TechProfileDt
576 [Teardown] Run Keywords Collect Logs
577 ... AND Stop Logging TechProfileDt
578 Pass Execution If '${has_dataplane}'=='False'
579 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800580 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700581 ${src}= Set Variable ${hosts.src[${I}]}
582 ${dst}= Set Variable ${hosts.dst[${I}]}
583
Andy Bavier275414a2020-07-16 13:07:17 -0700584 ${src_iface_name}= Fetch From Left ${src['dp_iface_name']} .
585
Andy Bavier7613b9a2020-07-08 07:25:47 -0700586 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
587 ${bng_user}= Get Variable Value ${dst['noroot_user']}
588 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
589 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
590 ... Skipping test: credentials for BNG login required in deployment config
591
592 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
593 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
594 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
595 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
596 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
597 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
598 Log Upstream test
599 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700600 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src_iface_name}
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700601 ... 0 tcp ${src['c_tag']} vlan
Andy Bavier7613b9a2020-07-08 07:25:47 -0700602 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
603 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
604 Log Downstream test
605 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
606 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
607 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
608 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
609 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700610 ... ${rg_ip} ${src_iface_name} ${dst['dp_iface_name']}.${src['s_tag']}
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700611 ... 0 tcp ${src['c_tag']} tcp
Andy Bavier7613b9a2020-07-08 07:25:47 -0700612 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
613 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
614 END
615
Hardik Windlass16cdf962020-04-29 15:26:50 +0530616Test Disable and Enable OLT PON Port for DT
617 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
618 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
619 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
620 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass41701e82021-01-12 17:44:44 +0000621 [Tags] functionalDt DisableEnableOltPonPortDt VOL-2577
Hardik Windlass16cdf962020-04-29 15:26:50 +0530622 [Setup] Start Logging DisableEnableOltPonPortDt
623 [Teardown] Run Keywords Collect Logs
624 ... AND Stop Logging DisableEnableOltPonPortDt
Hardik Windlass41701e82021-01-12 17:44:44 +0000625 FOR ${I} IN RANGE 0 ${olt_count}
626 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
627 Disable Enable PON Port Per OLT DT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530628 END
629
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000630*** Keywords ***
631Setup Suite
632 [Documentation] Set up the test suite
633 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700634 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800635 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700636 #power_switch.robot needs it to support different vendor's power switch
637 ${switch_type}= Get Variable Value ${web_power_switch.type}
638 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000639
640Clear All Devices Then Create New Device
641 [Documentation] Remove any devices from VOLTHA and ONOS
642 # Remove all devices from voltha and nos
643 Delete All Devices and Verify
644 # Execute normal test Setup Keyword
645 Setup