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 |
| 125 | ... $${test_onu2_uni} |
| 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 | |
Huseyin Ahmet AYDIN | 7cb5ae6 | 2021-10-28 11:07:27 +0000 | [diff] [blame] | 129 | *** Keywords *** |
| 130 | Get ONU details with Given Sn and Service and UNI |
| 131 | [Documentation] This keyword finds the ONU details (as required for multicast test) |
| 132 | ... with given serial number, service type and UNI |
| 133 | [Arguments] ${onu_sn} ${service_type} ${uni} |
| 134 | ${matched}= Set Variable False |
| 135 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 136 | ${src}= Set Variable ${hosts.src[${I}]} |
| 137 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 138 | ${service}= Get Variable Value ${src['service_type']} "null" |
| 139 | ${onu}= Get Variable Value ${src['onu']} "null" |
| 140 | ${uni_id}= Get Variable Value ${src['uni_id']} "null" |
| 141 | Continue For Loop If '${onu}' != '${onu_sn}' or '${service}' != '${service_type}' |
| 142 | ${matched}= Set Variable If |
| 143 | ... '${onu}' == '${onu_sn}' and '${service}' == '${service_type}' and '${uni}' == '${uni_id}' |
| 144 | ... True False |
| 145 | Exit For Loop If ${matched} |
| 146 | END |
| 147 | [Return] ${matched} ${src} ${dst} |
| 148 | |
| 149 | |
| 150 | TT 2 RG MCAST Test |
| 151 | [Documentation] This keyword performs MCAST two RG at the Same Time for TT workflow |
| 152 | [Arguments] ${src_rg1} ${dst_rg1} ${channel_ip_rg1} ${src_rg2} ${dst_rg2} ${channel_ip_rg2} |
| 153 | # Check for iperf and jq tools RG1 |
| 154 | ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf jq |
| 155 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 156 | ... ${src_rg1['container_name']} |
| 157 | Pass Execution If ${rc} != 0 Skipping test: iperf / jq not found on the RG |
| 158 | |
| 159 | # Check for iperf and jq tools RG2 |
| 160 | ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf jq |
| 161 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 162 | ... ${src_rg2['container_name']} |
| 163 | Pass Execution If ${rc} != 0 Skipping test: iperf / jq not found on the RG |
| 164 | |
| 165 | #Reset the IP on the interface RG1 |
| 166 | ${output}= Login And Run Command On Remote System sudo ifconfig ${src_rg1['dp_iface_name']} 0 |
| 167 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 168 | ... ${src_rg1['container_name']} |
| 169 | # Kill iperf on BNG |
| 170 | ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 171 | ... sudo kill -9 `pidof iperf` |
| 172 | ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']} |
| 173 | ... ${dst_rg1['container_name']} |
| 174 | |
| 175 | #Reset the IP on the interface RG2 |
| 176 | ${output}= Login And Run Command On Remote System sudo ifconfig ${src_rg1['dp_iface_name']} 0 |
| 177 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 178 | ... ${src_rg2['container_name']} |
| 179 | # Kill iperf on BNG |
| 180 | ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 181 | ... sudo kill -9 `pidof iperf` |
| 182 | ... ${dst_rg2['bng_ip']} ${dst_rg2['bng_user']} ${dst_rg2['bng_pass']} ${dst_rg2['container_type']} |
| 183 | ... ${dst_rg2['container_name']} |
| 184 | |
| 185 | # Setup RG1 for Multi-cast test |
| 186 | ${output}= Login And Run Command On Remote System |
| 187 | ... sudo ifconfig ${src_rg1['dp_iface_name']} ${src_rg1['mcast_rg']} up ; sudo kill -9 `pidof iperf` |
| 188 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 189 | ... ${src_rg1['container_name']} |
| 190 | ${output}= Login And Run Command On Remote System |
| 191 | ... sudo ip route add ${src_rg1['mcast_grp_subnet_mask']} dev ${src_rg1['dp_iface_name']} scope link |
| 192 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 193 | ... ${src_rg1['container_name']} |
| 194 | |
| 195 | # Setup RG2 for Multi-cast test |
| 196 | ${output}= Login And Run Command On Remote System |
| 197 | ... sudo ifconfig ${src_rg2['dp_iface_name']} ${src_rg2['mcast_rg']} up ; sudo kill -9 `pidof iperf` |
| 198 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 199 | ... ${src_rg2['container_name']} |
| 200 | ${output}= Login And Run Command On Remote System |
| 201 | ... sudo ip route add ${src_rg2['mcast_grp_subnet_mask']} dev ${src_rg2['dp_iface_name']} scope link |
| 202 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 203 | ... ${src_rg2['container_name']} |
| 204 | |
| 205 | # Setup iperf on the BNG |
| 206 | ${server_output}= Run Keyword If '${channel_ip_rg1}'=='${channel_ip_rg2}' |
| 207 | ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg1}' -u -T 32 -t 60 -i 1 & |
| 208 | ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']} |
| 209 | ... ${dst_rg1['container_name']} |
| 210 | ... ELSE Run Keywords Run Keyword And Continue On Failure |
| 211 | ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg1}' -u -T 32 -t 60 -i 1 & |
| 212 | ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']} |
| 213 | ... ${dst_rg1['container_name']} AND Run Keyword And Continue On Failure |
| 214 | ... Login And Run Command On Remote System sudo iperf -c '${channel_ip_rg2}' -u -T 32 -t 60 -i 1 & |
| 215 | ... ${dst_rg2['bng_ip']} ${dst_rg2['bng_user']} ${dst_rg2['bng_pass']} ${dst_rg2['container_type']} |
| 216 | ... ${dst_rg2['container_name']} |
| 217 | |
| 218 | # Setup iperf on the RG1 |
| 219 | ${rg_output_rg1}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s |
| 220 | ... Login And Run Command On Remote System |
| 221 | ... rm -rf /tmp/rg_output ; sudo iperf -s -u -B '${channel_ip_rg1}' -i 1 -D >> /tmp/rg_output |
| 222 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 223 | ... ${src_rg1['container_name']} |
| 224 | |
| 225 | # Setup iperf on the RG2 |
| 226 | ${rg_output_rg2}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s |
| 227 | ... Login And Run Command On Remote System |
| 228 | ... rm -rf /tmp/rg_output ; sudo iperf -s -u -B '${channel_ip_rg2}' -i 1 -D >> /tmp/rg_output |
| 229 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 230 | ... ${src_rg2['container_name']} |
| 231 | |
| 232 | #Logging Outputs and Check iperf UDP Stream Outputs |
| 233 | Log ${rg_output_rg1} |
| 234 | Log ${rg_output_rg2} |
| 235 | Sleep 60s |
| 236 | ${output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s |
| 237 | ... Login And Run Command On Remote System |
| 238 | ... cat /tmp/rg_output | grep KBytes |
| 239 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 240 | ... ${src_rg1['container_name']} |
| 241 | Log ${output} |
| 242 | Should Contain ${output} KBytes |
| 243 | ${output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s |
| 244 | ... Login And Run Command On Remote System |
| 245 | ... cat /tmp/rg_output | grep KBytes |
| 246 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 247 | ... ${src_rg2['container_name']} |
| 248 | Log ${output} |
| 249 | Should Contain ${output} KBytes |
| 250 | |
| 251 | # Kill iperf on BNG |
| 252 | ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 253 | ... sudo kill -9 `pidof iperf` |
| 254 | ... ${dst_rg1['bng_ip']} ${dst_rg1['bng_user']} ${dst_rg1['bng_pass']} ${dst_rg1['container_type']} |
| 255 | ... ${dst_rg1['container_name']} |
| 256 | |
| 257 | # Kill iperf on the RG1 |
| 258 | ${output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 259 | ... sudo kill -9 `pidof iperf` |
| 260 | ... ${src_rg1['ip']} ${src_rg1['user']} ${src_rg1['pass']} ${src_rg1['container_type']} |
| 261 | ... ${src_rg1['container_name']} |
| 262 | |
| 263 | # Kill iperf on the RG2 |
| 264 | ${output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 265 | ... sudo kill -9 `pidof iperf` |
| 266 | ... ${src_rg2['ip']} ${src_rg2['user']} ${src_rg2['pass']} ${src_rg2['container_type']} |
| 267 | ... ${src_rg2['container_name']} |
| 268 | |
| 269 | Setup Suite |
| 270 | [Documentation] Set up the test suite |
| 271 | Common Test Suite Setup |
| 272 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 273 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
| 274 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 275 | Run Keyword Setup |
| 276 | Wait Until Keyword Succeeds ${timeout} 2s Provision Subscription TT |
| 277 | |
| 278 | |
| 279 | |
| 280 | Clear All Devices Then Create New Device |
| 281 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 282 | # Remove all devices from voltha and nos |
| 283 | Delete All Devices and Verify |
| 284 | # Execute normal test Setup Keyword |
| 285 | Setup |
| 286 | |
| 287 | Teardown Suite |
| 288 | [Documentation] Tear down steps for the suite |
| 289 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 290 | Run Keyword If ${teardown_device} Delete All Devices And Verify |
| 291 | Close All ONOS SSH Connections |