blob: 619b28f5a1de00f78b3dbec13bae4f031b749ea3 [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
Hardik Windlassd2044722021-05-28 12:54:08 +0000111 [Tags] functionalTT DisableDeleteOLTTt notready
Huseyin Ahmet AYDIN9ea27aa2021-05-20 14:32:29 +0000112 [Setup] Start Logging DisableDeleteOLTTt
113 [Teardown] Run Keywords Collect Logs
114 ... AND Stop Logging DisableDeleteOLTTt
115 # Disable and Validate OLT Device
116 FOR ${I} IN RANGE 0 ${olt_count}
117 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
118 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
119 Disable Device ${olt_device_id}
120 ${of_id}= Get ofID From OLT List ${olt_serial_number}
121 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
122 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
123 ... ${olt_serial_number}
124 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
125 ... ${olt_serial_number}
126 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
127 # Validate ONUs
128 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
129 ... ${num_onus} ${olt_serial_number}
130 # Verify ONOS Flows
131 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
132 ${onos_flows_count}= Evaluate 4 * ${num_onus}
133 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
134 ... Verify Default Downstream Flows are added in ONOS for OLT TT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
135 ... ${nni_port}
136 # Verify VOLTHA Flows
137 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
138 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
139 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
140 ${onu_flows}= Set Variable 2
141 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
142 ... ${olt_device_id}
143 ${List_ONU_Serial} Create List
144 Set Suite Variable ${List_ONU_Serial}
145 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} ${num_onus}
146 Log ${List_ONU_Serial}
147 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
148 ... ${List_ONU_Serial} ${onu_flows}
149 # Delete OLT and Validate Empty Device List
150 Delete Device ${olt_device_id}
151 # Check that the OLT and the ONUs are actually removed from the system
152 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed
153 ... ${olt_serial_number}
154 Run Keyword and Continue On Failure Validate all ONUS for OLT Removed ${num_all_onus} ${hosts}
155 ... ${olt_serial_number} ${timeout}
156 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
157 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
158 END
159 # Re-do Setup (Recreate the OLT) and Perform Sanity Test TT
160 Run Keyword Setup
161 Run Keyword If ${has_dataplane} Clean Up Linux
162 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
163
Emrehan UZUN62748282021-05-21 08:16:52 +0000164Verify re-provisioning subscriber after removing provisoned subscriber for TT
165 [Documentation] Removing/Readding a particular subscriber should have no effect on any other subscriber.
166 [Tags] functionalTT Readd-subscriber-TT
167 [Setup] Start Logging Readd-subscriber-TT
168 [Teardown] Run Keywords Collect Logs
169 ... AND Stop Logging Readd-subscriber-TT
170 Run Keyword If ${has_dataplane} Clean Up Linux
171 FOR ${I} IN RANGE 0 ${num_all_onus}
172 ${src}= Set Variable ${hosts.src[${I}]}
173 ${dst}= Set Variable ${hosts.dst[${I}]}
174 ${service_type}= Get Variable Value ${src['service_type']} "null"
175 ${of_id}= Get ofID From OLT List ${src['olt']}
176 ${onu_device_id}= Get Device ID From SN ${src['onu']}
177 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
178 ... ${of_id}
179 # Remove Subscriber Access
180 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
181 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
182 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
183 ... Wait Until Keyword Succeeds ${timeout} 2s
184 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
185 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
186 # Verify VOLTHA flows for ONU under test is Zero
187 Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
188 ... ${onu_device_id} 0
189 # Add Subscriber Access
190 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
191 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
192 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
193 ... Validate Device ENABLED ACTIVE
194 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
195 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
196 ... Wait Until Keyword Succeeds ${timeout} 2s Sanity Test TT one ONU ${src}
197 ... ${dst} ${suppressaddsubscriber}
198 ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' Run Keyword And Continue On Failure
199 ... Wait Until Keyword Succeeds ${timeout} 2s Sanity Test TT MCAST one ONU ${src}
200 ... ${dst} ${suppressaddsubscriber}
201 END
202
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -0700203*** Keywords ***
204Setup Suite
205 [Documentation] Set up the test suite
206 Common Test Suite Setup
207 ${switch_type}= Get Variable Value ${web_power_switch.type}
208 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
209
210
211Clear All Devices Then Create New Device
212 [Documentation] Remove any devices from VOLTHA and ONOS
213 # Remove all devices from voltha and nos
214 Delete All Devices and Verify
215 # Execute normal test Setup Keyword
216 Setup
217
Suchitra Vemuri32dea012020-07-08 16:40:06 -0700218
219Teardown Suite
220 [Documentation] Tear down steps for the suite
221 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass04896f62021-03-05 16:15:11 +0530222 Run Keyword If ${teardown_device} Delete All Devices And Verify