blob: e9299fff801690cd551ffb74ece601fb8812f1d9 [file] [log] [blame]
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -07001# 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 functional end-to-end scenarios for TT workflow
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
34Resource ../../libraries/power_switch.robot
35
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
48${timeout} 60s
49${of_id} 0
50${logical_id} 0
51${has_dataplane} True
Hardik Windlass04896f62021-03-05 16:15:11 +053052${teardown_device} True
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070053${scripts} ../../scripts
54
55# Per-test logging on failure is turned off by default; set this variable to enable
56${container_log_dir} ${None}
57
Emrehan UZUN62748282021-05-21 08:16:52 +000058${suppressaddsubscriber} True
59
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070060*** Test Cases ***
61Reboot TT ONUs Physically - Clean Up
62 [Documentation] This test reboots ONUs physically before execution all the tests
63 ... Test case runs only on the PODs that are configured with PowerSwitch that
64 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
Huseyin Ahmet AYDIN9ea27aa2021-05-20 14:32:29 +000065 [Tags] functionalTT PowerSwitch RebootAllTTONUs
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070066 [Setup] Start Logging RebootAllTTONUs
67 [Teardown] Run Keywords Collect Logs
68 ... AND Stop Logging RebootAllTTONUs
69 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuri7255c002020-11-09 11:44:36 -080070 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070071 ${src}= Set Variable ${hosts.src[${I}]}
72 ${dst}= Set Variable ${hosts.dst[${I}]}
73 Disable Switch Outlet ${src['power_switch_port']}
TorstenThieme2ed10502021-03-22 18:01:50 +000074 Sleep 10s
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070075 Enable Switch Outlet ${src['power_switch_port']}
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070076 END
77
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -070078Sanity E2E Test for TT (HSIA, VoD, VoIP)
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070079 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
80 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
81 ... Traffic sent with same vlan from different RGs,
82 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
83 ... Inner vlans from the RG should not change
84 [Tags] sanityTT
85 [Setup] Run Keywords Start Logging SanityTestTT
86 ... AND Setup
87 [Teardown] Run Keywords Collect Logs
88 ... AND Stop Logging SanityTestTT
89 Run Keyword If ${has_dataplane} Clean Up Linux
90 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
Suchitra Vemuri32dea012020-07-08 16:40:06 -070091 #Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070092
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -070093Sanity E2E Test for TT (MCAST)
94 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
95 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
96 ... Traffic sent with same vlan from different RGs,
97 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
98 ... Inner vlans from the RG should not change
99 [Tags] sanityTT-MCAST
100 [Setup] Run Keyword Start Logging SanityTestTT-MCAST
101 [Teardown] Run Keywords Collect Logs
102 ... AND Stop Logging SanityTestTT-MCAST
103 Run Keyword If ${has_dataplane} Clean Up Linux
104 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT MCAST
105
Huseyin Ahmet AYDIN9ea27aa2021-05-20 14:32:29 +0000106Test Disable and Delete OLT for TT
107 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
108 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityTt test was executed)
109 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
110 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test TT
Huseyin Ahmet AYDIN45922c82021-05-27 12:37:32 +0000111 [Tags] functionalTT DisableDeleteOLTTt
Huseyin Ahmet AYDIN9ea27aa2021-05-20 14:32:29 +0000112 [Setup] Start Logging DisableDeleteOLTTt
113 [Teardown] Run Keywords Collect Logs
114 ... AND Stop Logging DisableDeleteOLTTt
Huseyin Ahmet AYDIN45922c82021-05-27 12:37:32 +0000115 @{particular_onu_device_port}= Create List
116 FOR ${I} IN RANGE 0 ${num_all_onus}
117 ${src}= Set Variable ${hosts.src[${I}]}
118 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
119 ... ${of_id}
120 Append To List ${particular_onu_device_port} ${onu_port}
121 END
122 ${list_onu_port}= Remove Duplicates ${particular_onu_device_port}
123 ${num_of_provisioned_onus}= Get Length ${list_onu_port}
Huseyin Ahmet AYDIN9ea27aa2021-05-20 14:32:29 +0000124 # Disable and Validate OLT Device
125 FOR ${I} IN RANGE 0 ${olt_count}
126 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
127 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
128 Disable Device ${olt_device_id}
129 ${of_id}= Get ofID From OLT List ${olt_serial_number}
130 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
131 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
132 ... ${olt_serial_number}
Huseyin Ahmet AYDIN9ea27aa2021-05-20 14:32:29 +0000133 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
134 # Validate ONUs
135 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
136 ... ${num_onus} ${olt_serial_number}
137 # Verify ONOS Flows
Huseyin Ahmet AYDIN45922c82021-05-27 12:37:32 +0000138 # Number of Access Flows on ONOS equals 16 * the Number of Active ONUs + 3 for default LLDP, IGMP and DHCP
139 ${onos_flows_count}= Evaluate 16 * ${num_of_provisioned_onus} + 3
Huseyin Ahmet AYDIN9ea27aa2021-05-20 14:32:29 +0000140 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Huseyin Ahmet AYDIN45922c82021-05-27 12:37:32 +0000141 ... Verify Added Flow Count for OLT TT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
142 ... ${onos_flows_count}
Huseyin Ahmet AYDIN9ea27aa2021-05-20 14:32:29 +0000143 # Verify VOLTHA Flows
Huseyin Ahmet AYDIN45922c82021-05-27 12:37:32 +0000144 # Number of per OLT Flows equals 10 * Number of Active ONUs + 3 for default LLDP, IGMP and DHCP
145 ${olt_flows}= Evaluate 10 * ${num_of_provisioned_onus} + 3
146 # Number of per ONU Flows equals 6 for 3play service data plane + 4 for Trap to Host Flows
147 ${onu_flows}= Set Variable 10
Huseyin Ahmet AYDIN9ea27aa2021-05-20 14:32:29 +0000148 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
149 ... ${olt_device_id}
150 ${List_ONU_Serial} Create List
151 Set Suite Variable ${List_ONU_Serial}
152 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} ${num_onus}
153 Log ${List_ONU_Serial}
154 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
155 ... ${List_ONU_Serial} ${onu_flows}
156 # Delete OLT and Validate Empty Device List
157 Delete Device ${olt_device_id}
158 # Check that the OLT and the ONUs are actually removed from the system
159 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed
160 ... ${olt_serial_number}
161 Run Keyword and Continue On Failure Validate all ONUS for OLT Removed ${num_all_onus} ${hosts}
162 ... ${olt_serial_number} ${timeout}
163 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
164 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
165 END
166 # Re-do Setup (Recreate the OLT) and Perform Sanity Test TT
167 Run Keyword Setup
168 Run Keyword If ${has_dataplane} Clean Up Linux
169 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
170
Emrehan UZUN62748282021-05-21 08:16:52 +0000171Verify re-provisioning subscriber after removing provisoned subscriber for TT
172 [Documentation] Removing/Readding a particular subscriber should have no effect on any other subscriber.
173 [Tags] functionalTT Readd-subscriber-TT
174 [Setup] Start Logging Readd-subscriber-TT
175 [Teardown] Run Keywords Collect Logs
176 ... AND Stop Logging Readd-subscriber-TT
177 Run Keyword If ${has_dataplane} Clean Up Linux
178 FOR ${I} IN RANGE 0 ${num_all_onus}
179 ${src}= Set Variable ${hosts.src[${I}]}
180 ${dst}= Set Variable ${hosts.dst[${I}]}
181 ${service_type}= Get Variable Value ${src['service_type']} "null"
182 ${of_id}= Get ofID From OLT List ${src['olt']}
183 ${onu_device_id}= Get Device ID From SN ${src['onu']}
184 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
185 ... ${of_id}
186 # Remove Subscriber Access
187 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
188 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
189 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
190 ... Wait Until Keyword Succeeds ${timeout} 2s
191 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
192 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
193 # Verify VOLTHA flows for ONU under test is Zero
194 Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
195 ... ${onu_device_id} 0
196 # Add Subscriber Access
197 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
198 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
199 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
200 ... Validate Device ENABLED ACTIVE
201 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
202 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
203 ... Wait Until Keyword Succeeds ${timeout} 2s Sanity Test TT one ONU ${src}
204 ... ${dst} ${suppressaddsubscriber}
205 ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' Run Keyword And Continue On Failure
206 ... Wait Until Keyword Succeeds ${timeout} 2s Sanity Test TT MCAST one ONU ${src}
207 ... ${dst} ${suppressaddsubscriber}
208 END
209
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -0700210*** Keywords ***
211Setup Suite
212 [Documentation] Set up the test suite
213 Common Test Suite Setup
214 ${switch_type}= Get Variable Value ${web_power_switch.type}
215 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
216
217
218Clear All Devices Then Create New Device
219 [Documentation] Remove any devices from VOLTHA and ONOS
220 # Remove all devices from voltha and nos
221 Delete All Devices and Verify
222 # Execute normal test Setup Keyword
223 Setup
224
Suchitra Vemuri32dea012020-07-08 16:40:06 -0700225
226Teardown Suite
227 [Documentation] Tear down steps for the suite
228 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass04896f62021-03-05 16:15:11 +0530229 Run Keyword If ${teardown_device} Delete All Devices And Verify