blob: ebdeb6ed9141d01809198f1a5a22f0448e2b39b3 [file] [log] [blame]
Kailash92764922019-07-25 08:21:39 -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.
Kailash92764922019-07-25 08:21:39 -070014# robot test functions
15
16*** Settings ***
17Documentation Library for various utilities
18Library SSHLibrary
Kailash92764922019-07-25 08:21:39 -070019Library String
20Library DateTime
21Library Process
22Library Collections
23Library RequestsLibrary
24Library OperatingSystem
Andy Bavier63460da2020-02-20 14:35:12 -070025Library CORDRobot
26Library ImportResource resources=CORDRobot
Kailash92764922019-07-25 08:21:39 -070027
28*** Keywords ***
Kailash528f7c02019-07-31 10:55:49 -070029Check CLI Tools Configured
30 [Documentation] Tests that use 'voltctl' and 'kubectl' should execute this keyword in suite setup
31 # check voltctl and kubectl configured
Zack Williamsa8fe75a2020-01-10 14:25:27 -070032 ${voltctl_rc}= Run And Return RC voltctl device list
33 ${kubectl_rc}= Run And Return RC kubectl get pods
Gilles Depatie675a2062019-10-22 12:44:42 -040034 Run Keyword If ${voltctl_rc} != 0 or ${kubectl_rc} != 0 FATAL ERROR
35 ... VOLTCTL and KUBECTL not configured. Please configure before executing tests.
Gilles Depatieb5682f82019-10-31 10:39:45 -040036
37Send File To Onos
Zack Williamsa8fe75a2020-01-10 14:25:27 -070038 [Documentation] Send the content of the file to Onos to selected section of configuration
39 ... using Post Request
40 [Arguments] ${CONFIG_FILE} ${section}
41 ${Headers}= Create Dictionary Content-Type application/json
42 ${File_Data}= OperatingSystem.Get File ${CONFIG_FILE}
43 Log ${Headers}
44 Log ${File_Data}
45 ${resp}= Post Request ONOS
46 ... /onos/v1/network/configuration/${section} headers=${Headers} data=${File_Data}
47 Should Be Equal As Strings ${resp.status_code} 200
Andy Bavier88cd9f62019-11-26 16:22:33 -070048
49Common Test Suite Setup
50 [Documentation] Setup the test suite
Andy Bavier88cd9f62019-11-26 16:22:33 -070051 Set Global Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG}
Matteo Scandolo5899be12020-11-11 15:38:07 -080052 Set Global Variable ${VOLTCTL_CONFIG} %{VOLTCONFIG}
Andy Bavier88cd9f62019-11-26 16:22:33 -070053 ${k8s_node_ip}= Evaluate ${nodes}[0].get("ip")
ubuntu6b6e7d42020-03-02 12:35:42 -080054 ${ONOS_REST_IP}= Get Environment Variable ONOS_REST_IP ${k8s_node_ip}
55 ${ONOS_SSH_IP}= Get Environment Variable ONOS_SSH_IP ${k8s_node_ip}
56 Set Global Variable ${ONOS_REST_IP}
57 Set Global Variable ${ONOS_SSH_IP}
Andy Bavier88cd9f62019-11-26 16:22:33 -070058 ${k8s_node_user}= Evaluate ${nodes}[0].get("user")
59 ${k8s_node_pass}= Evaluate ${nodes}[0].get("pass")
60 Check CLI Tools Configured
61 ${onos_auth}= Create List karaf karaf
62 ${HEADERS} Create Dictionary Content-Type=application/json
ubuntu6b6e7d42020-03-02 12:35:42 -080063 Create Session ONOS http://${ONOS_REST_IP}:${ONOS_REST_PORT} auth=${ONOS_AUTH}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080064 #${olt_ip}= Evaluate ${olts}[0].get("ip")
65 #${olt_ssh_ip}= Evaluate ${olts}[0].get("sship")
66 #${olt_user}= Evaluate ${olts}[0].get("user")
67 #${olt_pass}= Evaluate ${olts}[0].get("pass")
68 #${olt_serial_number}= Evaluate ${olts}[0].get("serial")
69 ${num_olts} Get Length ${olts}
70 ${list_olts} Create List
71 FOR ${I} IN RANGE 0 ${num_olts}
72 ${ip} Evaluate ${olts}[${I}].get("ip")
73 ${user} Evaluate ${olts}[${I}].get("user")
74 ${pass} Evaluate ${olts}[${I}].get("pass")
75 ${serial_number} Evaluate ${olts}[${I}].get("serial")
76 ${olt_ssh_ip} Evaluate ${olts}[${I}].get("sship")
77 ${onu_count}= Get ONU Count For OLT ${hosts.src} ${serial_number}
78 ${olt} Create Dictionary ip ${ip} user ${user} pass
79 ... ${pass} sn ${serial_number} onucount ${onu_count}
80 ... sship ${olt_ssh_ip}
81 Append To List ${list_olts} ${olt}
82 END
83 ${num_all_onus}= Get Length ${hosts.src}
84 ${num_all_onus}= Convert to String ${num_all_onus}
Andy Bavier88cd9f62019-11-26 16:22:33 -070085 #send sadis file to onos
Andy Baviera2691752019-11-27 12:18:38 -070086 ${sadis_file}= Get Variable Value ${sadis.file}
Zack Williamsa8fe75a2020-01-10 14:25:27 -070087 Log To Console \nSadis File:${sadis_file}
Andy Bavier88cd9f62019-11-26 16:22:33 -070088 Run Keyword Unless '${sadis_file}' is '${None}' Send File To Onos ${sadis_file} apps/
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080089 Set Suite Variable ${num_all_onus}
90 Set Suite Variable ${num_olts}
91 Set Suite Variable ${list_olts}
92 ${olt_count}= Get Length ${list_olts}
93 Set Suite Variable ${olt_count}
94 #Set Suite Variable ${olt_serial_number}
95 #Set Suite Variable ${olt_ip}
96 #Set Suite Variable ${olt_ssh_ip}
97 #Set Suite Variable ${olt_user}
98 #Set Suite Variable ${olt_pass}
Andy Bavier88cd9f62019-11-26 16:22:33 -070099 @{container_list}= Create List adapter-open-olt adapter-open-onu voltha-api-server
100 ... voltha-ro-core voltha-rw-core-11 voltha-rw-core-12 voltha-ofagent
101 Set Suite Variable ${container_list}
102 ${datetime}= Get Current Date
suraj gour7f6d5fe2019-11-29 10:56:35 +0000103 Set Suite Variable ${datetime}
104
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800105Get ONU Count For OLT
106 [Arguments] ${src} ${serial_number}
107 [Documentation] Gets ONU Count for the specified OLT
108 ${src_length}= Get Length ${src}
109 ${count}= Set Variable 0
110 FOR ${I} IN RANGE 0 ${src_length}
111 ${sn} Evaluate ${src}[${I}].get("olt")
Andrea Campanella155c2aa2020-11-12 18:41:34 +0100112 ${count}= Run Keyword If '${serial_number}' == '${sn}' Evaluate ${count} + 1 ELSE Set Variable ${count}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800113 END
114 [Return] ${count}
115
suraj gour7f6d5fe2019-11-29 10:56:35 +0000116WPA Reassociate
suraj gour7f6d5fe2019-11-29 10:56:35 +0000117 [Documentation] Executes a particular wpa_cli reassociate, which performs force reassociation
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700118 [Arguments] ${iface} ${ip} ${user} ${pass}=${None}
119 ... ${container_type}=${None} ${container_name}=${None}
suraj gour7f6d5fe2019-11-29 10:56:35 +0000120 #Below for loops are used instead of sleep time, to execute reassociate command and check status
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700121 FOR ${i} IN RANGE 70
122 ${output}= Login And Run Command On Remote System
123 ... wpa_cli -i ${iface} reassociate ${ip} ${user}
124 ... ${pass} ${container_type} ${container_name}
125 ${passed}= Run Keyword And Return Status Should Contain ${output} OK
Andy Bavierb63f6d22020-03-12 15:34:37 -0700126 Exit For Loop If ${passed}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700127 END
Andy Bavierb63f6d22020-03-12 15:34:37 -0700128 Should Be True ${passed} Status does not contain 'SUCCESS'
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700129 FOR ${i} IN RANGE 70
130 ${output}= Login And Run Command On Remote System
Andy Bavierae4a17e2020-02-25 14:54:36 -0700131 ... wpa_cli -i ${iface} status | grep SUCCESS ${ip} ${user}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700132 ... ${pass} ${container_type} ${container_name}
133 ${passed}= Run Keyword And Return Status Should Contain ${output} SUCCESS
Andy Bavierb63f6d22020-03-12 15:34:37 -0700134 Exit For Loop If ${passed}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700135 END
Andy Bavierb63f6d22020-03-12 15:34:37 -0700136 Should Be True ${passed} Status does not contain 'SUCCESS'
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700137
suraj gour7f6d5fe2019-11-29 10:56:35 +0000138Validate Authentication After Reassociate
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700139 [Arguments] ${auth_pass} ${iface} ${ip} ${user} ${pass}=${None}
140 ... ${container_type}=${None} ${container_name}=${None}
141 [Documentation]
142 ... Executes a particular reassociate request on the RG using wpa_cli.
143 ... auth_pass determines if authentication should pass
Andy Bavier84834d42020-02-25 13:49:50 -0700144 ${wpa_log}= Catenate SEPARATOR=. /tmp/wpa ${iface} log
145 ${output}= Login And Run Command On Remote System truncate -s 0 ${wpa_log}; cat ${wpa_log}
146 ... ${ip} ${user} ${pass} ${container_type} ${container_name}
147 Log ${output}
148 Should Not Contain ${output} authentication completed successfully
suraj gour7f6d5fe2019-11-29 10:56:35 +0000149 WPA Reassociate ${iface} ${ip} ${user} ${pass} ${container_type} ${container_name}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700150 Run Keyword If '${auth_pass}' == 'True' Wait Until Keyword Succeeds ${timeout} 2s
Andy Bavier84834d42020-02-25 13:49:50 -0700151 ... Check Remote File Contents True ${wpa_log} ${iface}.*authentication completed successfully
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700152 ... ${ip} ${user} ${pass} ${container_type} ${container_name}
suraj gour7f6d5fe2019-11-29 10:56:35 +0000153 Run Keyword If '${auth_pass}' == 'False' Sleep 20s
Suchitra Vemuri3cb29f82020-02-25 13:59:58 -0800154 Run Keyword If '${auth_pass}' == 'False' Check Remote File Contents False /tmp/wpa.log
Andy Bavier84834d42020-02-25 13:49:50 -0700155 ... ${iface}.*authentication completed successfully ${ip} ${user} ${pass}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700156 ... ${container_type} ${container_name}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000157
158Send Dhclient Request To Release Assigned IP
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700159 [Arguments] ${iface} ${ip} ${user} ${path_dhcpleasefile} ${pass}=${None}
160 ... ${container_type}=${None} ${container_name}=${None}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000161 [Documentation] Executes a dhclient with option to release ip against a particular interface on the RG (src)
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700162 ${result}= Login And Run Command On Remote System
163 ... dhclient -nw -r ${iface} && rm ${path_dhcpleasefile}/dhclient.* ${ip} ${user}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000164 ... ${pass} ${container_type} ${container_name}
165 Log ${result}
166 #Should Contain ${result} DHCPRELEASE
167 [Return] ${result}
suraj gour1ecfae92019-12-20 15:11:40 +0000168
169Check Remote File Contents For WPA Logs
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700170 [Arguments] ${file_should_exist} ${file} ${pattern} ${ip} ${user} ${pass}=${None}
171 ... ${container_type}=${None} ${container_name}=${None} ${prompt}=~$
suraj gour1ecfae92019-12-20 15:11:40 +0000172 [Documentation] Checks for particular pattern count in a file
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700173 ${result}= Login And Run Command On Remote System
174 ... cat ${file} | grep '${pattern}' | wc -l ${ip} ${user} ${pass}
suraj gour1ecfae92019-12-20 15:11:40 +0000175 ... ${container_type} ${container_name} ${prompt}
176 [Return] ${result}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000177
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800178
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000179Perform Sanity Test
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800180 [Documentation] This keyword iterate all OLTs and performs Sanity Test Procedure
181 ... for all the ONUs connected to each OLT - ATT workflow
182 FOR ${J} IN RANGE 0 ${num_olts}
183 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
184 ${onu_count}= Set Variable ${list_olts}[${J}][onucount]
185 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
186 ... ${olt_serial_number}
187 Set Global Variable ${of_id}
188 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
189 ... Get NNI Port in ONOS ${of_id}
190 Set Global Variable ${nni_port}
191 # Verify Default Meter in ONOS (valid only for ATT)
192 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
193 ... Verify Default Meter Present in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
194 Perform Sanity Test Per OLT ${of_id} ${nni_port} ${olt_serial_number} ${onu_count}
195 END
196
197Perform Sanity Test Per OLT
198 [Arguments] ${of_id} ${nni_port} ${olt_serial_number} ${num_onus}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000199 [Documentation] This keyword performs Sanity Test Procedure
200 ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD
201 ... This keyword can be used to call in any other tests where sanity check is required
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800202 ... and avoids duplication of code. - ATT workflow
203 #${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
204 #Set Global Variable ${of_id}
205 #${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
206 #... Get NNI Port in ONOS ${of_id}
207 #Set Global Variable ${nni_port}
Hardik Windlass2a9b1592020-07-23 18:28:13 +0530208 # Verify Default Meter in ONOS (valid only for ATT)
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800209 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
210 #... Verify Default Meter Present in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
211 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000212 ${src}= Set Variable ${hosts.src[${I}]}
213 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800214 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
Suchitra Vemuri03005912020-02-20 18:59:46 -0800215 Run Keyword and Ignore Error Collect Logs
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000216 ${onu_device_id}= Get Device ID From SN ${src['onu']}
217 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
218 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Suchitra Vemuri8078b972020-02-06 19:07:41 -0800219 # Check ONU port is Enabled in ONOS
220 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700221 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri8078b972020-02-06 19:07:41 -0800222 # Verify EAPOL flows are added for the ONU port
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000223 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800224 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri8078b972020-02-06 19:07:41 -0800225 # Verify ONU state in voltha
226 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
227 ... ENABLED ACTIVE REACHABLE
228 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
229 # Perform Authentication
Andy Bavier84834d42020-02-25 13:49:50 -0700230 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
231 ... /tmp/wpa ${src['dp_iface_name']} log
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000232 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
233 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700234 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000235 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
ubuntu6b6e7d42020-03-02 12:35:42 -0800236 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000237 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
ubuntu6b6e7d42020-03-02 12:35:42 -0800238 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000239 ... volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800240 # Verify that no pending flows exist for the ONU port
241 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
242 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530243 # Verify subscriber access flows are added for the ONU port
244 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
245 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
246 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Hardik Windlass2a9b1592020-07-23 18:28:13 +0530247 # Verify Meters in ONOS
248 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
249 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000250 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
251 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
252 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
253 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
254 ... ${dst['container_name']}
255 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800256 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000257 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
258 Run Keyword and Ignore Error Collect Logs
259 END
260
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000261Perform Sanity Test DT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800262 [Documentation] This keyword iterate all OLTs and performs Sanity Test Procedure for DT workflow
263 FOR ${J} IN RANGE 0 ${num_olts}
264 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
265 ${num_onus}= Set Variable ${list_olts}[${J}][onucount]
266 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
267 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
268 ... ${olt_serial_number}
269 Set Global Variable ${of_id}
270 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
271 ... Get NNI Port in ONOS ${of_id}
272 Set Global Variable ${nni_port}
273 Perform Sanity Test DT Per OLT ${of_id} ${nni_port} ${olt_serial_number} ${num_onus}
274 # Verify ONOS Flows
275 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
276 ${onos_flows_count}= Evaluate 4 * ${num_onus}
277 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
278 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
279 ... ${onos_flows_count}
280 # Verify VOLTHA Flows
281 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
282 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
283 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
284 ${onu_flows}= Set Variable 2
285 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
286 ... ${olt_device_id}
287 ${List_ONU_Serial} Create List
288 Set Suite Variable ${List_ONU_Serial}
289 Build ONU SN List ${List_ONU_Serial}
290 Log ${List_ONU_Serial}
291 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
292 ... ${List_ONU_Serial} ${onu_flows}
293 END
294
295
296Perform Sanity Test DT Per OLT
297 [Arguments] ${of_id} ${nni_port} ${olt_serial_number} ${num_onus}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000298 [Documentation] This keyword performs Sanity Test Procedure for DT Workflow
299 ... Sanity test performs dhcp and pings (without EAPOL and DHCP flows) for all the ONUs given for the POD
300 ... This keyword can be used to call in any other tests where sanity check is required
301 ... and avoids duplication of code.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800302 #${of_id}= Wait Until Keyword Succeeds 360s 15s Validate OLT Device in ONOS ${olt_serial_number}
303 #Set Global Variable ${of_id}
304 #${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
305 #... Get NNI Port in ONOS ${of_id}
306 #Set Global Variable ${nni_port}
307 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000308 ${src}= Set Variable ${hosts.src[${I}]}
309 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800310 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000311 ${onu_device_id}= Get Device ID From SN ${src['onu']}
312 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
313 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
314 # Check ONU port is Enabled in ONOS
315 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700316 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000317 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
ubuntu6b6e7d42020-03-02 12:35:42 -0800318 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000319 ... volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530320 # Verify subscriber access flows are added for the ONU port
321 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530322 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
323 ... ${onu_port} ${nni_port} ${src['s_tag']}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000324 # Verify ONU state in voltha
325 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
326 ... ENABLED ACTIVE REACHABLE
327 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlass2a9b1592020-07-23 18:28:13 +0530328 # Verify Meters in ONOS
329 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
330 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530331 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000332 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
333 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
334 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
335 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
336 ... ${dst['container_name']}
337 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
338 Run Keyword and Ignore Error Collect Logs
339 END
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530340 # Verify ONOS Flows
341 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800342 #${onos_flows_count}= Evaluate 4 * ${num_onus}
343 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
344 #... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
345 #... ${onos_flows_count}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530346 # Verify VOLTHA Flows
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000347 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800348 #${olt_flows}= Evaluate 2 * ${num_onus} + 1
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000349 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800350 #${onu_flows}= Set Variable 2
351 #Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
352 #${List_ONU_Serial} Create List
353 #Set Suite Variable ${List_ONU_Serial}
354 #Build ONU SN List ${List_ONU_Serial}
355 #Log ${List_ONU_Serial}
356 #Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
357 #... ${List_ONU_Serial} ${onu_flows}
358
359Validate All OLT Flows
360 [Documentation] This keyword iterate all OLTs and performs Sanity Test Procedure for DT workflow
361 FOR ${J} IN RANGE 0 ${num_olts}
362 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
363 ${num_onus}= Set Variable ${list_olts}[${J}][onucount]
364 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
365 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
366 ... ${olt_serial_number}
367 Set Global Variable ${of_id}
368 # Verify ONOS Flows
369 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
370 ${onos_flows_count}= Evaluate 4 * ${num_onus}
371 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
372 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
373 ... ${onos_flows_count}
374 # Verify VOLTHA Flows
375 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
376 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
377 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
378 ${onu_flows}= Set Variable 2
379 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
380 ... ${olt_device_id}
381 ${List_ONU_Serial} Create List
382 Set Suite Variable ${List_ONU_Serial}
383 Build ONU SN List ${List_ONU_Serial}
384 Log ${List_ONU_Serial}
385 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
386 ... ${List_ONU_Serial} ${onu_flows}
387 END
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000388
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -0700389Perform Sanity Test TT
390 [Documentation] This keyword performs Sanity Test Procedure for TT Workflow
391 ... Sanity test performs dhcp and pings (without EAPOL and DHCP flows) for all the ONUs given for the POD
392 ... This keyword can be used to call in any other tests where sanity check is required
393 ... and avoids duplication of code.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800394 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -0700395 ${src}= Set Variable ${hosts.src[${I}]}
396 ${dst}= Set Variable ${hosts.dst[${I}]}
397 ${service_type}= Get Variable Value ${src['service_type']} "null"
398 Run Keyword IF '${service_type}' != 'mcast' Sanity Test TT one ONU ${src} ${dst}
399 Run Keyword and Ignore Error Collect Logs
400 END
401 Run Keyword and Ignore Error Collect Logs
402
403Sanity Test TT one ONU
404 [Documentation] This keyword performs sanity test for a single ONU for TT workflow
405 ... Tests for one ONU
406 ... Assertions apply to HSIA, VoD, VoIP services
407 [Arguments] ${src} ${dst}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800408 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${src['olt']}
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -0700409 Set Global Variable ${of_id}
410 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
411 ... Get NNI Port in ONOS ${of_id}
412 Set Global Variable ${nni_port}
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -0700413 ${onu_device_id}= Get Device ID From SN ${src['onu']}
414 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
415 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
416 # Check ONU port is Enabled in ONOS
417 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
418 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
419 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
420 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
421 ... volt-add-subscriber-access ${of_id} ${onu_port}
422 Sleep 30s
423 # Verify ONU state in voltha
424 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
425 ... ENABLED ACTIVE REACHABLE
426 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
427 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
428 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
429 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
430 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
431 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
432 ... ${dst['container_name']}
Suchitra Vemuri16644bd2020-10-03 14:06:12 -0700433 Run Keyword IF ${has_dataplane}
Suchitra Vemurib4d9e8d2020-10-05 20:49:21 -0700434 ... Run Keyword IF '${src['service_type']}'!='hsia'
Suchitra Vemuri42819412020-10-01 17:45:43 -0700435 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri8d3b0032020-09-11 17:49:08 -0700436 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri42819412020-10-01 17:45:43 -0700437 ... ${src['c_tag']}
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -0700438 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
439 Run Keyword and Ignore Error Collect Logs
440
441Perform Sanity Test TT MCAST
442 [Documentation] This keyword performs Sanity Test Procedure for TT Workflow
443 ... Adds subscribers
444 ... Validates for MCAST
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800445 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -0700446 ${src}= Set Variable ${hosts.src[${I}]}
447 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -0700448 ${service_type}= Get Variable Value ${src['service_type']} "null"
449 Run Keyword IF '${service_type}' == 'mcast' Sanity Test TT MCAST one ONU ${src}
450 ... ${dst}
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -0700451 Run Keyword and Ignore Error Collect Logs
452 END
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -0700453 Run Keyword and Ignore Error Collect Logs
454
455Sanity Test TT MCAST one ONU
456 [Documentation] This keyword performs sanity test for a single ONU for TT workflow
457 ... Tests for one ONU
458 ... Assertions apply to MCAST services
459 [Arguments] ${src} ${dst}
460 # Check for iperf and jq tools
461 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf jq
462 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
463 ... ${src['container_name']}
464 Pass Execution If ${rc} != 0 Skipping test: iperf / jq not found on the RG
465
466 #Reset the IP on the interface
467 ${output}= Login And Run Command On Remote System sudo ifconfig ${src['dp_iface_name']} 0
468 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
469 # Kill iperf on BNG
470 ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
471 ... sudo kill -9 `pidof iperf`
472 ... ${dst['bng_ip']} ${dst['bng_user']} ${dst['bng_pass']} ${dst['container_type']}
473 ... ${dst['container_name']}
474
475 # Setup RG for Multi-cast test
476 ${output}= Login And Run Command On Remote System
477 ... sudo ifconfig ${src['dp_iface_name']} ${src['mcast_rg']} up ; sudo kill -9 `pidof iperf`
478 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
479 ${output}= Login And Run Command On Remote System
480 ... sudo ip route add ${src['mcast_grp_subnet_mask']} dev ${src['dp_iface_name']} scope link
481 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
482
483 # Perform operations for adding subscriber
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800484 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${src['olt']}
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -0700485 Set Global Variable ${of_id}
486 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
487 ... Get NNI Port in ONOS ${of_id}
488 Set Global Variable ${nni_port}
489 ${onu_device_id}= Get Device ID From SN ${src['onu']}
490 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
491 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
492 # Check ONU port is Enabled in ONOS
493 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
494 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
495 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
496 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
497 ... volt-add-subscriber-access ${of_id} ${onu_port}
498 Sleep 30s
499 # Verify ONU state in voltha
500 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
501 ... ENABLED ACTIVE REACHABLE
502 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
503
504 # Setup iperf on the BNG
505 ${server_output}= Login And Run Command On Remote System
506 ... sudo iperf -c ${dst['dp_iface_ip_qinq']} -u -T 32 -t 60 -i 1 &
507 ... ${dst['bng_ip']} ${dst['bng_user']} ${dst['bng_pass']} ${dst['container_type']}
508 ... ${dst['container_name']}
509
510 # Setup iperf on the RG
511 ${rg_output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s
512 ... Login And Run Command On Remote System
513 ... rm -rf /tmp/rg_output ; sudo iperf -s -u -B ${dst['dp_iface_ip_qinq']} -i 1 -D >> /tmp/rg_output
514 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
515 Log ${rg_output}
516 Sleep 60s
517 ${output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s
518 ... Login And Run Command On Remote System
519 ... cat /tmp/rg_output | grep KBytes
520 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
521 Log ${output}
522 Should Contain ${output} KBytes
523
524 # Kill iperf on BNG
525 ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
526 ... sudo kill -9 `pidof iperf`
527 ... ${dst['bng_ip']} ${dst['bng_user']} ${dst['bng_pass']} ${dst['container_type']}
528 ... ${dst['container_name']}
529
530 # Kill iperf on the RG
531 ${output}= Run Keyword and Continue On Failure Login And Run Command On Remote System
532 ... sudo kill -9 `pidof iperf`
533 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
534
Suchitra Vemuri2f1e07d2020-06-26 19:18:01 -0700535
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000536Setup
537 [Documentation] Pre-test Setup
538 #test for empty device list
539 Test Empty Device List
Suchitra Vemuri3158f3c2020-05-28 17:58:26 -0700540 #Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s Openolt is Up
541 #... ${olt_ip} ${olt_user} ${olt_pass}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700542 Run Keyword If ${has_dataplane} Sleep 230s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800543 # Create a list of olt ids (logical and device_id)
544 ${olt_ids} Create List
545 FOR ${I} IN RANGE 0 ${num_olts}
546 #create/preprovision device
547 ${olt_device_id}= Create Device ${list_olts}[${I}][ip] ${OLT_PORT}
548 ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn]
549 #Set Suite Variable ${olt_device_id}
550 #validate olt states
551 Wait Until Keyword Succeeds ${timeout} 5s
552 ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${olt_device_id}
553 Sleep 5s
554 Enable Device ${olt_device_id}
555 Wait Until Keyword Succeeds 380s 5s
556 ... Validate OLT Device ENABLED ACTIVE REACHABLE ${olt_serial_number}
557 ${logical_id}= Get Logical Device ID From SN ${olt_serial_number}
558 # Set Suite Variable ${logical_id}
559 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
560 ... ${olt_serial_number}
561 ${olt} Create Dictionary device_id ${olt_device_id} logical_id ${logical_id}
562 ... of_id ${of_id} sn ${olt_serial_number}
563 Append To List ${olt_ids} ${olt}
564 END
565 Set Global Variable ${olt_ids}
566
567Get ofID From OLT List
568 [Documentation] Retrieves the corresponding of_id for the OLT serial number specified
569 [Arguments] ${serial_number}
570 FOR ${I} IN RANGE 0 ${olt_count}
571 ${sn}= Get From Dictionary ${olt_ids}[${I}] sn
572 ${of_id}= Run Keyword IF "${serial_number}"=="${sn}" Get From Dictionary ${olt_ids}[${I}] of_id
573 END
574 [Return] ${of_id}
575
576Get OLTDeviceID From OLT List
577 [Documentation] Retrieves the corresponding olt_device_id for the OLT serial number specified
578 [Arguments] ${serial_number}
579 FOR ${I} IN RANGE 0 ${olt_count}
580 ${sn}= Get From Dictionary ${olt_ids}[${I}] sn
581 ${olt_device_id}= Run Keyword IF "${serial_number}"=="${sn}" Get From Dictionary ${olt_ids}[${I}] device_id
582 END
583 [Return] ${olt_device_id}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000584
Hardik Windlassaaea3402020-03-10 19:45:45 +0530585Validate ONUs After OLT Disable
586 [Documentation] Validates the ONUs state in Voltha, ONUs port state in ONOS
587 ... and that pings do not succeed After corresponding OLT is Disabled
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800588 [Arguments] ${num_onus}
Hardik Windlassaaea3402020-03-10 19:45:45 +0530589 FOR ${I} IN RANGE 0 ${num_onus}
590 ${src}= Set Variable ${hosts.src[${I}]}
591 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800592 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlassaaea3402020-03-10 19:45:45 +0530593 ${onu_device_id}= Get Device ID From SN ${src['onu']}
594 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
595 ... ${of_id}
596 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
597 ... Validate Device ENABLED DISCOVERED
598 ... UNREACHABLE ${src['onu']} onu=True onu_reason=stopping-openomci
599 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700600 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassaaea3402020-03-10 19:45:45 +0530601 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
602 ... Wait Until Keyword Succeeds 60s 2s
603 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
604 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
605 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
606 Run Keyword and Ignore Error Collect Logs
607 END
608
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000609Delete All Devices and Verify
610 [Documentation] Remove any devices from VOLTHA and ONOS
611 # Clear devices from VOLTHA
612 Disable Devices In Voltha Root=true
Suchitra Vemuri970747f2020-03-30 17:31:34 -0700613 Sleep 5s
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000614 Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled In Voltha Root=true
615 Delete Devices In Voltha Root=true
Matteo Scandolof6cea382020-04-20 14:32:00 -0700616 Run Keyword If ${has_dataplane} Sleep 30s
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000617 Wait Until Keyword Succeeds ${timeout} 2s Test Empty Device List
618 # Clear devices from ONOS
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800619 #Remove All Devices From ONOS
ubuntu6b6e7d42020-03-02 12:35:42 -0800620 #... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000621
622Teardown
623 [Documentation] kills processes and cleans up interfaces on src+dst servers
624 Run Keyword If ${has_dataplane} Clean Up Linux
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000625
626Teardown Suite
627 [Documentation] Clean up device if desired
628 Run Keyword If ${teardown_device} Delete All Devices and Verify
629
630Delete Device and Verify
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800631 [Arguments] ${olt_serial_number}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000632 [Documentation] Disable -> Delete devices via voltctl and verify its removed
Suchitra Vemuri2fa9bba2020-01-22 17:38:48 -0800633 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000634 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800635 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000636 Should Be Equal As Integers ${rc} 0
637 Sleep 5s
638 Wait Until Keyword Succeeds ${timeout} 5s
639 ... Validate OLT Device DISABLED UNKNOWN REACHABLE ${olt_serial_number}
640 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800641 ... voltctl -c ${VOLTCTL_CONFIG} device delete ${olt_device_id}
Matteo Scandolof6cea382020-04-20 14:32:00 -0700642 Run Keyword If ${has_dataplane} Sleep 50s
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000643 Should Be Equal As Integers ${rc} 0
644 Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id}
645
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000646Repeat Sanity Test
647 [Documentation] This keyword performs Sanity Test Procedure
648 ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD
649 ... This keyword can be used to call in any other tests where sanity check is required
650 ... with wpa reassociation
651 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
652 Set Global Variable ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800653 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri03005912020-02-20 18:59:46 -0800654 Run Keyword and Ignore Error Collect Logs
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000655 ${src}= Set Variable ${hosts.src[${I}]}
656 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri8078b972020-02-06 19:07:41 -0800657 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
658 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
659 # Check ONU port is Enabled in ONOD
660 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700661 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri8078b972020-02-06 19:07:41 -0800662 # Verify EAPOL flows are added for the ONU port
663 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
David K. Bainbridgec0617c92020-03-05 21:17:19 -0800664 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri8078b972020-02-06 19:07:41 -0800665 # Verify ONU state in voltha
Suchitra Vemurid1e27fb2020-02-01 16:34:37 -0800666 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
Suchitra Vemuri81e4f022020-02-01 13:16:02 -0800667 ... ENABLED ACTIVE REACHABLE
668 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemuri8078b972020-02-06 19:07:41 -0800669 # Perform Authentication
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000670 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
671 ... Validate Authentication After Reassociate
672 ... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
673 ... ${src['container_type']} ${src['container_name']}
674 Wait Until Keyword Succeeds ${timeout} 2s
David K. Bainbridgec0617c92020-03-05 21:17:19 -0800675 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000676 Wait Until Keyword Succeeds ${timeout} 2s
David K. Bainbridgec0617c92020-03-05 21:17:19 -0800677 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000678 ... volt-add-subscriber-access ${of_id} ${onu_port}
679 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
680 ... Validate DHCP and Ping True True
681 ... ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
682 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
683 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
684 ... ${dst['container_name']}
685 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
David K. Bainbridgec0617c92020-03-05 21:17:19 -0800686 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000687 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
688 Run Keyword and Ignore Error Collect Logs
689 END
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000690
Hardik Windlass16cdf962020-04-29 15:26:50 +0530691Validate ONUs for PON OLT Disable
692 [Arguments] ${olt_peer_list}
693 [Documentation] This keyword validates that Ping fails for ONUs connected to Disabled OLT PON port
694 ... And Pings succeed for other Active OLT PON port ONUs
695 ... Also it removes subscriber for Disabled OLT PON port ONUs to replicate ATT workflow
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800696 FOR ${I} IN RANGE 0 ${num_all_nus}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530697 ${src}= Set Variable ${hosts.src[${I}]}
698 ${dst}= Set Variable ${hosts.dst[${I}]}
699 ${onu_device_id}= Get Device ID From SN ${src['onu']}
700 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
701 ... ${of_id}
702 ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id}
703 Run Keyword If ${matched}
704 ... Run Keywords
705 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
706 ... Validate Device ENABLED DISCOVERED
707 ... UNREACHABLE ${src['onu']} onu=True onu_reason=stopping-openomci
708 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
709 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
710 ... AND Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
711 ... Wait Until Keyword Succeeds 60s 2s
712 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
713 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
714 ... ${src['container_name']}
715 # Remove Subscriber Access (To replicate ATT workflow)
716 ... AND Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
717 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
718 ... ELSE
719 ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
720 ... Wait Until Keyword Succeeds 60s 2s
721 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
722 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
723 ... ${src['container_name']}
724 Run Keyword and Ignore Error Collect Logs
725 END
726
727Validate ONUs for PON OLT Enable
728 [Arguments] ${olt_peer_list}
729 [Documentation] This keyword validates Ping succeeds for all Enabled/Acitve OLT PON ports
730 ... Also performs Auth/subscriberAdd/DHCP/Ping for the ONUs on Re-Enabled OLT PON port
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800731 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530732 ${src}= Set Variable ${hosts.src[${I}]}
733 ${dst}= Set Variable ${hosts.dst[${I}]}
734 ${onu_device_id}= Get Device ID From SN ${src['onu']}
735 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
736 ... ${of_id}
737 ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id}
738 ${wpa_log}= Run Keyword If ${has_dataplane} and ${matched} Catenate SEPARATOR=.
739 ... /tmp/wpa ${src['dp_iface_name']} log
740 Run Keyword If ${matched}
741 ... Run Keywords
742 # Perform Cleanup
743 ... Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
744 # Verify ONU port status
745 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
746 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
747 # Verify EAPOL flows are added for the ONU port
748 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
749 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
750 # Verify ONU state in voltha
751 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
752 ... Validate Device ENABLED ACTIVE REACHABLE
753 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
754 # Perform Authentication
755 ... AND Run Keyword If ${has_dataplane}
756 ... Run Keyword And Continue On Failure Validate Authentication True
757 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
758 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
759 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
760 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
761 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
762 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
763 ... volt-add-subscriber-access ${of_id} ${onu_port}
764 # Verify that no pending flows exist for the ONU port
765 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
766 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
767 # Verify subscriber access flows are added for the ONU port
768 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
769 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
770 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
771 ... AND Run Keyword If ${has_dataplane}
772 ... Run Keyword And Continue On Failure Validate DHCP and Ping True
773 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
774 ... ${src['ip']} ${src['user']} ${src['pass']}
775 ... ${src['container_type']} ${src['container_name']}
776 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']}
777 ... ${dst['container_type']} ${dst['container_name']}
778 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
779 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
780 ... AND Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
781 ... ELSE
782 ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
783 ... Wait Until Keyword Succeeds 60s 2s
784 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
785 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
786 ... ${src['container_name']}
787 Run Keyword and Ignore Error Collect Logs
788 END
789
790Validate ONUs for PON OLT Disable DT
791 [Arguments] ${olt_peer_list}
792 [Documentation] This keyword validates that Ping fails for ONUs connected to Disabled OLT PON port
793 ... And Pings succeed for other Active OLT PON port ONUs
794 ... Also it removes subscriber and deletes ONUs for Disabled OLT PON port to replicate DT workflow
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800795 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530796 ${src}= Set Variable ${hosts.src[${I}]}
797 ${dst}= Set Variable ${hosts.dst[${I}]}
798 ${onu_device_id}= Get Device ID From SN ${src['onu']}
799 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
800 ... ${of_id}
801 ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id}
802 Run Keyword If ${matched}
803 ... Run Keywords
804 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
805 ... Validate Device ENABLED DISCOVERED
806 ... UNREACHABLE ${src['onu']} onu=True onu_reason=stopping-openomci
807 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
808 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
809 ... AND Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
810 ... Wait Until Keyword Succeeds 60s 2s
811 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
812 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
813 ... ${src['container_name']}
814 # Remove Subscriber Access (To replicate DT workflow)
815 ... AND Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
816 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
817 ... AND Sleep 10s
818 # Delete ONU Device (To replicate DT workflow)
819 ... AND Delete Device ${onu_device_id}
820 ... AND Sleep 5s
821 ... ELSE
822 ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
823 ... Wait Until Keyword Succeeds 60s 2s
824 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
825 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
826 ... ${src['container_name']}
827 Run Keyword and Ignore Error Collect Logs
828 END
829
830Validate ONUs for PON OLT Enable DT
831 [Arguments] ${olt_peer_list}
832 [Documentation] This keyword validates Ping succeeds for all Enabled/Acitve OLT PON ports
833 ... Also performs subscriberAdd/DHCP/Ping for the ONUs on Re-Enabled OLT PON port
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800834 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530835 ${src}= Set Variable ${hosts.src[${I}]}
836 ${dst}= Set Variable ${hosts.dst[${I}]}
837 ${onu_device_id}= Get Device ID From SN ${src['onu']}
838 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
839 ... ${of_id}
840 ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id}
841 Run Keyword If ${matched}
842 ... Run Keywords
843 # Perform Cleanup
844 ... Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
845 # Verify ONU port status
846 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
847 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
848 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
849 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
850 ... volt-add-subscriber-access ${of_id} ${onu_port}
851 # Verify ONU state in voltha
852 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
853 ... Validate Device ENABLED ACTIVE REACHABLE
854 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
855 # Verify subscriber access flows are added for the ONU port
856 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
857 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
858 ... ${onu_port} ${nni_port} ${src['s_tag']}
859 ... AND Run Keyword If ${has_dataplane}
860 ... Run Keyword And Continue On Failure Validate DHCP and Ping True
861 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
862 ... ${src['ip']} ${src['user']} ${src['pass']}
863 ... ${src['container_type']} ${src['container_name']}
864 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']}
865 ... ${dst['container_type']} ${dst['container_name']}
866 ... ELSE
867 ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
868 ... Wait Until Keyword Succeeds 60s 2s
869 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
870 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
871 ... ${src['container_name']}
872 Run Keyword and Ignore Error Collect Logs
873 END
874
875Match ONU in PON OLT Peer List
876 [Arguments] ${olt_peer_list} ${onu_device_id}
877 [Documentation] This keyword matches if ONU device is present in OLT PON port peer list
878 ${matched}= Set Variable False
879 FOR ${olt_peer} IN @{olt_peer_list}
880 ${matched}= Set Variable If '${onu_device_id}' == '${olt_peer}' True False
881 Exit For Loop If ${matched}
882 END
883 [Return] ${matched}
884
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000885Collect Logs
886 [Documentation] Collect Logs from voltha and onos cli for various commands
887 Run Keyword and Ignore Error Get Device List from Voltha
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800888 FOR ${I} IN RANGE 0 ${num_olts}
889 Run Keyword and Ignore Error Get Logical Device Output from Voltha ${logical_id}
890 Run Keyword and Ignore Error Get Device Output from Voltha ${olt_ids}[${I}][device_id]
891 Run Keyword and Ignore Error Get Logical Device Output from Voltha ${olt_ids}[${I}][logical_id]
892 END
893 #Run Keyword and Ignore Error Get Device Output from Voltha ${olt_device_id}
894 #Run Keyword and Ignore Error Get Logical Device Output from Voltha ${logical_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800895 Get ONOS Status ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000896
897Verify ping is succesful except for given device
898 [Arguments] ${num_onus} ${exceptional_onu_id}
899 [Documentation] Checks that ping for all the devices are successful except the given ONU.
900 ${pingStatus} Set Variable True
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800901 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000902 ${src}= Set Variable ${hosts.src[${I}]}
903 ${dst}= Set Variable ${hosts.dst[${I}]}
904 ${onu_device_id}= Get Device ID From SN ${src['onu']}
905 ${pingStatus} Run Keyword If '${onu_device_id}' == '${exceptional_onu_id}' Set Variable False
906 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
907 ... Check Ping ${pingStatus} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
908 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
909 END
Andy Bavier4a8450e2020-02-04 08:58:37 -0700910
Andy Bavier1923ecc2020-06-18 14:06:40 -0700911Echo Message to OLT Logs
912 [Arguments] ${message}
913 [Documentation] Echoes ${message} into the OLT logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800914 FOR ${I} IN RANGE 0 ${num_olts}
915 ${olt_user} Evaluate ${olts}[${I}].get("user")
916 ${olt_pass} Evaluate ${olts}[${I}].get("pass")
917 ${olt_ssh_ip} Evaluate ${olts}[${I}].get("sship")
918 Wait Until Keyword Succeeds 180s 10s Execute Remote Command
919 ... printf '%s\n' '' '' '${message}' '' >> /var/log/openolt.log
920 ... ${olt_ssh_ip} ${olt_user} ${olt_pass}
921 Wait Until Keyword Succeeds 180s 10s Execute Remote Command
922 ... printf '%s\n' '' '' '${message}' '' >> /var/log/dev_mgmt_daemon.log
923 ... ${olt_ssh_ip} ${olt_user} ${olt_pass}
924 Wait Until Keyword Succeeds 180s 10s Execute Remote Command
925 ... printf '%s\n' '' '' '${message}' '' >> /var/log/openolt_process_watchdog.log
926 ... ${olt_ssh_ip} ${olt_user} ${olt_pass}
927 END
Andy Bavier1923ecc2020-06-18 14:06:40 -0700928
Andy Bavierabeba262020-02-07 16:22:16 -0700929Start Logging
930 [Arguments] ${label}
931 [Documentation] Start logging for test ${label}
932 ${kail_process}= Run Keyword If "${container_log_dir}" != "${None}" Start Process kail -n default
933 ... -n voltha cwd=${container_log_dir} stdout=${label}-combined.log
934 Set Test Variable ${kail_process}
Andy Bavier1923ecc2020-06-18 14:06:40 -0700935 Run Keyword If ${has_dataplane} Echo Message to OLT Logs START ${label}
Andy Bavierabeba262020-02-07 16:22:16 -0700936
937Stop Logging
938 [Arguments] ${label}
939 [Documentation] End logging for test; remove logfile if test passed
940 Run sync
941 Run Keyword If ${kail_process} Terminate Process ${kail_process}
942 ${test_logfile}= Run Keyword If "${container_log_dir}" != "${None}"
943 ... Join Path ${container_log_dir} ${label}-combined.log
944 Run Keyword If Test Passed Run Keyword If "${test_logfile}" != "${None}" Remove File ${test_logfile}
Andy Bavier1923ecc2020-06-18 14:06:40 -0700945 Run Keyword If ${has_dataplane} Echo Message to OLT Logs END ${label}
Andy Bavierabeba262020-02-07 16:22:16 -0700946
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800947Clean Up Linux
948 [Documentation] Kill processes and clean up interfaces on src+dst servers
Hardik Windlass16cdf962020-04-29 15:26:50 +0530949 [Arguments] ${onu_id}=${EMPTY}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800950 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800951 ${src}= Set Variable ${hosts.src[${I}]}
952 ${dst}= Set Variable ${hosts.dst[${I}]}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530953 ${onu_device_id}= Get Device ID From SN ${src['onu']}
954 Continue For Loop If '${onu_id}' != '${EMPTY}' and '${onu_id}' != '${onu_device_id}'
Andy Bavier84b83282020-06-30 05:47:49 -0700955 Execute Remote Command sudo pkill wpa_supplicant ${src['ip']}
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800956 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Andy Bavier84b83282020-06-30 05:47:49 -0700957 Execute Remote Command sudo pkill dhclient ${src['ip']}
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800958 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Andy Baviereff938d2020-06-29 18:27:49 -0700959 Execute Remote Command sudo pkill mausezahn ${src['ip']}
960 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
961 Run Keyword If '${dst['ip']}' != '${None}' Execute Remote Command pkill dhcpd
962 ... ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800963 Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
964 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
965 Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host
966 ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']}
967 ... ${dst['container_type']} ${dst['container_name']}
Andy Bavier84b83282020-06-30 05:47:49 -0700968 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
969 ${bng_user}= Get Variable Value ${dst['noroot_user']}
970 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700971 Run Keyword If "${bng_ip}" != "${NONE}" and "${bng_user}" != "${NONE}" and "${bng_pass}" != "${NONE}"
972 ... Execute Remote Command sudo pkill mausezahn ${bng_ip} ${bng_user} ${bng_pass}
Andy Baviereff938d2020-06-29 18:27:49 -0700973 ... ${dst['container_type']} ${dst['container_name']}
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800974 END
Scott Baker60e570d2020-02-02 22:10:13 -0800975
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800976Clean Up Linux Per OLT
977 [Documentation] Kill processes and clean up interfaces on src+dst servers
978 [Arguments] ${olt_serial_number}
979 FOR ${I} IN RANGE 0 ${num_all_onus}
980 ${src}= Set Variable ${hosts.src[${I}]}
981 ${dst}= Set Variable ${hosts.dst[${I}]}
982 ${onu_device_id}= Get Device ID From SN ${src['onu']}
983 ${sn}= Get Device ID From SN ${src['olt']}
984 #Continue For Loop If '${onu_id}' != '${EMPTY}' and '${onu_id}' != '${onu_device_id}'
985 Continue For Loop If '${olt_serial_number}' == '${sn}'
986 Execute Remote Command sudo pkill wpa_supplicant ${src['ip']}
987 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
988 Execute Remote Command sudo pkill dhclient ${src['ip']}
989 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
990 Execute Remote Command sudo pkill mausezahn ${src['ip']}
991 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
992 Run Keyword If '${dst['ip']}' != '${None}' Execute Remote Command pkill dhcpd
993 ... ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
994 Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
995 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
996 Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host
997 ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']}
998 ... ${dst['container_type']} ${dst['container_name']}
999 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
1000 ${bng_user}= Get Variable Value ${dst['noroot_user']}
1001 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
1002 Run Keyword If "${bng_ip}" != "${NONE}" and "${bng_user}" != "${NONE}" and "${bng_pass}" != "${NONE}"
1003 ... Execute Remote Command sudo pkill mausezahn ${bng_ip} ${bng_user} ${bng_pass}
1004 ... ${dst['container_type']} ${dst['container_name']}
1005 END
1006
Suchitra Vemuri8d3b0032020-09-11 17:49:08 -07001007Clean dhclient
1008 [Documentation] Kills dhclient processes only for all RGs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -08001009 FOR ${I} IN RANGE 0 ${num_all_nus}
Suchitra Vemuri8d3b0032020-09-11 17:49:08 -07001010 ${src}= Set Variable ${hosts.src[${I}]}
1011 ${dst}= Set Variable ${hosts.dst[${I}]}
1012 Execute Remote Command sudo pkill dhclient ${src['ip']}
1013 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
1014 END
1015
Suchitra Vemurif7a033c2020-02-26 17:22:41 -08001016Clean WPA Process
1017 [Documentation] Kills wpa_supplicant processes only for all RGs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -08001018 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -08001019 ${src}= Set Variable ${hosts.src[${I}]}
1020 ${dst}= Set Variable ${hosts.dst[${I}]}
1021 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
1022 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
1023 END
1024
Scott Baker60e570d2020-02-02 22:10:13 -08001025Should Be Larger Than
1026 [Documentation] Verify that value_1 is > value_2
1027 [Arguments] ${value_1} ${value_2}
1028 Run Keyword If ${value_1} <= ${value_2}
1029 ... Fail The value ${value_1} is not larger than ${value_2}
1030
Scott Bakeree675552020-02-11 10:43:34 -08001031Should Be Larger Than Or Equal To
1032 [Documentation] Verify that value_1 is >= value_2
1033 [Arguments] ${value_1} ${value_2}
1034 Run Keyword If ${value_1} < ${value_2}
1035 ... Fail The value ${value_1} is not larger than or equal to ${value_2}
1036
Scott Baker60e570d2020-02-02 22:10:13 -08001037Should Be Float
1038 [Documentation] Verify that value is a floating point number type
1039 [Arguments] ${value}
1040 ${type} Evaluate type(${value}).__name__
1041 Should Be Equal ${type} float
1042
Scott Bakeree675552020-02-11 10:43:34 -08001043Should Be Newer Than Or Equal To
1044 [Documentation] Compare two RFC3339 dates
1045 [Arguments] ${value_1} ${value_2}
1046 ${unix_v1} Parse RFC3339 ${value_1}
1047 ${unix_v2} Parse RFC3339 ${value_2}
1048 Run Keyword If ${unix_v1} < ${unix_v2}
1049 ... Fail The value ${value_1} is not newer than or equal to ${value_2}
1050
Scott Baker60e570d2020-02-02 22:10:13 -08001051Get Current Time
1052 [Documentation] Return the current time in RFC3339 format
1053 ${output}= Run date -u +"%FT%T%:z"
1054 [return] ${output}
Scott Bakeree675552020-02-11 10:43:34 -08001055
1056Parse RFC3339
1057 [Documentation] Parse an RFC3339 timestamp
1058 [Arguments] ${dateStr}
1059 ${rc} ${output}= Run and Return Rc and Output date --date="${dateStr}" "+%s"
1060 Should Be Equal As Numbers ${rc} 0
1061 [return] ${output}
Matteo Scandolo142e6272020-04-29 17:36:59 -07001062
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001063Get Bandwidth Profile Name For Given Subscriber
1064 [Arguments] ${subscriber_id} ${stream_type}=upstreamBandwidthProfile
1065 [Documentation] Keyword to get the bandwidth details of the given subscriber
1066 ${bandwidth_profile_output}= Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
1067 ... volt-programmed-subscribers | grep ${subscriber_id}
1068 @{bandwidth_profile_array}= Split String ${bandwidth_profile_output} ,
1069 Log ${bandwidth_profile_array}
1070 FOR ${value} IN @{bandwidth_profile_array}
1071 @{row_value}= Split String ${value} =
1072 ${bandwidth_profile_name}= Set Variable If '${row_value[0]}' == ' ${stream_type}'
1073 ... ${row_value[1]}
1074 ${bandwidth_profile_name}= Convert To String ${bandwidth_profile_name}
1075 Run Keyword If "${bandwidth_profile_name}" != "None" Exit For Loop
1076 END
1077 Log ${bandwidth_profile_name}
1078 [Return] ${bandwidth_profile_name}
1079
1080Execute Remote Command
1081 [Documentation] SSH into a remote host and execute a command on the bare host or in a container.
1082 ... This replaces and simplifies the Login And Run Command On Remote System keyword in CORDRobot.
1083 [Arguments] ${cmd} ${ip} ${user} ${pass}=${None}
Andy Baviereff938d2020-06-29 18:27:49 -07001084 ... ${container_type}=${None} ${container_name}=${None} ${timeout}=${None}
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001085 ${conn_id}= SSHLibrary.Open Connection ${ip}
1086 Run Keyword If '${pass}' != '${None}'
1087 ... SSHLibrary.Login ${user} ${pass}
1088 ... ELSE
1089 ... SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/id_rsa
1090 ${namespace}= Run Keyword If '${container_type}' == 'K8S' SSHLibrary.Execute Command
1091 ... kubectl get pods --all-namespaces | grep ${container_name} | awk '{print $1}'
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001092 ${stdout} ${stderr} ${rc}= Run Keyword If '${container_type}' == 'LXC'
1093 ... SSHLibrary.Execute Command lxc exec ${container_name} -- ${cmd}
Andy Baviereff938d2020-06-29 18:27:49 -07001094 ... return_stderr=True return_rc=True timeout=${timeout}
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001095 ... ELSE IF '${container_type}' == 'K8S'
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001096 ... SSHLibrary.Execute Command kubectl -n ${namespace} exec ${container_name} -- ${cmd}
Andy Baviereff938d2020-06-29 18:27:49 -07001097 ... return_stderr=True return_rc=True timeout=${timeout}
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001098 ... ELSE
Andy Baviereff938d2020-06-29 18:27:49 -07001099 ... SSHLibrary.Execute Command ${cmd} return_stderr=True return_rc=True timeout=${timeout}
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001100
1101 Log ${stdout}
1102 Log ${stderr}
1103 Log ${rc}
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001104 SSHLibrary.Close Connection
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001105 [Return] ${stdout} ${stderr} ${rc}
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001106
Suraj Gour33651272020-05-04 10:10:16 +05301107Start Remote Command
1108 [Documentation] SSH into a remote host and execute a command on the bare host or in a container.
1109 ... This replaces and simplifies the Login And Run Command On Remote System keyword in CORDRobot.
1110 [Arguments] ${cmd} ${ip} ${user} ${pass}=${None}
1111 ... ${container_type}=${None} ${container_name}=${None}
1112 ${conn_id}= SSHLibrary.Open Connection ${ip}
1113 Run Keyword If '${pass}' != '${None}'
1114 ... SSHLibrary.Login ${user} ${pass}
1115 ... ELSE
1116 ... SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/id_rsa
1117 ${namespace}= Run Keyword If '${container_type}' == 'K8S' SSHLibrary.Execute Command
1118 ... kubectl get pods --all-namespaces | grep ${container_name} | awk '{print $1}'
1119 Run Keyword If '${container_type}' == 'LXC'
1120 ... SSHLibrary.Start Command lxc exec ${container_name} -- ${cmd}
1121 ... ELSE IF '${container_type}' == 'K8S'
1122 ... SSHLibrary.Start Command kubectl -n ${namespace} exec ${container_name} -- ${cmd}
1123 ... ELSE
1124 ... SSHLibrary.Start Command ${cmd}
Andy Bavier9fb23232020-06-30 15:12:20 -07001125 # It seems that closing the connection immediately will sometimes kill the command
1126 Sleep 1s
Suraj Gour33651272020-05-04 10:10:16 +05301127 SSHLibrary.Close Connection
1128
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001129Run Iperf3 Test Client
1130 [Arguments] ${src} ${server} ${args}
1131 [Documentation] Login to ${src} and run the iperf3 client against ${server} using ${args}.
1132 ... Return a Dictionary containing the results of the test.
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001133 ${output} ${stderr} ${rc}= Execute Remote Command iperf3 -J -c ${server} ${args} | jq -M -c '.'
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001134 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001135 Should Be Equal As Integers ${rc} 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001136 ${object}= Evaluate json.loads(r'''${output}''') json
1137 [Return] ${object}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001138
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -07001139Run Iperf Test Client for MCAST
1140 [Arguments] ${src} ${server} ${args}
1141 [Documentation] Login to ${src} and run the iperf client against ${server} using ${args}.
1142 ... Return a Dictionary containing the results of the test.
1143 ${output} ${stderr} ${rc}= Execute Remote Command sudo iperf -c ${server} ${args} | jq -M -c '.'
1144 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
1145 Should Be Equal As Integers ${rc} 0
1146 ${object}= Evaluate json.loads(r'''${output}''') json
1147 [Return] ${object}
1148
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001149RestoreONUs
1150 [Documentation] Restore all connected ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -08001151 [Arguments] ${num_all_onus}
1152 FOR ${I} IN RANGE 0 ${num_all_onus}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001153 ${src}= Set Variable ${hosts.src[${I}]}
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001154 ${container_type}= Get Variable Value ${src['container_type']} "null"
1155 ${container_name}= Get Variable Value ${src['container_name']} "null"
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001156 ${onu_type}= Get Variable Value ${src['onu_type']} "null"
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001157 #Get ens6f0 from ens6f0.22
1158 ${if_name}= Replace String Using Regexp ${src['dp_iface_name']} \\..* \
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001159 Run Keyword IF '${onu_type}' == 'alpha' AlphaONURestoreDefault ${src['ip']} ${src['user']}
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001160 ... ${src['pass']} ${if_name} admin admin ${container_type} ${container_name}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001161 END
1162
1163AlphaONURestoreDefault
1164 [Documentation] Restore the Alpha ONU to factory setting
1165 [Arguments] ${rg_ip} ${rg_user} ${rg_pass} ${onu_ifname}
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001166 ... ${onu_user} ${onu_pass} ${container_type}=${None} ${container_name}=${None}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001167 ${output}= Login And Run Command On Remote System sudo ifconfig ${onu_ifname} 192.168.1.3/24
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001168 ... ${rg_ip} ${rg_user} ${rg_pass} ${container_type} ${container_name}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001169 ${cmd} Catenate
1170 ... (echo open "192.168.1.1"; sleep 1;
1171 ... echo "${onu_user}"; sleep 1;
1172 ... echo "${onu_pass}"; sleep 1;
1173 ... echo "restoredefault"; sleep 1) | telnet
1174 ${output}= Login And Run Command On Remote System ${cmd}
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001175 ... ${rg_ip} ${rg_user} ${rg_pass} ${container_type} ${container_name}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001176 Log To Console ${output}
1177 ${output}= Login And Run Command On Remote System sudo ifconfig ${onu_ifname} 0
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001178 ... ${rg_ip} ${rg_user} ${rg_pass} ${container_type} ${container_name}
Suraj Gour33651272020-05-04 10:10:16 +05301179
1180Create traffic with each pbit and capture at other end
1181 [Documentation] Generates upstream traffic using Mausezahn tool
1182 ... with each pbit and validates reception at other end using tcpdump
1183 [Arguments] ${target_ip} ${target_iface} ${src_iface}
1184 ... ${packet_count} ${packet_type} ${target_port} ${vlan} ${tcpdump_filter}
1185 ... ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
1186 ... ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
1187 FOR ${pbit} IN RANGE 8
Andy Baviereff938d2020-06-29 18:27:49 -07001188 Execute Remote Command sudo pkill mausezahn
Suraj Gour33651272020-05-04 10:10:16 +05301189 ... ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
Andy Baviereff938d2020-06-29 18:27:49 -07001190 ${var1}= Set Variable sudo mausezahn ${src_iface} -B ${target_ip} -c ${packet_count} -d 100m
Suraj Gour33651272020-05-04 10:10:16 +05301191 ${var2}= Set Variable -t ${packet_type} "dp=${target_port}" -p 1472 -Q ${pbit}:${vlan}
1192 ${cmd}= Set Variable ${var1} ${var2}
1193 Start Remote Command ${cmd} ${src_ip} ${src_user} ${src_pass}
1194 ... ${src_container_type} ${src_container_name}
1195 ${output} ${stderr} ${rc}= Execute Remote Command
Andy Baviereff938d2020-06-29 18:27:49 -07001196 ... sudo tcpdump -l -U -c 30 -i ${target_iface} -e ${tcpdump_filter}
Suraj Gour33651272020-05-04 10:10:16 +05301197 ... ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
Andy Baviereff938d2020-06-29 18:27:49 -07001198 ... timeout=30 seconds
1199 Execute Remote Command sudo pkill mausezahn
Suraj Gour33651272020-05-04 10:10:16 +05301200 ... ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
1201 # VOL-3262: I'm seeing untagged downstream traffic at RG for pbit 0. According to Girish this is
1202 # incorrect behavior. Simplify the following check when VOL-3262 is resolved.
1203 Run Keyword If ${pbit}==0 and "${tcpdump_filter}"=="udp"
1204 ... Should Match Regexp ${output} \\.${target_port}: UDP,
1205 ... ELSE Should Match Regexp ${output} , p ${pbit},.*\\.${target_port}: UDP,
1206 END