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