blob: be3c2972369c0171d2437cd8968a662c045906a9 [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 Windlass43531332021-05-19 07:07:03 +000066# logging flag to enable Collect Logs, can be passed via the command line too
67# example: -v logging:False
68${logging} True
69
Hardik Windlass4ed54502021-05-14 07:34:15 +000070# Flag specific to Soak Jobs
71${SOAK_TEST} False
72${bbsim_port} 50060
73
Hardik Windlassa3d04b92020-02-17 15:06:05 +000074*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070075Reboot DT ONUs Physically
76 [Documentation] This test reboots ONUs physically before execution all the tests
77 ... Test case runs only on the PODs that are configured with PowerSwitch that
78 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
Suchitra Vemuri228f8802021-03-10 13:14:17 -080079 [Tags] functionalDt PowerSwitch RebootAllDTONUs soak
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070080 [Setup] Start Logging RebootAllDTONUs
Hardik Windlass43531332021-05-19 07:07:03 +000081 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070082 ... AND Stop Logging RebootAllDTONUs
83 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080084 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070085 ${src}= Set Variable ${hosts.src[${I}]}
86 ${dst}= Set Variable ${hosts.dst[${I}]}
87 Disable Switch Outlet ${src['power_switch_port']}
Hardik Windlass5e214b22021-02-26 10:37:14 +000088 Sleep 10s
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070089 Enable Switch Outlet ${src['power_switch_port']}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070090 END
91
Hardik Windlass4ed54502021-05-14 07:34:15 +000092Create Soak BBSim Device
93 [Documentation] This creates and enables the BBSim device as required by the soak testing
94 ... The BBSim OLT and ONUs created as part of this test are not part of active testing
95 ... but only to mock the load on Soak POD.
96 [Tags] soak
97 [Setup] Start Logging soakPodCreateBBSimLoad
Hardik Windlass43531332021-05-19 07:07:03 +000098 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass4ed54502021-05-14 07:34:15 +000099 ... AND Stop Logging soakPodCreateBBSimLoad
100 ${num_bbsim} Get Length ${bbsim}
101 FOR ${I} IN RANGE 0 ${num_bbsim}
102 ${ip} Evaluate ${bbsim}[${I}].get("ip")
103 ${serial_number} Evaluate ${bbsim}[${I}].get("serial")
104 ${bbsim_olt_device_id}= Create Device ${ip} ${bbsim_port}
105 Log ${bbsim_olt_device_id}
106 Wait Until Keyword Succeeds ${timeout} 5s
107 ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${bbsim_olt_device_id}
108 Enable Device ${bbsim_olt_device_id}
109 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
110 ... Validate OLT Device ENABLED ACTIVE REACHABLE ${serial_number}
111 ${olt_of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
112 ... ${serial_number}
113 Log ${olt_of_id}
114 END
115 # Extra sleep time for ONUs to come up Active
116 Sleep 30s
117
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000118Sanity E2E Test for OLT/ONU on POD for DT
119 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
120 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
121 ... Traffic sent with same vlan from different RGs,
122 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
123 ... Inner vlans from the RG should not change
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800124 [Tags] sanityDt soak
Hardik Windlass4ed54502021-05-14 07:34:15 +0000125 [Setup] Start Logging SanityTestDt
Hardik Windlass43531332021-05-19 07:07:03 +0000126 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000127 ... AND Stop Logging SanityTestDt
Hardik Windlass4ed54502021-05-14 07:34:15 +0000128 Setup ${SOAK_TEST}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000129 Run Keyword If ${has_dataplane} Clean Up Linux
130 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
131
Hardik Windlass35706ba2020-02-20 08:16:42 +0000132Test Subscriber Delete and Add for DT
133 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
Hardik Windlass63d5e002020-03-06 21:07:09 +0530134 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000135 ... Delete a subscriber and validate that the pings do not succeed and state is purged
136 ... Disable and Enable the ONU (This is to replicate the existing DT behaviour)
137 ... Re-add the subscriber, and validate that the flows are present and pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800138 [Tags] functionalDt SubAddDeleteDt soak
Andy Baviere187eda2020-04-20 15:00:02 -0700139 [Setup] Start Logging SubAddDeleteDt
Hardik Windlass43531332021-05-19 07:07:03 +0000140 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass35706ba2020-02-20 08:16:42 +0000141 ... AND Stop Logging SubAddDeleteDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800142 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000143 ${src}= Set Variable ${hosts.src[${I}]}
144 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800145 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000146 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800147 ${olt_device_id}= Get OLTDeviceID From OLT List ${src['olt']}
Andrea Campanellad848de02020-11-24 10:23:41 +0100148 ${num_of_olt_onus}= Get Num of Onus From OLT SN ${src['olt']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000149 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
150 ... ${of_id}
151 # Remove Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -0800152 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000153 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000154 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
155 ... Wait Until Keyword Succeeds 60s 2s
156 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
157 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Andrea Campanellad848de02020-11-24 10:23:41 +0100158
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530159 # 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 +0100160 ${onos_flows_count}= Evaluate 4 * ( ${num_of_olt_onus} - 1 )
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530161 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
162 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Suchitra Vemuri93db32b2020-11-23 21:27:05 -0800163 ... ${of_id} ${onos_flows_count}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000164 # 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 +0100165 ${olt_flows}= Evaluate 2 * ( ${num_of_olt_onus} - 1 ) + 1
Hardik Windlass35706ba2020-02-20 08:16:42 +0000166 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800167 ... ${olt_device_id}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000168 # Verify VOLTHA flows for ONU under test is Zero
169 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
170 ... ${onu_device_id} 0
171 # Disable and Re-Enable the ONU (To replicate DT current workflow)
172 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
173 Disable Device ${onu_device_id}
174 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
175 ... Validate Device DISABLED UNKNOWN
176 ... REACHABLE ${src['onu']}
177 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700178 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000179 ... Validate Device ENABLED ACTIVE
180 ... REACHABLE ${src['onu']}
181 # Add Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -0800182 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000183 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530184 # Verify subscriber access flows are added for the ONU port
185 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530186 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
187 ... ${onu_port} ${nni_port} ${src['s_tag']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700188 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000189 ... Validate Device ENABLED ACTIVE
190 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530191 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000192 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
193 ... Wait Until Keyword Succeeds 60s 2s
194 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
195 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000196 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800197 # Verify flows for all OLTs
198 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
Hardik Windlass35706ba2020-02-20 08:16:42 +0000199
Hardik Windlass63d5e002020-03-06 21:07:09 +0530200Test Disable and Enable ONU for DT
201 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
202 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
203 ... Perform disable on the ONUs and validate that the pings do not succeed
204 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800205 [Tags] functionalDt DisableEnableONUDt soak
Andy Baviere187eda2020-04-20 15:00:02 -0700206 [Setup] Start Logging DisableEnableONUDt
Hardik Windlass43531332021-05-19 07:07:03 +0000207 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass63d5e002020-03-06 21:07:09 +0530208 ... AND Stop Logging DisableEnableONUDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800209 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530210 ${src}= Set Variable ${hosts.src[${I}]}
211 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800212 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530213 ${onu_device_id}= Get Device ID From SN ${src['onu']}
214 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
215 ... ${of_id}
216 Disable Device ${onu_device_id}
217 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
218 ... Validate Device DISABLED UNKNOWN
219 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock
220 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700221 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530222 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530223 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
224 ... Wait Until Keyword Succeeds 60s 2s
225 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
226 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
227 Sleep 5s
228 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700229 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530230 ... Validate Device ENABLED ACTIVE
231 ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled
232 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700233 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
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
236 ... Wait Until Keyword Succeeds 60s 2s
237 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
238 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530239 END
240
Hardik Windlassaaea3402020-03-10 19:45:45 +0530241Test Disable and Delete OLT for DT
242 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
243 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
244 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
245 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Hardik Windlass43531332021-05-19 07:07:03 +0000246 [Tags] functionalDt DisableDeleteOLTDt soak
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700247 [Setup] Start Logging DisableDeleteOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000248 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlassaaea3402020-03-10 19:45:45 +0530249 ... AND Stop Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530250 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800251 FOR ${I} IN RANGE 0 ${olt_count}
252 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
253 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
254 Disable Device ${olt_device_id}
255 ${of_id}= Get ofID From OLT List ${olt_serial_number}
256 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
257 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
258 ... ${olt_serial_number}
259 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
260 ... ${olt_serial_number}
261 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
262 # Validate ONUs
263 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
Andrea Campanella4e507882020-11-26 11:33:11 +0100264 ... ${num_onus} ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800265 # Verify ONOS Flows
266 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
267 ${onos_flows_count}= Evaluate 4 * ${num_onus}
268 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
269 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
270 ... ${of_id} ${onos_flows_count}
271 # Verify VOLTHA Flows
272 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
273 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
274 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
275 ${onu_flows}= Set Variable 2
276 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
277 ... ${olt_device_id}
278 ${List_ONU_Serial} Create List
279 Set Suite Variable ${List_ONU_Serial}
Andrea Campanella99a548b2020-11-18 09:50:32 +0100280 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} ${num_onus}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800281 Log ${List_ONU_Serial}
282 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
283 ... ${List_ONU_Serial} ${onu_flows}
284 # Delete OLT and Validate Empty Device List
285 Delete Device ${olt_device_id}
Andrea Campanella4e507882020-11-26 11:33:11 +0100286 # Check that the OLT and the ONUs are actually removed from the system
287 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed
288 ... ${olt_serial_number}
289 Run Keyword and Continue On Failure Validate all ONUS for OLT Removed ${num_all_onus} ${hosts}
290 ... ${olt_serial_number} ${timeout}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800291 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
292 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800293 END
Hardik Windlassaaea3402020-03-10 19:45:45 +0530294 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Hardik Windlass43531332021-05-19 07:07:03 +0000295 Run Keyword Setup ${SOAK_TEST}
Suchitra Vemuriae9cecb2020-03-12 12:59:14 -0700296 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800297 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
298 #Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlassaaea3402020-03-10 19:45:45 +0530299
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530300Test Disable and Enable OLT for DT
301 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
302 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
303 ... Perform disable on the OLT and validate that the pings do not succeed
304 ... Perform enable on the OLT and validate that the pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800305 [Tags] functionalDt DisableEnableOLTDt soak
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530306 [Setup] Start Logging DisableEnableOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000307 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530308 ... AND Stop Logging DisableEnableOLTDt
309 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800310 FOR ${I} IN RANGE 0 ${olt_count}
311 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
312 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
313 ${rc} ${output}= Run and Return Rc and Output
314 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
315 Should Be Equal As Integers ${rc} 0
316 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
317 ... ${olt_serial_number}
318 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800319 # Validate ONUs
320 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530321 ${src}= Set Variable ${hosts.src[${I}]}
322 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800323 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530324 ${onu_device_id}= Get Device ID From SN ${src['onu']}
325 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
326 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
327 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700328 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530329 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
330 ... Wait Until Keyword Succeeds 60s 2s
331 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
332 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
333 # Remove Subscriber Access (To replicate DT workflow)
334 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
335 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
336 # Delete ONU Device (To replicate DT workflow)
337 Delete Device ${onu_device_id}
338 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530339 Sleep 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530340 # Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800341 FOR ${I} IN RANGE 0 ${olt_count}
342 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
343 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
344 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800345 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
346 ... ${olt_serial_number}
347 #TODO: Update for PON_OLT ETHERNET_NNI
348 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
349 #... PON_OLT ETHERNET_NNI
350 END
Hardik Windlass7c801e62020-05-04 19:33:21 +0530351 # Waiting extra time for the ONUs to come up
352 Sleep 60s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800353 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass7c801e62020-05-04 19:33:21 +0530354 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530355
356Test Delete and ReAdd OLT for DT
357 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
358 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
359 ... Disable and Delete the OLT
360 ... Create/Enable the same OLT again
361 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
Hardik Windlass43531332021-05-19 07:07:03 +0000362 [Tags] functionalDt DeleteReAddOLTDt soak
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530363 [Setup] Start Logging DeleteReAddOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000364 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530365 ... AND Stop Logging DeleteReAddOLTDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800366 FOR ${I} IN RANGE 0 ${olt_count}
367 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
368 ${of_id}= Get ofID From OLT List ${olt_serial_number}
369 Delete Device and Verify ${olt_serial_number}
370 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
371 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800372 END
373 # Recreate the OLTs
Hardik Windlass43531332021-05-19 07:07:03 +0000374 Setup ${SOAK_TEST}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800375 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530376 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
377
378Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
379 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
380 ... This TC is to confirm that ONU removal is not impacting OLT
381 ... Devices will be removed during the execution of this TC
382 ... so calling setup at the end to add the devices back to avoid the confusion.
383 [Tags] functionalDt DisableDeleteONUOLTDt
384 [Setup] Start Logging DisableDeleteONUOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000385 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530386 ... AND Stop Logging DisableDeleteONUOLTDt
Suchitra Vemuri02170552021-03-23 16:40:50 -0700387 @{onu_reason}= Create List initial-mib-downloaded omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800388 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530389 ${src}= Set Variable ${hosts.src[${I}]}
390 ${dst}= Set Variable ${hosts.dst[${I}]}
391 ${onu_device_id}= Get Device ID From SN ${src['onu']}
392 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
393 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700394 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530395 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
396 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800397 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530398 Disable Device ${onu_device_id}
399 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
400 ... Validate Device DISABLED UNKNOWN
401 ... REACHABLE ${src['onu']} onu=false
402 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
403 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800404 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530405 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800406 # Disable all OLTs
407 FOR ${I} IN RANGE 0 ${olt_count}
408 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
409 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
410 ${rc} ${output}= Run and Return Rc and Output
411 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
412 Should Be Equal As Integers ${rc} 0
413 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
414 ... ${olt_serial_number}
415 END
416 # Validate ONUs after OLT disable
417 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530418 ${src}= Set Variable ${hosts.src[${I}]}
419 ${dst}= Set Variable ${hosts.dst[${I}]}
420 ${onu_device_id}= Get Device ID From SN ${src['onu']}
421 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
422 ... Validate Device DISABLED DISCOVERED
423 ... UNREACHABLE ${src['onu']} onu=false
424 Delete Device ${onu_device_id}
425 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
426 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800427 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530428 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800429 # Delete all OLTs
430 Delete All Devices and Verify
431
432 #Delete Device ${olt_device_id}
433 #TODO: Fix the following assertion
434 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
435 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
436 #... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
437
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530438 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
439 Run Keyword Setup
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800440 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530441 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530442
Andy Baviere19991a2020-05-08 10:42:40 -0700443Data plane verification using TCP for DT
444 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
445 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Hardik Windlass62db9d92021-05-17 09:32:40 +0000446 [Tags] dataplaneDt BandwidthProfileTCPDt VOL-3061 soakDataplane
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700447 [Setup] Start Logging BandwidthProfileTCPDt
Hardik Windlass43531332021-05-19 07:07:03 +0000448 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700449 ... AND Stop Logging BandwidthProfileTCPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700450 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
451 ... physical pod. Skipping this test in BBSIM.
Hardik Windlass3280f2d2021-05-20 07:38:31 +0000452 Run Keyword If '${SOAK_TEST}'=='False' Clear All Devices Then Create New Device
Hardik Windlass62db9d92021-05-17 09:32:40 +0000453 ... ELSE Setup Soak
Suchitra Vemuria4e3e072020-11-06 14:23:47 -0800454 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria4e3e072020-11-06 14:23:47 -0800455 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
456
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800457 #${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
458 #... ${olt_serial_number}
459 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700460 ${src}= Set Variable ${hosts.src[${I}]}
461 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800462 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700463 # Check for iperf3 and jq tools
464 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
465 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
466 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
467
Andy Baviere19991a2020-05-08 10:42:40 -0700468 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
469 ... ${of_id}
470 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
471 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
472 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700473 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Andy Baviere19991a2020-05-08 10:42:40 -0700474 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
475 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700476 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Andy Baviere19991a2020-05-08 10:42:40 -0700477
478 # Stream TCP packets from RG to server
479 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
480 ... args=-t 30
481 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
482
483 # Stream TCP packets from server to RG
484 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
485 ... args=-R -t 30
486 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
487
488 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
489 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
490 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
491 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
492
493 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
494 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700495 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
496 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
497 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700498 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
499 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
500 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
501 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
502 END
503
504Data plane verification using UDP for DT
505 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
506 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Hardik Windlass62db9d92021-05-17 09:32:40 +0000507 [Tags] dataplaneDt BandwidthProfileUDPDt VOL-3061 soakDataplane
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700508 [Setup] Start Logging BandwidthProfileUDPDt
Hardik Windlass43531332021-05-19 07:07:03 +0000509 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700510 ... AND Stop Logging BandwidthProfileUDPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700511 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
512 ... physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800513 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700514 ${src}= Set Variable ${hosts.src[${I}]}
515 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800516 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700517
518 # Check for iperf3 and jq tools
519 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
520 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
521 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
522
Andy Baviere19991a2020-05-08 10:42:40 -0700523 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
524 ... ${of_id}
525 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
526 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
527 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700528 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Andy Baviere19991a2020-05-08 10:42:40 -0700529 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
530 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700531 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Andy Baviere19991a2020-05-08 10:42:40 -0700532
533 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200534 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
535 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200536 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200537 ... Set Variable ${limiting_bw_value_upstream}
Andrea Campanella580e0492020-08-05 15:35:48 +0200538
Andy Baviere19991a2020-05-08 10:42:40 -0700539 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700540 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700541 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
542 ${actual_upstream_bw_used}= Evaluate
543 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
544
545 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200546 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
547 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200548 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200549 ... Set Variable ${limiting_bw_value_dnstream}
Andy Baviere19991a2020-05-08 10:42:40 -0700550 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700551 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700552 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
553 ${actual_dnstream_bw_used}= Evaluate
554 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
555
556 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
557 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
558 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
559 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
560
561 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
562 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700563 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
564 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
565 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700566 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
567 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
568 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
569 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
570 END
571
Andy Bavier7613b9a2020-07-08 07:25:47 -0700572Validate parsing of data traffic through voltha using tech profile
573 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
574 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
575 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700576 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Andy Bavier7613b9a2020-07-08 07:25:47 -0700577 ... the pbits are preserved by the PON.
Hardik Windlass62db9d92021-05-17 09:32:40 +0000578 [Tags] dataplaneDt TechProfileDt VOL-3291 soakDataplane
Andy Bavier7613b9a2020-07-08 07:25:47 -0700579 [Setup] Start Logging TechProfileDt
Hardik Windlass43531332021-05-19 07:07:03 +0000580 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavier7613b9a2020-07-08 07:25:47 -0700581 ... AND Stop Logging TechProfileDt
582 Pass Execution If '${has_dataplane}'=='False'
583 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800584 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700585 ${src}= Set Variable ${hosts.src[${I}]}
586 ${dst}= Set Variable ${hosts.dst[${I}]}
587
Andy Bavier275414a2020-07-16 13:07:17 -0700588 ${src_iface_name}= Fetch From Left ${src['dp_iface_name']} .
589
Andy Bavier7613b9a2020-07-08 07:25:47 -0700590 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
591 ${bng_user}= Get Variable Value ${dst['noroot_user']}
592 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
593 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
594 ... Skipping test: credentials for BNG login required in deployment config
595
596 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
597 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
598 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
599 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
600 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
601 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
602 Log Upstream test
603 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700604 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src_iface_name}
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700605 ... 0 tcp ${src['c_tag']} vlan
Andy Bavier7613b9a2020-07-08 07:25:47 -0700606 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
607 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
608 Log Downstream test
609 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
610 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
611 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
612 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
613 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700614 ... ${rg_ip} ${src_iface_name} ${dst['dp_iface_name']}.${src['s_tag']}
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700615 ... 0 tcp ${src['c_tag']} tcp
Andy Bavier7613b9a2020-07-08 07:25:47 -0700616 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
617 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
618 END
619
Hardik Windlass16cdf962020-04-29 15:26:50 +0530620Test Disable and Enable OLT PON Port for DT
621 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
622 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
623 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
624 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass43531332021-05-19 07:07:03 +0000625 [Tags] functionalDt DisableEnableOltPonPortDt VOL-2577 soak
Hardik Windlass16cdf962020-04-29 15:26:50 +0530626 [Setup] Start Logging DisableEnableOltPonPortDt
Hardik Windlass43531332021-05-19 07:07:03 +0000627 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass16cdf962020-04-29 15:26:50 +0530628 ... AND Stop Logging DisableEnableOltPonPortDt
Hardik Windlass41701e82021-01-12 17:44:44 +0000629 FOR ${I} IN RANGE 0 ${olt_count}
630 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
631 Disable Enable PON Port Per OLT DT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530632 END
633
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000634*** Keywords ***
635Setup Suite
636 [Documentation] Set up the test suite
637 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700638 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800639 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700640 #power_switch.robot needs it to support different vendor's power switch
641 ${switch_type}= Get Variable Value ${web_power_switch.type}
642 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000643
644Clear All Devices Then Create New Device
645 [Documentation] Remove any devices from VOLTHA and ONOS
646 # Remove all devices from voltha and nos
647 Delete All Devices and Verify
648 # Execute normal test Setup Keyword
649 Setup