Huseyin Ahmet AYDIN | 7cb5ae6 | 2021-10-28 11:07:27 +0000 | [diff] [blame] | 1 | # 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 *** |
| 17 | Documentation Test various functional end-to-end scenarios for TT workflow |
| 18 | Suite Setup Setup Suite |
| 19 | Test Setup Setup |
| 20 | Test Teardown Teardown |
| 21 | Suite Teardown Teardown Suite |
| 22 | Library Collections |
| 23 | Library String |
| 24 | Library OperatingSystem |
| 25 | Library XML |
| 26 | Library RequestsLibrary |
| 27 | Library ../../libraries/DependencyLibrary.py |
| 28 | Resource ../../libraries/onos.robot |
| 29 | Resource ../../libraries/voltctl.robot |
| 30 | Resource ../../libraries/voltha.robot |
| 31 | Resource ../../libraries/utils.robot |
| 32 | Resource ../../libraries/k8s.robot |
| 33 | Resource ../../variables/variables.robot |
| 34 | Resource ../../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 | ${INFRA_NAMESPACE} default |
| 46 | # 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 |
| 49 | ${timeout} 60s |
| 50 | ${of_id} 0 |
| 51 | ${logical_id} 0 |
| 52 | ${has_dataplane} True |
| 53 | ${teardown_device} True |
| 54 | ${scripts} ../../scripts |
| 55 | |
| 56 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 57 | ${container_log_dir} ${None} |
| 58 | |
| 59 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 60 | # example: -v logging:False |
| 61 | ${logging} True |
| 62 | |
| 63 | ${suppressaddsubscriber} True |
| 64 | |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 65 | # flag to choose the subscriber provisioning command type in ONOS |
| 66 | # TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other. |
| 67 | # if set to True, command used is "volt-add-subscriber-unitag" |
| 68 | # if set to False, comand used is "volt-add-subscriber-access" |
| 69 | ${unitag_sub} False |
| 70 | |
Huseyin Ahmet AYDIN | 7cb5ae6 | 2021-10-28 11:07:27 +0000 | [diff] [blame] | 71 | *** Test Cases *** |
| 72 | 2 RG Same ONU Same Channel Multicast Test |
| 73 | [Documentation] Verify that 2 RG which are connected to the same ONU could join the same channel. |
| 74 | [Tags] functionalTT 2RGSameOnuSameChannel multicastTT |
| 75 | [Setup] Start Logging 2RGSameOnuSameChannel |
| 76 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 77 | ... AND Stop Logging 2RGSameOnuSameChannel |
| 78 | ${test_onus_pon0}= Set Variable ${multicast_test_onu_pon_locations.pon_0[0]} |
| 79 | ${test_onu1_sn}= Set Variable ${test_onus_pon0['onu_1']} |
| 80 | ${test_onu1_uni}= Set Variable 1 |
| 81 | ${test_onu2_sn}= Set Variable ${test_onus_pon0['onu_1']} |
| 82 | ${test_onu2_uni}= Set Variable 2 |
| 83 | ${channel_ip_list}= Set Variable ${multicast_ip_addresses[0]} |
| 84 | ${channel_ip_1}= Set Variable ${channel_ip_list['channel_1']} |
Huseyin Ahmet AYDIN | 7cb5ae6 | 2021-10-28 11:07:27 +0000 | [diff] [blame] | 85 | ${matched} ${src_onu1} ${dst_onu1}= Get ONU details with Given Sn and Service and UNI ${test_onu1_sn} mcast |
| 86 | ... ${test_onu1_uni} |
| 87 | ${matched} ${src_onu2} ${dst_onu2}= Get ONU details with Given Sn and Service and UNI ${test_onu2_sn} mcast |
| 88 | ... ${test_onu2_uni} |
| 89 | Wait Until Keyword Succeeds ${timeout} 15 TT 2 RG MCAST Test ${src_onu1} ${dst_onu1} |
| 90 | ... ${channel_ip_1} ${src_onu2} ${dst_onu2} ${channel_ip_1} |
| 91 | |
Huseyin Ahmet AYDIN | 208723d | 2021-11-16 07:15:53 +0000 | [diff] [blame] | 92 | 2 RG Same ONU Different Channel Multicast Test |
| 93 | [Documentation] Verify that 2 RG which are connected to the same ONU could join the different channel. |
| 94 | [Tags] functionalTT 2RGSameOnuDifferentChannel multicastTT |
| 95 | [Setup] Start Logging 2RGSameOnuDifferentChannel |
| 96 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 97 | ... AND Stop Logging 2RGSameOnuDifferentChannel |
| 98 | ${test_onus_pon0}= Set Variable ${multicast_test_onu_pon_locations.pon_0[0]} |
| 99 | ${test_onu1_sn}= Set Variable ${test_onus_pon0['onu_1']} |
| 100 | ${test_onu1_uni}= Set Variable 1 |
| 101 | ${test_onu2_sn}= Set Variable ${test_onus_pon0['onu_1']} |
| 102 | ${test_onu2_uni}= Set Variable 2 |
| 103 | ${channel_ip_list}= Set Variable ${multicast_ip_addresses[0]} |
| 104 | ${channel_ip_1}= Set Variable ${channel_ip_list['channel_1']} |
| 105 | ${channel_ip_2}= Set Variable ${channel_ip_list['channel_2']} |
| 106 | ${matched} ${src_onu1} ${dst_onu1}= Get ONU details with Given Sn and Service and UNI ${test_onu1_sn} mcast |
| 107 | ... ${test_onu1_uni} |
| 108 | ${matched} ${src_onu2} ${dst_onu2}= Get ONU details with Given Sn and Service and UNI ${test_onu2_sn} mcast |
| 109 | ... ${test_onu2_uni} |
| 110 | Wait Until Keyword Succeeds ${timeout} 15 TT 2 RG MCAST Test ${src_onu1} ${dst_onu1} |
| 111 | ... ${channel_ip_1} ${src_onu2} ${dst_onu2} ${channel_ip_2} |
| 112 | |
Emrehan UZUN | 6122116 | 2021-11-16 11:19:07 +0000 | [diff] [blame] | 113 | 2 RG Different PON Different ONU Same Channel Multicast Test |
| 114 | [Documentation] Verify that 2 RG which are connected to the different ONUs |
| 115 | ... on the different PON Ports could join the same channel. |
| 116 | [Tags] functionalTT 2RGDifferentOnuandPonSameChannel multicastTT notready |
| 117 | [Setup] Start Logging 2RGDifferentOnuandPonSameChannel |
| 118 | [Teardown] Run Keywords Collect Logs |
| 119 | ... AND Stop Logging 2RGDifferentOnuandPonSameChannel |
| 120 | ${test_onus_pon0}= Set Variable ${multicast_test_onu_pon_locations.pon_0[0]} |
| 121 | ${test_onus_pon1}= Set Variable ${multicast_test_onu_pon_locations.pon_1[0]} |
| 122 | ${test_onu1_sn}= Set Variable ${test_onus_pon0['onu_1']} |
| 123 | ${test_onu1_uni}= Set Variable 1 |
| 124 | ${test_onu2_sn}= Set Variable ${test_onus_pon1['onu_1']} |
| 125 | ${test_onu2_uni}= Set Variable 1 |
| 126 | ${channel_ip_list}= Set Variable ${multicast_ip_addresses[0]} |
| 127 | ${channel_ip_1}= Set Variable ${channel_ip_list['channel_1']} |
| 128 | ${matched} ${src_onu1} ${dst_onu1}= Get ONU details with Given Sn and Service and UNI ${test_onu1_sn} mcast |
| 129 | ... ${test_onu1_uni} |
| 130 | ${matched} ${src_onu2} ${dst_onu2}= Get ONU details with Given Sn and Service and UNI ${test_onu2_sn} mcast |
Emrehan UZUN | d80c47d | 2021-11-22 14:18:50 +0000 | [diff] [blame] | 131 | ... ${test_onu2_uni} |
Emrehan UZUN | 6122116 | 2021-11-16 11:19:07 +0000 | [diff] [blame] | 132 | Wait Until Keyword Succeeds ${timeout} 15 TT 2 RG MCAST Test ${src_onu1} ${dst_onu1} |
| 133 | ... ${channel_ip_1} ${src_onu2} ${dst_onu2} ${channel_ip_1} |
| 134 | |
Emrehan UZUN | d80c47d | 2021-11-22 14:18:50 +0000 | [diff] [blame] | 135 | 2 RG Different PON Different ONU Different Channels Multicast Test |
| 136 | [Documentation] Verify that 2 RG which are connected to the different ONUs |
| 137 | ... on the different PON Ports could join the different channels. |
| 138 | [Tags] functionalTT 2RGDifferentOnuandPonDifferentChannels multicastTT notready |
| 139 | [Setup] Start Logging 2RGDifferentOnuandPonDifferentChannels |
| 140 | [Teardown] Run Keywords Collect Logs |
| 141 | ... AND Stop Logging 2RGDifferentOnuandPonDifferentChannels |
| 142 | ${test_onus_pon0}= Set Variable ${multicast_test_onu_pon_locations.pon_0[0]} |
| 143 | ${test_onus_pon1}= Set Variable ${multicast_test_onu_pon_locations.pon_1[0]} |
| 144 | ${test_onu1_sn}= Set Variable ${test_onus_pon0['onu_1']} |
| 145 | ${test_onu1_uni}= Set Variable 1 |
| 146 | ${test_onu2_sn}= Set Variable ${test_onus_pon1['onu_1']} |
| 147 | ${test_onu2_uni}= Set Variable 1 |
| 148 | ${channel_ip_list}= Set Variable ${multicast_ip_addresses[0]} |
| 149 | ${channel_ip_1}= Set Variable ${channel_ip_list['channel_1']} |
| 150 | ${channel_ip_2}= Set Variable ${channel_ip_list['channel_2']} |
| 151 | ${matched} ${src_onu1} ${dst_onu1}= Get ONU details with Given Sn and Service and UNI ${test_onu1_sn} mcast |
| 152 | ... ${test_onu1_uni} |
| 153 | ${matched} ${src_onu2} ${dst_onu2}= Get ONU details with Given Sn and Service and UNI ${test_onu2_sn} mcast |
| 154 | ... ${test_onu2_uni} |
| 155 | Wait Until Keyword Succeeds ${timeout} 15 TT 2 RG MCAST Test ${src_onu1} ${dst_onu1} |
| 156 | ... ${channel_ip_1} ${src_onu2} ${dst_onu2} ${channel_ip_2} |
| 157 | |
Huseyin Ahmet AYDIN | 7cb5ae6 | 2021-10-28 11:07:27 +0000 | [diff] [blame] | 158 | *** Keywords *** |
| 159 | Get ONU details with Given Sn and Service and UNI |
| 160 | [Documentation] This keyword finds the ONU details (as required for multicast test) |
| 161 | ... with given serial number, service type and UNI |
| 162 | [Arguments] ${onu_sn} ${service_type} ${uni} |
| 163 | ${matched}= Set Variable False |
| 164 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 165 | ${src}= Set Variable ${hosts.src[${I}]} |
| 166 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 167 | ${service}= Get Variable Value ${src['service_type']} "null" |
| 168 | ${onu}= Get Variable Value ${src['onu']} "null" |
| 169 | ${uni_id}= Get Variable Value ${src['uni_id']} "null" |
| 170 | Continue For Loop If '${onu}' != '${onu_sn}' or '${service}' != '${service_type}' |
| 171 | ${matched}= Set Variable If |
| 172 | ... '${onu}' == '${onu_sn}' and '${service}' == '${service_type}' and '${uni}' == '${uni_id}' |
| 173 | ... True False |
| 174 | Exit For Loop If ${matched} |
| 175 | END |
| 176 | [Return] ${matched} ${src} ${dst} |
| 177 | |
| 178 | |
| 179 | TT 2 RG MCAST Test |
| 180 | [Documentation] This keyword performs MCAST two RG at the Same Time for TT workflow |
| 181 | [Arguments] ${src_rg1} ${dst_rg1} ${channel_ip_rg1} ${src_rg2} ${dst_rg2} ${channel_ip_rg2} |
| 182 | # Check for iperf and jq tools RG1 |
| 183 | ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf jq |
| 184 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 185 | ... ${src_rg1['container_name']} |
| 186 | Pass Execution If ${rc} != 0 Skipping test: iperf / jq not found on the RG |
| 187 | |
| 188 | # Check for iperf and jq tools RG2 |
| 189 | ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf jq |
| 190 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 191 | ... ${src_rg2['container_name']} |
| 192 | Pass Execution If ${rc} != 0 Skipping test: iperf / jq not found on the RG |
| 193 | |
| 194 | #Reset the IP on the interface RG1 |
| 195 | ${output}= Login And Run Command On Remote System sudo ifconfig ${src_rg1['dp_iface_name']} 0 |
| 196 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 197 | ... ${src_rg1['container_name']} |
| 198 | # Kill iperf on BNG |
| 199 | ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 200 | ... sudo kill -9 `pidof iperf` |
| 201 | ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']} |
| 202 | ... ${dst_rg1['container_name']} |
| 203 | |
| 204 | #Reset the IP on the interface RG2 |
| 205 | ${output}= Login And Run Command On Remote System sudo ifconfig ${src_rg1['dp_iface_name']} 0 |
| 206 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 207 | ... ${src_rg2['container_name']} |
| 208 | # Kill iperf on BNG |
| 209 | ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 210 | ... sudo kill -9 `pidof iperf` |
| 211 | ... ${dst_rg2['bng_ip']} ${dst_rg2['bng_user']} ${dst_rg2['bng_pass']} ${dst_rg2['container_type']} |
| 212 | ... ${dst_rg2['container_name']} |
| 213 | |
| 214 | # Setup RG1 for Multi-cast test |
| 215 | ${output}= Login And Run Command On Remote System |
| 216 | ... sudo ifconfig ${src_rg1['dp_iface_name']} ${src_rg1['mcast_rg']} up ; sudo kill -9 `pidof iperf` |
| 217 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 218 | ... ${src_rg1['container_name']} |
| 219 | ${output}= Login And Run Command On Remote System |
| 220 | ... sudo ip route add ${src_rg1['mcast_grp_subnet_mask']} dev ${src_rg1['dp_iface_name']} scope link |
| 221 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 222 | ... ${src_rg1['container_name']} |
| 223 | |
| 224 | # Setup RG2 for Multi-cast test |
| 225 | ${output}= Login And Run Command On Remote System |
| 226 | ... sudo ifconfig ${src_rg2['dp_iface_name']} ${src_rg2['mcast_rg']} up ; sudo kill -9 `pidof iperf` |
| 227 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 228 | ... ${src_rg2['container_name']} |
| 229 | ${output}= Login And Run Command On Remote System |
| 230 | ... sudo ip route add ${src_rg2['mcast_grp_subnet_mask']} dev ${src_rg2['dp_iface_name']} scope link |
| 231 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 232 | ... ${src_rg2['container_name']} |
| 233 | |
| 234 | # Setup iperf on the BNG |
| 235 | ${server_output}= Run Keyword If '${channel_ip_rg1}'=='${channel_ip_rg2}' |
| 236 | ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg1}' -u -T 32 -t 60 -i 1 & |
| 237 | ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']} |
| 238 | ... ${dst_rg1['container_name']} |
| 239 | ... ELSE Run Keywords Run Keyword And Continue On Failure |
| 240 | ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg1}' -u -T 32 -t 60 -i 1 & |
| 241 | ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']} |
| 242 | ... ${dst_rg1['container_name']} AND Run Keyword And Continue On Failure |
| 243 | ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg2}' -u -T 32 -t 60 -i 1 & |
| 244 | ... ${dst_rg2['bng_ip']} ${dst_rg2['bng_user']} ${dst_rg2['bng_pass']} ${dst_rg2['container_type']} |
| 245 | ... ${dst_rg2['container_name']} |
| 246 | |
| 247 | # Setup iperf on the RG1 |
| 248 | ${rg_output_rg1}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s |
| 249 | ... Login And Run Command On Remote System |
| 250 | ... rm -rf /tmp/rg_output ; sudo iperf -s -u -B '${channel_ip_rg1}' -i 1 -D >> /tmp/rg_output |
| 251 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 252 | ... ${src_rg1['container_name']} |
| 253 | |
| 254 | # Setup iperf on the RG2 |
| 255 | ${rg_output_rg2}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s |
| 256 | ... Login And Run Command On Remote System |
| 257 | ... rm -rf /tmp/rg_output ; sudo iperf -s -u -B '${channel_ip_rg2}' -i 1 -D >> /tmp/rg_output |
| 258 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 259 | ... ${src_rg2['container_name']} |
| 260 | |
| 261 | #Logging Outputs and Check iperf UDP Stream Outputs |
| 262 | Log ${rg_output_rg1} |
| 263 | Log ${rg_output_rg2} |
| 264 | Sleep 60s |
| 265 | ${output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s |
| 266 | ... Login And Run Command On Remote System |
| 267 | ... cat /tmp/rg_output | grep KBytes |
| 268 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 269 | ... ${src_rg1['container_name']} |
| 270 | Log ${output} |
| 271 | Should Contain ${output} KBytes |
| 272 | ${output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s |
| 273 | ... Login And Run Command On Remote System |
| 274 | ... cat /tmp/rg_output | grep KBytes |
| 275 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 276 | ... ${src_rg2['container_name']} |
| 277 | Log ${output} |
| 278 | Should Contain ${output} KBytes |
| 279 | |
| 280 | # Kill iperf on BNG |
| 281 | ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 282 | ... sudo kill -9 `pidof iperf` |
| 283 | ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']} |
| 284 | ... ${dst_rg1['container_name']} |
| 285 | |
| 286 | # Kill iperf on the RG1 |
| 287 | ${output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 288 | ... sudo kill -9 `pidof iperf` |
| 289 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 290 | ... ${src_rg1['container_name']} |
| 291 | |
| 292 | # Kill iperf on the RG2 |
| 293 | ${output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 294 | ... sudo kill -9 `pidof iperf` |
| 295 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 296 | ... ${src_rg2['container_name']} |
| 297 | |
| 298 | Setup Suite |
| 299 | [Documentation] Set up the test suite |
| 300 | Common Test Suite Setup |
| 301 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 302 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
| 303 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 304 | Run Keyword Setup |
| 305 | Wait Until Keyword Succeeds ${timeout} 2s Provision Subscription TT |
| 306 | |
| 307 | |
Huseyin Ahmet AYDIN | 7cb5ae6 | 2021-10-28 11:07:27 +0000 | [diff] [blame] | 308 | Clear All Devices Then Create New Device |
| 309 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 310 | # Remove all devices from voltha and nos |
| 311 | Delete All Devices and Verify |
| 312 | # Execute normal test Setup Keyword |
| 313 | Setup |