blob: b954c11b6303b30518a49f713a6af0872a36e285 [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 Windlassa9b38262021-10-27 08:14:22 +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
Suchitra Vemurie9c6ca62020-07-27 16:44:53 -070049${timeout} 360s
Hardik Windlassa3d04b92020-02-17 15:06:05 +000050${of_id} 0
51${logical_id} 0
Andrea Campanella86e24062020-08-05 19:09:18 +020052${uprate} 0
53${dnrate} 0
Hardik Windlassa3d04b92020-02-17 15:06:05 +000054${has_dataplane} True
Hardik Windlassffbf0602020-04-24 23:14:45 +053055${teardown_device} True
Hardik Windlassa3d04b92020-02-17 15:06:05 +000056${scripts} ../../scripts
57
Andy Baviere19991a2020-05-08 10:42:40 -070058# For dataplane bandwidth testing
59${upper_margin_pct} 105 # Allow 5% over the limit
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080060${lower_margin_pct} 90 # Allow 8% under the limit
Andy Baviere19991a2020-05-08 10:42:40 -070061${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
Andy Bavierc80a2742020-08-28 10:59:05 -070062${udp_packet_bytes} 1470 # UDP payload in bytes
Andy Baviere19991a2020-05-08 10:42:40 -070063
Hardik Windlassa3d04b92020-02-17 15:06:05 +000064# Per-test logging on failure is turned off by default; set this variable to enable
65${container_log_dir} ${None}
66
Hardik Windlass43531332021-05-19 07:07:03 +000067# logging flag to enable Collect Logs, can be passed via the command line too
68# example: -v logging:False
69${logging} True
70
Hardik Windlass4ed54502021-05-14 07:34:15 +000071# Flag specific to Soak Jobs
72${SOAK_TEST} False
73${bbsim_port} 50060
74
Hardik Windlassa3d04b92020-02-17 15:06:05 +000075*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070076Reboot DT ONUs Physically
77 [Documentation] This test reboots ONUs physically before execution all the tests
78 ... Test case runs only on the PODs that are configured with PowerSwitch that
79 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
Suchitra Vemuri228f8802021-03-10 13:14:17 -080080 [Tags] functionalDt PowerSwitch RebootAllDTONUs soak
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070081 [Setup] Start Logging RebootAllDTONUs
Hardik Windlass43531332021-05-19 07:07:03 +000082 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070083 ... AND Stop Logging RebootAllDTONUs
84 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080085 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070086 ${src}= Set Variable ${hosts.src[${I}]}
87 ${dst}= Set Variable ${hosts.dst[${I}]}
88 Disable Switch Outlet ${src['power_switch_port']}
Hardik Windlass5e214b22021-02-26 10:37:14 +000089 Sleep 10s
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070090 Enable Switch Outlet ${src['power_switch_port']}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070091 END
92
Hardik Windlass4ed54502021-05-14 07:34:15 +000093Create Soak BBSim Device
94 [Documentation] This creates and enables the BBSim device as required by the soak testing
95 ... The BBSim OLT and ONUs created as part of this test are not part of active testing
96 ... but only to mock the load on Soak POD.
97 [Tags] soak
98 [Setup] Start Logging soakPodCreateBBSimLoad
Hardik Windlass43531332021-05-19 07:07:03 +000099 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass4ed54502021-05-14 07:34:15 +0000100 ... AND Stop Logging soakPodCreateBBSimLoad
101 ${num_bbsim} Get Length ${bbsim}
102 FOR ${I} IN RANGE 0 ${num_bbsim}
103 ${ip} Evaluate ${bbsim}[${I}].get("ip")
104 ${serial_number} Evaluate ${bbsim}[${I}].get("serial")
105 ${bbsim_olt_device_id}= Create Device ${ip} ${bbsim_port}
106 Log ${bbsim_olt_device_id}
107 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass8b446492021-06-10 06:25:23 +0000108 ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${bbsim_olt_device_id} by_dev_id=True
Hardik Windlass4ed54502021-05-14 07:34:15 +0000109 Enable Device ${bbsim_olt_device_id}
110 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
111 ... Validate OLT Device ENABLED ACTIVE REACHABLE ${serial_number}
112 ${olt_of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
113 ... ${serial_number}
114 Log ${olt_of_id}
115 END
116 # Extra sleep time for ONUs to come up Active
117 Sleep 30s
118
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000119Sanity E2E Test for OLT/ONU on POD for DT
120 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
121 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
122 ... Traffic sent with same vlan from different RGs,
123 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
124 ... Inner vlans from the RG should not change
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800125 [Tags] sanityDt soak
Hardik Windlass4ed54502021-05-14 07:34:15 +0000126 [Setup] Start Logging SanityTestDt
Hardik Windlass43531332021-05-19 07:07:03 +0000127 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000128 ... AND Stop Logging SanityTestDt
Hardik Windlass4ed54502021-05-14 07:34:15 +0000129 Setup ${SOAK_TEST}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000130 Run Keyword If ${has_dataplane} Clean Up Linux
131 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
132
Hardik Windlass35706ba2020-02-20 08:16:42 +0000133Test Subscriber Delete and Add for DT
134 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
Hardik Windlass63d5e002020-03-06 21:07:09 +0530135 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000136 ... Delete a subscriber and validate that the pings do not succeed and state is purged
137 ... Disable and Enable the ONU (This is to replicate the existing DT behaviour)
138 ... Re-add the subscriber, and validate that the flows are present and pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800139 [Tags] functionalDt SubAddDeleteDt soak
Andy Baviere187eda2020-04-20 15:00:02 -0700140 [Setup] Start Logging SubAddDeleteDt
Hardik Windlass43531332021-05-19 07:07:03 +0000141 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass35706ba2020-02-20 08:16:42 +0000142 ... AND Stop Logging SubAddDeleteDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800143 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000144 ${src}= Set Variable ${hosts.src[${I}]}
145 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800146 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000147 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800148 ${olt_device_id}= Get OLTDeviceID From OLT List ${src['olt']}
Andrea Campanellad848de02020-11-24 10:23:41 +0100149 ${num_of_olt_onus}= Get Num of Onus From OLT SN ${src['olt']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000150 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
151 ... ${of_id}
152 # Remove Subscriber Access
TorstenThieme4e2168e2021-06-22 14:01:47 +0000153 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000154 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000155 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
156 ... Wait Until Keyword Succeeds 60s 2s
157 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
158 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Andrea Campanellad848de02020-11-24 10:23:41 +0100159
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530160 # 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 +0100161 ${onos_flows_count}= Evaluate 4 * ( ${num_of_olt_onus} - 1 )
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530162 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
163 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Suchitra Vemuri93db32b2020-11-23 21:27:05 -0800164 ... ${of_id} ${onos_flows_count}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000165 # 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 +0100166 ${olt_flows}= Evaluate 2 * ( ${num_of_olt_onus} - 1 ) + 1
Hardik Windlass35706ba2020-02-20 08:16:42 +0000167 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800168 ... ${olt_device_id}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000169 # Verify VOLTHA flows for ONU under test is Zero
170 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
171 ... ${onu_device_id} 0
172 # Disable and Re-Enable the ONU (To replicate DT current workflow)
173 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
174 Disable Device ${onu_device_id}
175 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
176 ... Validate Device DISABLED UNKNOWN
177 ... REACHABLE ${src['onu']}
178 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700179 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000180 ... Validate Device ENABLED ACTIVE
181 ... REACHABLE ${src['onu']}
182 # Add Subscriber Access
TorstenThieme4e2168e2021-06-22 14:01:47 +0000183 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000184 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530185 # Verify subscriber access flows are added for the ONU port
186 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530187 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
188 ... ${onu_port} ${nni_port} ${src['s_tag']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700189 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000190 ... Validate Device ENABLED ACTIVE
191 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530192 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000193 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
194 ... Wait Until Keyword Succeeds 60s 2s
195 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
196 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000197 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800198 # Verify flows for all OLTs
199 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
Hardik Windlass35706ba2020-02-20 08:16:42 +0000200
Hardik Windlass63d5e002020-03-06 21:07:09 +0530201Test Disable and Enable ONU for DT
202 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
203 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
204 ... Perform disable on the ONUs and validate that the pings do not succeed
205 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800206 [Tags] functionalDt DisableEnableONUDt soak
Andy Baviere187eda2020-04-20 15:00:02 -0700207 [Setup] Start Logging DisableEnableONUDt
Hardik Windlass43531332021-05-19 07:07:03 +0000208 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass63d5e002020-03-06 21:07:09 +0530209 ... AND Stop Logging DisableEnableONUDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800210 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530211 ${src}= Set Variable ${hosts.src[${I}]}
212 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800213 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530214 ${onu_device_id}= Get Device ID From SN ${src['onu']}
215 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
216 ... ${of_id}
217 Disable Device ${onu_device_id}
218 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
219 ... Validate Device DISABLED UNKNOWN
220 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock
221 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000222 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530223 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530224 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
225 ... Wait Until Keyword Succeeds 60s 2s
226 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
227 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
228 Sleep 5s
229 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700230 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530231 ... Validate Device ENABLED ACTIVE
232 ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled
233 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000234 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530235 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530236 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
237 ... Wait Until Keyword Succeeds 60s 2s
238 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
239 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530240 END
241
Hardik Windlassaaea3402020-03-10 19:45:45 +0530242Test Disable and Delete OLT for DT
243 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
244 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
245 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
246 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Hardik Windlass43531332021-05-19 07:07:03 +0000247 [Tags] functionalDt DisableDeleteOLTDt soak
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700248 [Setup] Start Logging DisableDeleteOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000249 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlassaaea3402020-03-10 19:45:45 +0530250 ... AND Stop Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530251 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800252 FOR ${I} IN RANGE 0 ${olt_count}
253 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
254 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
255 Disable Device ${olt_device_id}
256 ${of_id}= Get ofID From OLT List ${olt_serial_number}
257 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
258 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
259 ... ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800260 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
261 # Validate ONUs
262 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
Andrea Campanella4e507882020-11-26 11:33:11 +0100263 ... ${num_onus} ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800264 # Verify ONOS Flows
265 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
266 ${onos_flows_count}= Evaluate 4 * ${num_onus}
267 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
268 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
269 ... ${of_id} ${onos_flows_count}
270 # Verify VOLTHA Flows
271 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
272 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
273 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
274 ${onu_flows}= Set Variable 2
275 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
276 ... ${olt_device_id}
277 ${List_ONU_Serial} Create List
278 Set Suite Variable ${List_ONU_Serial}
Andrea Campanella99a548b2020-11-18 09:50:32 +0100279 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} ${num_onus}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800280 Log ${List_ONU_Serial}
281 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
282 ... ${List_ONU_Serial} ${onu_flows}
283 # Delete OLT and Validate Empty Device List
284 Delete Device ${olt_device_id}
Andrea Campanella4e507882020-11-26 11:33:11 +0100285 # Check that the OLT and the ONUs are actually removed from the system
286 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed
287 ... ${olt_serial_number}
288 Run Keyword and Continue On Failure Validate all ONUS for OLT Removed ${num_all_onus} ${hosts}
289 ... ${olt_serial_number} ${timeout}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800290 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
291 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800292 END
Hardik Windlassaaea3402020-03-10 19:45:45 +0530293 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Hardik Windlass43531332021-05-19 07:07:03 +0000294 Run Keyword Setup ${SOAK_TEST}
Suchitra Vemuriae9cecb2020-03-12 12:59:14 -0700295 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800296 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
297 #Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlassaaea3402020-03-10 19:45:45 +0530298
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530299Test Disable and Enable OLT for DT
300 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
301 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
302 ... Perform disable on the OLT and validate that the pings do not succeed
303 ... Perform enable on the OLT and validate that the pings are successful
Suchitra Vemuri228f8802021-03-10 13:14:17 -0800304 [Tags] functionalDt DisableEnableOLTDt soak
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530305 [Setup] Start Logging DisableEnableOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000306 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530307 ... AND Stop Logging DisableEnableOLTDt
308 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800309 FOR ${I} IN RANGE 0 ${olt_count}
310 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
311 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
312 ${rc} ${output}= Run and Return Rc and Output
313 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
314 Should Be Equal As Integers ${rc} 0
315 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
316 ... ${olt_serial_number}
317 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800318 # Validate ONUs
319 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530320 ${src}= Set Variable ${hosts.src[${I}]}
321 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800322 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530323 ${onu_device_id}= Get Device ID From SN ${src['onu']}
324 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
325 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
326 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000327 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530328 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
329 ... Wait Until Keyword Succeeds 60s 2s
330 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
331 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
332 # Remove Subscriber Access (To replicate DT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000333 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530334 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
335 # Delete ONU Device (To replicate DT workflow)
336 Delete Device ${onu_device_id}
337 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530338 Sleep 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530339 # Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800340 FOR ${I} IN RANGE 0 ${olt_count}
341 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
342 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
343 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800344 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
345 ... ${olt_serial_number}
346 #TODO: Update for PON_OLT ETHERNET_NNI
347 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
348 #... PON_OLT ETHERNET_NNI
349 END
Hardik Windlass7c801e62020-05-04 19:33:21 +0530350 # Waiting extra time for the ONUs to come up
351 Sleep 60s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800352 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass7c801e62020-05-04 19:33:21 +0530353 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530354
355Test Delete and ReAdd OLT for DT
356 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
357 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
358 ... Disable and Delete the OLT
359 ... Create/Enable the same OLT again
360 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
Hardik Windlass43531332021-05-19 07:07:03 +0000361 [Tags] functionalDt DeleteReAddOLTDt soak
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530362 [Setup] Start Logging DeleteReAddOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000363 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530364 ... AND Stop Logging DeleteReAddOLTDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800365 FOR ${I} IN RANGE 0 ${olt_count}
366 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
367 ${of_id}= Get ofID From OLT List ${olt_serial_number}
368 Delete Device and Verify ${olt_serial_number}
369 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
370 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800371 END
372 # Recreate the OLTs
Hardik Windlass43531332021-05-19 07:07:03 +0000373 Setup ${SOAK_TEST}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800374 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530375 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
376
377Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
378 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
379 ... This TC is to confirm that ONU removal is not impacting OLT
380 ... Devices will be removed during the execution of this TC
381 ... so calling setup at the end to add the devices back to avoid the confusion.
382 [Tags] functionalDt DisableDeleteONUOLTDt
383 [Setup] Start Logging DisableDeleteONUOLTDt
Hardik Windlass43531332021-05-19 07:07:03 +0000384 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530385 ... AND Stop Logging DisableDeleteONUOLTDt
Suchitra Vemuri02170552021-03-23 16:40:50 -0700386 @{onu_reason}= Create List initial-mib-downloaded omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800387 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530388 ${src}= Set Variable ${hosts.src[${I}]}
389 ${dst}= Set Variable ${hosts.dst[${I}]}
390 ${onu_device_id}= Get Device ID From SN ${src['onu']}
391 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
392 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700393 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530394 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
395 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800396 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530397 Disable Device ${onu_device_id}
398 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
399 ... Validate Device DISABLED UNKNOWN
400 ... REACHABLE ${src['onu']} onu=false
401 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
402 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800403 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530404 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800405 # Disable all OLTs
406 FOR ${I} IN RANGE 0 ${olt_count}
407 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
408 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
409 ${rc} ${output}= Run and Return Rc and Output
410 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
411 Should Be Equal As Integers ${rc} 0
412 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
413 ... ${olt_serial_number}
414 END
415 # Validate ONUs after OLT disable
416 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530417 ${src}= Set Variable ${hosts.src[${I}]}
418 ${dst}= Set Variable ${hosts.dst[${I}]}
419 ${onu_device_id}= Get Device ID From SN ${src['onu']}
420 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
421 ... Validate Device DISABLED DISCOVERED
422 ... UNREACHABLE ${src['onu']} onu=false
423 Delete Device ${onu_device_id}
424 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
425 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800426 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530427 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800428 # Delete all OLTs
429 Delete All Devices and Verify
430
431 #Delete Device ${olt_device_id}
432 #TODO: Fix the following assertion
433 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
434 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
435 #... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
436
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530437 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
438 Run Keyword Setup
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800439 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530440 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530441
Andy Baviere19991a2020-05-08 10:42:40 -0700442Data plane verification using TCP for DT
443 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
444 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200445 [Tags] non-critical dataplaneDt BandwidthProfileTCPDt VOL-3061 soakDataplane
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700446 [Setup] Start Logging BandwidthProfileTCPDt
Hardik Windlass43531332021-05-19 07:07:03 +0000447 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700448 ... AND Stop Logging BandwidthProfileTCPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700449 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
450 ... physical pod. Skipping this test in BBSIM.
Hardik Windlass3280f2d2021-05-20 07:38:31 +0000451 Run Keyword If '${SOAK_TEST}'=='False' Clear All Devices Then Create New Device
Hardik Windlass62db9d92021-05-17 09:32:40 +0000452 ... ELSE Setup Soak
Suchitra Vemuria4e3e072020-11-06 14:23:47 -0800453 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria4e3e072020-11-06 14:23:47 -0800454 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
455
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800456 #${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
457 #... ${olt_serial_number}
458 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700459 ${src}= Set Variable ${hosts.src[${I}]}
460 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800461 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700462 # Check for iperf3 and jq tools
463 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
464 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
465 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
466
Andy Baviere19991a2020-05-08 10:42:40 -0700467 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
468 ... ${of_id}
469 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
470 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
471 ... upstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700472 ${us_cir} ${us_cbs} ${us_pir} ${us_pbs} ${us_gir}= Get Bandwidth Profile Details Ietf Rest
473 ... ${bandwidth_profile_name}
474 ${limiting_bw_value_upstream}= Set Variable If ${us_pir} != 0 ${us_pir} ${us_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700475 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
476 ... downstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700477 ${ds_cir} ${ds_cbs} ${ds_pir} ${ds_pbs} ${ds_gir}= Get Bandwidth Profile Details Ietf Rest
478 ... ${bandwidth_profile_name}
479 ${limiting_bw_value_dnstream}= Set Variable If ${ds_pir} != 0 ${ds_pir} ${ds_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700480
481 # Stream TCP packets from RG to server
482 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
483 ... args=-t 30
484 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
485
486 # Stream TCP packets from server to RG
487 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
488 ... args=-R -t 30
489 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
490
491 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
492 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
493 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
494 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
495
496 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
497 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700498 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
499 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
500 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700501 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
502 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
503 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
504 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
505 END
506
507Data plane verification using UDP for DT
508 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
509 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200510 [Tags] non-critical dataplaneDt BandwidthProfileUDPDt VOL-3061 soakDataplane
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700511 [Setup] Start Logging BandwidthProfileUDPDt
Hardik Windlass43531332021-05-19 07:07:03 +0000512 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700513 ... AND Stop Logging BandwidthProfileUDPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700514 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
515 ... physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800516 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700517 ${src}= Set Variable ${hosts.src[${I}]}
518 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800519 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700520
521 # Check for iperf3 and jq tools
522 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
523 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
524 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
525
Andy Baviere19991a2020-05-08 10:42:40 -0700526 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
527 ... ${of_id}
528 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
529 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
530 ... upstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700531 ${us_cir} ${us_cbs} ${us_pir} ${us_pbs} ${us_gir}= Get Bandwidth Profile Details Ietf Rest
532 ... ${bandwidth_profile_name}
533 ${limiting_bw_value_upstream}= Set Variable If ${us_pir} != 0 ${us_pir} ${us_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700534 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
535 ... downstreamBandwidthProfile
Girish Gowdra21ec25d2021-05-24 10:07:01 -0700536 ${ds_cir} ${ds_cbs} ${ds_pir} ${ds_pbs} ${ds_gir}= Get Bandwidth Profile Details Ietf Rest
537 ... ${bandwidth_profile_name}
538 ${limiting_bw_value_dnstream}= Set Variable If ${ds_pir} != 0 ${ds_pir} ${ds_gir}
Andy Baviere19991a2020-05-08 10:42:40 -0700539
540 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200541 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
542 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200543 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200544 ... Set Variable ${limiting_bw_value_upstream}
Andrea Campanella580e0492020-08-05 15:35:48 +0200545
Andy Baviere19991a2020-05-08 10:42:40 -0700546 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700547 ... args=-u -b ${uprate}K -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_upstream_bw_used}= Evaluate
550 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
551
552 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200553 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
554 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200555 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200556 ... Set Variable ${limiting_bw_value_dnstream}
Andy Baviere19991a2020-05-08 10:42:40 -0700557 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700558 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700559 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
560 ${actual_dnstream_bw_used}= Evaluate
561 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
562
563 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
564 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
565 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
566 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
567
568 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
569 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700570 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
571 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
572 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700573 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
574 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
575 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
576 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
577 END
578
Andy Bavier7613b9a2020-07-08 07:25:47 -0700579Validate parsing of data traffic through voltha using tech profile
580 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
581 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
582 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700583 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Andy Bavier7613b9a2020-07-08 07:25:47 -0700584 ... the pbits are preserved by the PON.
Hardik Windlass62db9d92021-05-17 09:32:40 +0000585 [Tags] dataplaneDt TechProfileDt VOL-3291 soakDataplane
Andy Bavier7613b9a2020-07-08 07:25:47 -0700586 [Setup] Start Logging TechProfileDt
Hardik Windlass43531332021-05-19 07:07:03 +0000587 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Andy Bavier7613b9a2020-07-08 07:25:47 -0700588 ... AND Stop Logging TechProfileDt
589 Pass Execution If '${has_dataplane}'=='False'
590 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800591 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700592 ${src}= Set Variable ${hosts.src[${I}]}
593 ${dst}= Set Variable ${hosts.dst[${I}]}
594
Andy Bavier275414a2020-07-16 13:07:17 -0700595 ${src_iface_name}= Fetch From Left ${src['dp_iface_name']} .
596
Andy Bavier7613b9a2020-07-08 07:25:47 -0700597 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
598 ${bng_user}= Get Variable Value ${dst['noroot_user']}
599 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
600 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
601 ... Skipping test: credentials for BNG login required in deployment config
602
603 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
604 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
605 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
606 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
607 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
608 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
609 Log Upstream test
610 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700611 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src_iface_name}
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700612 ... 0 tcp ${src['c_tag']} ${src['s_tag']} upstream vlan
Andy Bavier7613b9a2020-07-08 07:25:47 -0700613 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
614 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
615 Log Downstream test
616 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
617 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
618 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
619 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
620 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700621 ... ${rg_ip} ${src_iface_name} ${dst['dp_iface_name']}
622 ... 0 tcp ${src['c_tag']} ${src['s_tag']} downstream tcp
Andy Bavier7613b9a2020-07-08 07:25:47 -0700623 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
624 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
625 END
626
Hardik Windlass16cdf962020-04-29 15:26:50 +0530627Test Disable and Enable OLT PON Port for DT
628 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
629 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
630 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
631 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass43531332021-05-19 07:07:03 +0000632 [Tags] functionalDt DisableEnableOltPonPortDt VOL-2577 soak
Hardik Windlass16cdf962020-04-29 15:26:50 +0530633 [Setup] Start Logging DisableEnableOltPonPortDt
Hardik Windlass43531332021-05-19 07:07:03 +0000634 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass16cdf962020-04-29 15:26:50 +0530635 ... AND Stop Logging DisableEnableOltPonPortDt
Hardik Windlass41701e82021-01-12 17:44:44 +0000636 FOR ${I} IN RANGE 0 ${olt_count}
637 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
638 Disable Enable PON Port Per OLT DT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530639 END
640
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000641*** Keywords ***
642Setup Suite
643 [Documentation] Set up the test suite
644 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700645 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800646 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700647 #power_switch.robot needs it to support different vendor's power switch
648 ${switch_type}= Get Variable Value ${web_power_switch.type}
649 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000650
651Clear All Devices Then Create New Device
652 [Documentation] Remove any devices from VOLTHA and ONOS
653 # Remove all devices from voltha and nos
654 Delete All Devices and Verify
655 # Execute normal test Setup Keyword
656 Setup