blob: 9caf40b3e0f72ce315163784778f9d96f277e4d9 [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
58*** Test Cases ***
59Reboot TT ONUs Physically - Clean Up
60 [Documentation] This test reboots ONUs physically before execution all the tests
61 ... Test case runs only on the PODs that are configured with PowerSwitch that
62 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
Huseyin Ahmet AYDIN9ea27aa2021-05-20 14:32:29 +000063 [Tags] functionalTT PowerSwitch RebootAllTTONUs
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070064 [Setup] Start Logging RebootAllTTONUs
65 [Teardown] Run Keywords Collect Logs
66 ... AND Stop Logging RebootAllTTONUs
67 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuri7255c002020-11-09 11:44:36 -080068 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070069 ${src}= Set Variable ${hosts.src[${I}]}
70 ${dst}= Set Variable ${hosts.dst[${I}]}
71 Disable Switch Outlet ${src['power_switch_port']}
TorstenThieme2ed10502021-03-22 18:01:50 +000072 Sleep 10s
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070073 Enable Switch Outlet ${src['power_switch_port']}
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070074 END
75
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -070076Sanity E2E Test for TT (HSIA, VoD, VoIP)
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070077 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
78 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
79 ... Traffic sent with same vlan from different RGs,
80 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
81 ... Inner vlans from the RG should not change
82 [Tags] sanityTT
83 [Setup] Run Keywords Start Logging SanityTestTT
84 ... AND Setup
85 [Teardown] Run Keywords Collect Logs
86 ... AND Stop Logging SanityTestTT
87 Run Keyword If ${has_dataplane} Clean Up Linux
88 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
Suchitra Vemuri32dea012020-07-08 16:40:06 -070089 #Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -070090
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -070091Sanity E2E Test for TT (MCAST)
92 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
93 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
94 ... Traffic sent with same vlan from different RGs,
95 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
96 ... Inner vlans from the RG should not change
97 [Tags] sanityTT-MCAST
98 [Setup] Run Keyword Start Logging SanityTestTT-MCAST
99 [Teardown] Run Keywords Collect Logs
100 ... AND Stop Logging SanityTestTT-MCAST
101 Run Keyword If ${has_dataplane} Clean Up Linux
102 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT MCAST
103
Huseyin Ahmet AYDIN9ea27aa2021-05-20 14:32:29 +0000104Test Disable and Delete OLT for TT
105 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
106 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityTt test was executed)
107 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
108 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test TT
109 [Tags] functionalTT DisableDeleteOLTTt
110 [Setup] Start Logging DisableDeleteOLTTt
111 [Teardown] Run Keywords Collect Logs
112 ... AND Stop Logging DisableDeleteOLTTt
113 # Disable and Validate OLT Device
114 FOR ${I} IN RANGE 0 ${olt_count}
115 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
116 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
117 Disable Device ${olt_device_id}
118 ${of_id}= Get ofID From OLT List ${olt_serial_number}
119 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
120 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
121 ... ${olt_serial_number}
122 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
123 ... ${olt_serial_number}
124 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
125 # Validate ONUs
126 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
127 ... ${num_onus} ${olt_serial_number}
128 # Verify ONOS Flows
129 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
130 ${onos_flows_count}= Evaluate 4 * ${num_onus}
131 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
132 ... Verify Default Downstream Flows are added in ONOS for OLT TT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
133 ... ${nni_port}
134 # Verify VOLTHA Flows
135 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
136 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
137 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
138 ${onu_flows}= Set Variable 2
139 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
140 ... ${olt_device_id}
141 ${List_ONU_Serial} Create List
142 Set Suite Variable ${List_ONU_Serial}
143 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} ${num_onus}
144 Log ${List_ONU_Serial}
145 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
146 ... ${List_ONU_Serial} ${onu_flows}
147 # Delete OLT and Validate Empty Device List
148 Delete Device ${olt_device_id}
149 # Check that the OLT and the ONUs are actually removed from the system
150 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed
151 ... ${olt_serial_number}
152 Run Keyword and Continue On Failure Validate all ONUS for OLT Removed ${num_all_onus} ${hosts}
153 ... ${olt_serial_number} ${timeout}
154 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
155 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
156 END
157 # Re-do Setup (Recreate the OLT) and Perform Sanity Test TT
158 Run Keyword Setup
159 Run Keyword If ${has_dataplane} Clean Up Linux
160 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
161
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -0700162*** Keywords ***
163Setup Suite
164 [Documentation] Set up the test suite
165 Common Test Suite Setup
166 ${switch_type}= Get Variable Value ${web_power_switch.type}
167 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
168
169
170Clear All Devices Then Create New Device
171 [Documentation] Remove any devices from VOLTHA and ONOS
172 # Remove all devices from voltha and nos
173 Delete All Devices and Verify
174 # Execute normal test Setup Keyword
175 Setup
176
Suchitra Vemuri32dea012020-07-08 16:40:06 -0700177
178Teardown Suite
179 [Documentation] Tear down steps for the suite
180 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass04896f62021-03-05 16:15:11 +0530181 Run Keyword If ${teardown_device} Delete All Devices And Verify