blob: 2cfe4ea57b8ede69518cb6bbabdc2aecfa740149 [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}
Andrea Campanella6391f842020-11-16 10:01:18 +0100354 #Build ONU SN List ${List_ONU_Serial} ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800355 #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}
Andrea Campanella6391f842020-11-16 10:01:18 +0100383 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800384 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
Andrea Campanella317a94c2020-11-13 10:38:19 +0100572 ${of_id}= Run Keyword IF "${serial_number}"=="${sn}"
573 ... Get From Dictionary ${olt_ids}[${I}] of_id ELSE Set Variable ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800574 END
575 [Return] ${of_id}
576
577Get OLTDeviceID From OLT List
578 [Documentation] Retrieves the corresponding olt_device_id for the OLT serial number specified
579 [Arguments] ${serial_number}
580 FOR ${I} IN RANGE 0 ${olt_count}
581 ${sn}= Get From Dictionary ${olt_ids}[${I}] sn
Andrea Campanella317a94c2020-11-13 10:38:19 +0100582 ${olt_device_id}= Run Keyword IF "${serial_number}"=="${sn}"
583 ... Get From Dictionary ${olt_ids}[${I}] device_id ELSE Set Variable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800584 END
585 [Return] ${olt_device_id}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000586
Hardik Windlassaaea3402020-03-10 19:45:45 +0530587Validate ONUs After OLT Disable
588 [Documentation] Validates the ONUs state in Voltha, ONUs port state in ONOS
589 ... and that pings do not succeed After corresponding OLT is Disabled
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800590 [Arguments] ${num_onus}
Hardik Windlassaaea3402020-03-10 19:45:45 +0530591 FOR ${I} IN RANGE 0 ${num_onus}
592 ${src}= Set Variable ${hosts.src[${I}]}
593 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800594 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlassaaea3402020-03-10 19:45:45 +0530595 ${onu_device_id}= Get Device ID From SN ${src['onu']}
596 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
597 ... ${of_id}
598 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
599 ... Validate Device ENABLED DISCOVERED
600 ... UNREACHABLE ${src['onu']} onu=True onu_reason=stopping-openomci
601 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700602 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassaaea3402020-03-10 19:45:45 +0530603 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
604 ... Wait Until Keyword Succeeds 60s 2s
605 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
606 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
607 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
608 Run Keyword and Ignore Error Collect Logs
609 END
610
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000611Delete All Devices and Verify
612 [Documentation] Remove any devices from VOLTHA and ONOS
613 # Clear devices from VOLTHA
614 Disable Devices In Voltha Root=true
Suchitra Vemuri970747f2020-03-30 17:31:34 -0700615 Sleep 5s
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000616 Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled In Voltha Root=true
617 Delete Devices In Voltha Root=true
Matteo Scandolof6cea382020-04-20 14:32:00 -0700618 Run Keyword If ${has_dataplane} Sleep 30s
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000619 Wait Until Keyword Succeeds ${timeout} 2s Test Empty Device List
620 # Clear devices from ONOS
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800621 #Remove All Devices From ONOS
ubuntu6b6e7d42020-03-02 12:35:42 -0800622 #... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000623
624Teardown
625 [Documentation] kills processes and cleans up interfaces on src+dst servers
626 Run Keyword If ${has_dataplane} Clean Up Linux
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000627
628Teardown Suite
629 [Documentation] Clean up device if desired
630 Run Keyword If ${teardown_device} Delete All Devices and Verify
631
632Delete Device and Verify
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800633 [Arguments] ${olt_serial_number}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000634 [Documentation] Disable -> Delete devices via voltctl and verify its removed
Suchitra Vemuri2fa9bba2020-01-22 17:38:48 -0800635 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000636 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800637 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000638 Should Be Equal As Integers ${rc} 0
639 Sleep 5s
640 Wait Until Keyword Succeeds ${timeout} 5s
641 ... Validate OLT Device DISABLED UNKNOWN REACHABLE ${olt_serial_number}
642 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800643 ... voltctl -c ${VOLTCTL_CONFIG} device delete ${olt_device_id}
Matteo Scandolof6cea382020-04-20 14:32:00 -0700644 Run Keyword If ${has_dataplane} Sleep 50s
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +0000645 Should Be Equal As Integers ${rc} 0
646 Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id}
647
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000648Repeat Sanity Test
649 [Documentation] This keyword performs Sanity Test Procedure
650 ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD
651 ... This keyword can be used to call in any other tests where sanity check is required
652 ... with wpa reassociation
653 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
654 Set Global Variable ${of_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800655 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri03005912020-02-20 18:59:46 -0800656 Run Keyword and Ignore Error Collect Logs
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000657 ${src}= Set Variable ${hosts.src[${I}]}
658 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri8078b972020-02-06 19:07:41 -0800659 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
660 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
661 # Check ONU port is Enabled in ONOD
662 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700663 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri8078b972020-02-06 19:07:41 -0800664 # Verify EAPOL flows are added for the ONU port
665 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
David K. Bainbridgec0617c92020-03-05 21:17:19 -0800666 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri8078b972020-02-06 19:07:41 -0800667 # Verify ONU state in voltha
Suchitra Vemurid1e27fb2020-02-01 16:34:37 -0800668 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
Suchitra Vemuri81e4f022020-02-01 13:16:02 -0800669 ... ENABLED ACTIVE REACHABLE
670 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemuri8078b972020-02-06 19:07:41 -0800671 # Perform Authentication
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000672 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
673 ... Validate Authentication After Reassociate
674 ... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
675 ... ${src['container_type']} ${src['container_name']}
676 Wait Until Keyword Succeeds ${timeout} 2s
David K. Bainbridgec0617c92020-03-05 21:17:19 -0800677 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000678 Wait Until Keyword Succeeds ${timeout} 2s
David K. Bainbridgec0617c92020-03-05 21:17:19 -0800679 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000680 ... volt-add-subscriber-access ${of_id} ${onu_port}
681 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
682 ... Validate DHCP and Ping True True
683 ... ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
684 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
685 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
686 ... ${dst['container_name']}
687 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
David K. Bainbridgec0617c92020-03-05 21:17:19 -0800688 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Gayathri.Selvan283a63c2020-01-23 04:09:18 +0000689 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
690 Run Keyword and Ignore Error Collect Logs
691 END
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000692
Hardik Windlass16cdf962020-04-29 15:26:50 +0530693Validate ONUs for PON OLT Disable
694 [Arguments] ${olt_peer_list}
695 [Documentation] This keyword validates that Ping fails for ONUs connected to Disabled OLT PON port
696 ... And Pings succeed for other Active OLT PON port ONUs
697 ... Also it removes subscriber for Disabled OLT PON port ONUs to replicate ATT workflow
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800698 FOR ${I} IN RANGE 0 ${num_all_nus}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530699 ${src}= Set Variable ${hosts.src[${I}]}
700 ${dst}= Set Variable ${hosts.dst[${I}]}
701 ${onu_device_id}= Get Device ID From SN ${src['onu']}
702 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
703 ... ${of_id}
704 ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id}
705 Run Keyword If ${matched}
706 ... Run Keywords
707 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
708 ... Validate Device ENABLED DISCOVERED
709 ... UNREACHABLE ${src['onu']} onu=True onu_reason=stopping-openomci
710 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
711 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
712 ... AND Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
713 ... Wait Until Keyword Succeeds 60s 2s
714 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
715 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
716 ... ${src['container_name']}
717 # Remove Subscriber Access (To replicate ATT workflow)
718 ... AND Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
719 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
720 ... ELSE
721 ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
722 ... Wait Until Keyword Succeeds 60s 2s
723 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
724 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
725 ... ${src['container_name']}
726 Run Keyword and Ignore Error Collect Logs
727 END
728
729Validate ONUs for PON OLT Enable
730 [Arguments] ${olt_peer_list}
731 [Documentation] This keyword validates Ping succeeds for all Enabled/Acitve OLT PON ports
732 ... Also performs Auth/subscriberAdd/DHCP/Ping for the ONUs on Re-Enabled OLT PON port
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800733 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530734 ${src}= Set Variable ${hosts.src[${I}]}
735 ${dst}= Set Variable ${hosts.dst[${I}]}
736 ${onu_device_id}= Get Device ID From SN ${src['onu']}
737 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
738 ... ${of_id}
739 ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id}
740 ${wpa_log}= Run Keyword If ${has_dataplane} and ${matched} Catenate SEPARATOR=.
741 ... /tmp/wpa ${src['dp_iface_name']} log
742 Run Keyword If ${matched}
743 ... Run Keywords
744 # Perform Cleanup
745 ... Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
746 # Verify ONU port status
747 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
748 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
749 # Verify EAPOL flows are added for the ONU port
750 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
751 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
752 # Verify ONU state in voltha
753 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
754 ... Validate Device ENABLED ACTIVE REACHABLE
755 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
756 # Perform Authentication
757 ... AND Run Keyword If ${has_dataplane}
758 ... Run Keyword And Continue On Failure Validate Authentication True
759 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
760 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
761 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
762 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
763 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
764 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
765 ... volt-add-subscriber-access ${of_id} ${onu_port}
766 # Verify that no pending flows exist for the ONU port
767 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
768 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
769 # Verify subscriber access flows are added for the ONU port
770 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
771 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
772 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
773 ... AND Run Keyword If ${has_dataplane}
774 ... Run Keyword And Continue On Failure Validate DHCP and Ping True
775 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
776 ... ${src['ip']} ${src['user']} ${src['pass']}
777 ... ${src['container_type']} ${src['container_name']}
778 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']}
779 ... ${dst['container_type']} ${dst['container_name']}
780 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
781 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
782 ... AND Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
783 ... ELSE
784 ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
785 ... Wait Until Keyword Succeeds 60s 2s
786 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
787 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
788 ... ${src['container_name']}
789 Run Keyword and Ignore Error Collect Logs
790 END
791
792Validate ONUs for PON OLT Disable DT
793 [Arguments] ${olt_peer_list}
794 [Documentation] This keyword validates that Ping fails for ONUs connected to Disabled OLT PON port
795 ... And Pings succeed for other Active OLT PON port ONUs
796 ... Also it removes subscriber and deletes ONUs for Disabled OLT PON port to replicate DT workflow
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800797 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530798 ${src}= Set Variable ${hosts.src[${I}]}
799 ${dst}= Set Variable ${hosts.dst[${I}]}
800 ${onu_device_id}= Get Device ID From SN ${src['onu']}
801 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
802 ... ${of_id}
803 ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id}
804 Run Keyword If ${matched}
805 ... Run Keywords
806 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
807 ... Validate Device ENABLED DISCOVERED
808 ... UNREACHABLE ${src['onu']} onu=True onu_reason=stopping-openomci
809 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
810 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
811 ... AND Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
812 ... Wait Until Keyword Succeeds 60s 2s
813 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
814 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
815 ... ${src['container_name']}
816 # Remove Subscriber Access (To replicate DT workflow)
817 ... AND Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
818 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
819 ... AND Sleep 10s
820 # Delete ONU Device (To replicate DT workflow)
821 ... AND Delete Device ${onu_device_id}
822 ... AND Sleep 5s
823 ... ELSE
824 ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
825 ... Wait Until Keyword Succeeds 60s 2s
826 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
827 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
828 ... ${src['container_name']}
829 Run Keyword and Ignore Error Collect Logs
830 END
831
832Validate ONUs for PON OLT Enable DT
833 [Arguments] ${olt_peer_list}
834 [Documentation] This keyword validates Ping succeeds for all Enabled/Acitve OLT PON ports
835 ... Also performs subscriberAdd/DHCP/Ping for the ONUs on Re-Enabled OLT PON port
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800836 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530837 ${src}= Set Variable ${hosts.src[${I}]}
838 ${dst}= Set Variable ${hosts.dst[${I}]}
839 ${onu_device_id}= Get Device ID From SN ${src['onu']}
840 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
841 ... ${of_id}
842 ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id}
843 Run Keyword If ${matched}
844 ... Run Keywords
845 # Perform Cleanup
846 ... Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
847 # Verify ONU port status
848 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
849 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
850 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
851 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
852 ... volt-add-subscriber-access ${of_id} ${onu_port}
853 # Verify ONU state in voltha
854 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
855 ... Validate Device ENABLED ACTIVE REACHABLE
856 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
857 # Verify subscriber access flows are added for the ONU port
858 ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
859 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
860 ... ${onu_port} ${nni_port} ${src['s_tag']}
861 ... AND Run Keyword If ${has_dataplane}
862 ... Run Keyword And Continue On Failure Validate DHCP and Ping True
863 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
864 ... ${src['ip']} ${src['user']} ${src['pass']}
865 ... ${src['container_type']} ${src['container_name']}
866 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']}
867 ... ${dst['container_type']} ${dst['container_name']}
868 ... ELSE
869 ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
870 ... Wait Until Keyword Succeeds 60s 2s
871 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
872 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']}
873 ... ${src['container_name']}
874 Run Keyword and Ignore Error Collect Logs
875 END
876
877Match ONU in PON OLT Peer List
878 [Arguments] ${olt_peer_list} ${onu_device_id}
879 [Documentation] This keyword matches if ONU device is present in OLT PON port peer list
880 ${matched}= Set Variable False
881 FOR ${olt_peer} IN @{olt_peer_list}
882 ${matched}= Set Variable If '${onu_device_id}' == '${olt_peer}' True False
883 Exit For Loop If ${matched}
884 END
885 [Return] ${matched}
886
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000887Collect Logs
888 [Documentation] Collect Logs from voltha and onos cli for various commands
889 Run Keyword and Ignore Error Get Device List from Voltha
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800890 FOR ${I} IN RANGE 0 ${num_olts}
891 Run Keyword and Ignore Error Get Logical Device Output from Voltha ${logical_id}
892 Run Keyword and Ignore Error Get Device Output from Voltha ${olt_ids}[${I}][device_id]
893 Run Keyword and Ignore Error Get Logical Device Output from Voltha ${olt_ids}[${I}][logical_id]
894 END
895 #Run Keyword and Ignore Error Get Device Output from Voltha ${olt_device_id}
896 #Run Keyword and Ignore Error Get Logical Device Output from Voltha ${logical_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800897 Get ONOS Status ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000898
899Verify ping is succesful except for given device
900 [Arguments] ${num_onus} ${exceptional_onu_id}
901 [Documentation] Checks that ping for all the devices are successful except the given ONU.
902 ${pingStatus} Set Variable True
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800903 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000904 ${src}= Set Variable ${hosts.src[${I}]}
905 ${dst}= Set Variable ${hosts.dst[${I}]}
906 ${onu_device_id}= Get Device ID From SN ${src['onu']}
907 ${pingStatus} Run Keyword If '${onu_device_id}' == '${exceptional_onu_id}' Set Variable False
908 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
909 ... Check Ping ${pingStatus} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
910 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
911 END
Andy Bavier4a8450e2020-02-04 08:58:37 -0700912
Andy Bavier1923ecc2020-06-18 14:06:40 -0700913Echo Message to OLT Logs
914 [Arguments] ${message}
915 [Documentation] Echoes ${message} into the OLT logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800916 FOR ${I} IN RANGE 0 ${num_olts}
917 ${olt_user} Evaluate ${olts}[${I}].get("user")
918 ${olt_pass} Evaluate ${olts}[${I}].get("pass")
919 ${olt_ssh_ip} Evaluate ${olts}[${I}].get("sship")
920 Wait Until Keyword Succeeds 180s 10s Execute Remote Command
921 ... printf '%s\n' '' '' '${message}' '' >> /var/log/openolt.log
922 ... ${olt_ssh_ip} ${olt_user} ${olt_pass}
923 Wait Until Keyword Succeeds 180s 10s Execute Remote Command
924 ... printf '%s\n' '' '' '${message}' '' >> /var/log/dev_mgmt_daemon.log
925 ... ${olt_ssh_ip} ${olt_user} ${olt_pass}
926 Wait Until Keyword Succeeds 180s 10s Execute Remote Command
927 ... printf '%s\n' '' '' '${message}' '' >> /var/log/openolt_process_watchdog.log
928 ... ${olt_ssh_ip} ${olt_user} ${olt_pass}
929 END
Andy Bavier1923ecc2020-06-18 14:06:40 -0700930
Andy Bavierabeba262020-02-07 16:22:16 -0700931Start Logging
932 [Arguments] ${label}
933 [Documentation] Start logging for test ${label}
934 ${kail_process}= Run Keyword If "${container_log_dir}" != "${None}" Start Process kail -n default
935 ... -n voltha cwd=${container_log_dir} stdout=${label}-combined.log
936 Set Test Variable ${kail_process}
Andy Bavier1923ecc2020-06-18 14:06:40 -0700937 Run Keyword If ${has_dataplane} Echo Message to OLT Logs START ${label}
Andy Bavierabeba262020-02-07 16:22:16 -0700938
939Stop Logging
940 [Arguments] ${label}
941 [Documentation] End logging for test; remove logfile if test passed
942 Run sync
943 Run Keyword If ${kail_process} Terminate Process ${kail_process}
944 ${test_logfile}= Run Keyword If "${container_log_dir}" != "${None}"
945 ... Join Path ${container_log_dir} ${label}-combined.log
946 Run Keyword If Test Passed Run Keyword If "${test_logfile}" != "${None}" Remove File ${test_logfile}
Andy Bavier1923ecc2020-06-18 14:06:40 -0700947 Run Keyword If ${has_dataplane} Echo Message to OLT Logs END ${label}
Andy Bavierabeba262020-02-07 16:22:16 -0700948
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800949Clean Up Linux
950 [Documentation] Kill processes and clean up interfaces on src+dst servers
Hardik Windlass16cdf962020-04-29 15:26:50 +0530951 [Arguments] ${onu_id}=${EMPTY}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800952 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800953 ${src}= Set Variable ${hosts.src[${I}]}
954 ${dst}= Set Variable ${hosts.dst[${I}]}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530955 ${onu_device_id}= Get Device ID From SN ${src['onu']}
956 Continue For Loop If '${onu_id}' != '${EMPTY}' and '${onu_id}' != '${onu_device_id}'
Andy Bavier84b83282020-06-30 05:47:49 -0700957 Execute Remote Command sudo pkill wpa_supplicant ${src['ip']}
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800958 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Andy Bavier84b83282020-06-30 05:47:49 -0700959 Execute Remote Command sudo pkill dhclient ${src['ip']}
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800960 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Andy Baviereff938d2020-06-29 18:27:49 -0700961 Execute Remote Command sudo pkill mausezahn ${src['ip']}
962 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
963 Run Keyword If '${dst['ip']}' != '${None}' Execute Remote Command pkill dhcpd
964 ... ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800965 Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
966 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
967 Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host
968 ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']}
969 ... ${dst['container_type']} ${dst['container_name']}
Andy Bavier84b83282020-06-30 05:47:49 -0700970 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
971 ${bng_user}= Get Variable Value ${dst['noroot_user']}
972 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700973 Run Keyword If "${bng_ip}" != "${NONE}" and "${bng_user}" != "${NONE}" and "${bng_pass}" != "${NONE}"
974 ... Execute Remote Command sudo pkill mausezahn ${bng_ip} ${bng_user} ${bng_pass}
Andy Baviereff938d2020-06-29 18:27:49 -0700975 ... ${dst['container_type']} ${dst['container_name']}
Suchitra Vemuria5fa3dd2020-02-04 14:38:49 -0800976 END
Scott Baker60e570d2020-02-02 22:10:13 -0800977
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800978Clean Up Linux Per OLT
979 [Documentation] Kill processes and clean up interfaces on src+dst servers
980 [Arguments] ${olt_serial_number}
981 FOR ${I} IN RANGE 0 ${num_all_onus}
982 ${src}= Set Variable ${hosts.src[${I}]}
983 ${dst}= Set Variable ${hosts.dst[${I}]}
984 ${onu_device_id}= Get Device ID From SN ${src['onu']}
985 ${sn}= Get Device ID From SN ${src['olt']}
986 #Continue For Loop If '${onu_id}' != '${EMPTY}' and '${onu_id}' != '${onu_device_id}'
987 Continue For Loop If '${olt_serial_number}' == '${sn}'
988 Execute Remote Command sudo pkill wpa_supplicant ${src['ip']}
989 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
990 Execute Remote Command sudo pkill dhclient ${src['ip']}
991 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
992 Execute Remote Command sudo pkill mausezahn ${src['ip']}
993 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
994 Run Keyword If '${dst['ip']}' != '${None}' Execute Remote Command pkill dhcpd
995 ... ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
996 Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
997 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
998 Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host
999 ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']}
1000 ... ${dst['container_type']} ${dst['container_name']}
1001 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
1002 ${bng_user}= Get Variable Value ${dst['noroot_user']}
1003 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
1004 Run Keyword If "${bng_ip}" != "${NONE}" and "${bng_user}" != "${NONE}" and "${bng_pass}" != "${NONE}"
1005 ... Execute Remote Command sudo pkill mausezahn ${bng_ip} ${bng_user} ${bng_pass}
1006 ... ${dst['container_type']} ${dst['container_name']}
1007 END
1008
Suchitra Vemuri8d3b0032020-09-11 17:49:08 -07001009Clean dhclient
1010 [Documentation] Kills dhclient processes only for all RGs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -08001011 FOR ${I} IN RANGE 0 ${num_all_nus}
Suchitra Vemuri8d3b0032020-09-11 17:49:08 -07001012 ${src}= Set Variable ${hosts.src[${I}]}
1013 ${dst}= Set Variable ${hosts.dst[${I}]}
1014 Execute Remote Command sudo pkill dhclient ${src['ip']}
1015 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
1016 END
1017
Suchitra Vemurif7a033c2020-02-26 17:22:41 -08001018Clean WPA Process
1019 [Documentation] Kills wpa_supplicant processes only for all RGs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -08001020 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -08001021 ${src}= Set Variable ${hosts.src[${I}]}
1022 ${dst}= Set Variable ${hosts.dst[${I}]}
1023 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
1024 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
1025 END
1026
Scott Baker60e570d2020-02-02 22:10:13 -08001027Should Be Larger Than
1028 [Documentation] Verify that value_1 is > value_2
1029 [Arguments] ${value_1} ${value_2}
1030 Run Keyword If ${value_1} <= ${value_2}
1031 ... Fail The value ${value_1} is not larger than ${value_2}
1032
Scott Bakeree675552020-02-11 10:43:34 -08001033Should Be Larger Than Or Equal To
1034 [Documentation] Verify that value_1 is >= value_2
1035 [Arguments] ${value_1} ${value_2}
1036 Run Keyword If ${value_1} < ${value_2}
1037 ... Fail The value ${value_1} is not larger than or equal to ${value_2}
1038
Scott Baker60e570d2020-02-02 22:10:13 -08001039Should Be Float
1040 [Documentation] Verify that value is a floating point number type
1041 [Arguments] ${value}
1042 ${type} Evaluate type(${value}).__name__
1043 Should Be Equal ${type} float
1044
Scott Bakeree675552020-02-11 10:43:34 -08001045Should Be Newer Than Or Equal To
1046 [Documentation] Compare two RFC3339 dates
1047 [Arguments] ${value_1} ${value_2}
1048 ${unix_v1} Parse RFC3339 ${value_1}
1049 ${unix_v2} Parse RFC3339 ${value_2}
1050 Run Keyword If ${unix_v1} < ${unix_v2}
1051 ... Fail The value ${value_1} is not newer than or equal to ${value_2}
1052
Scott Baker60e570d2020-02-02 22:10:13 -08001053Get Current Time
1054 [Documentation] Return the current time in RFC3339 format
1055 ${output}= Run date -u +"%FT%T%:z"
1056 [return] ${output}
Scott Bakeree675552020-02-11 10:43:34 -08001057
1058Parse RFC3339
1059 [Documentation] Parse an RFC3339 timestamp
1060 [Arguments] ${dateStr}
1061 ${rc} ${output}= Run and Return Rc and Output date --date="${dateStr}" "+%s"
1062 Should Be Equal As Numbers ${rc} 0
1063 [return] ${output}
Matteo Scandolo142e6272020-04-29 17:36:59 -07001064
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001065Get Bandwidth Profile Name For Given Subscriber
1066 [Arguments] ${subscriber_id} ${stream_type}=upstreamBandwidthProfile
1067 [Documentation] Keyword to get the bandwidth details of the given subscriber
1068 ${bandwidth_profile_output}= Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
1069 ... volt-programmed-subscribers | grep ${subscriber_id}
1070 @{bandwidth_profile_array}= Split String ${bandwidth_profile_output} ,
1071 Log ${bandwidth_profile_array}
1072 FOR ${value} IN @{bandwidth_profile_array}
1073 @{row_value}= Split String ${value} =
1074 ${bandwidth_profile_name}= Set Variable If '${row_value[0]}' == ' ${stream_type}'
1075 ... ${row_value[1]}
1076 ${bandwidth_profile_name}= Convert To String ${bandwidth_profile_name}
1077 Run Keyword If "${bandwidth_profile_name}" != "None" Exit For Loop
1078 END
1079 Log ${bandwidth_profile_name}
1080 [Return] ${bandwidth_profile_name}
1081
1082Execute Remote Command
1083 [Documentation] SSH into a remote host and execute a command on the bare host or in a container.
1084 ... This replaces and simplifies the Login And Run Command On Remote System keyword in CORDRobot.
1085 [Arguments] ${cmd} ${ip} ${user} ${pass}=${None}
Andy Baviereff938d2020-06-29 18:27:49 -07001086 ... ${container_type}=${None} ${container_name}=${None} ${timeout}=${None}
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001087 ${conn_id}= SSHLibrary.Open Connection ${ip}
1088 Run Keyword If '${pass}' != '${None}'
1089 ... SSHLibrary.Login ${user} ${pass}
1090 ... ELSE
1091 ... SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/id_rsa
1092 ${namespace}= Run Keyword If '${container_type}' == 'K8S' SSHLibrary.Execute Command
1093 ... kubectl get pods --all-namespaces | grep ${container_name} | awk '{print $1}'
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001094 ${stdout} ${stderr} ${rc}= Run Keyword If '${container_type}' == 'LXC'
1095 ... SSHLibrary.Execute Command lxc exec ${container_name} -- ${cmd}
Andy Baviereff938d2020-06-29 18:27:49 -07001096 ... return_stderr=True return_rc=True timeout=${timeout}
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001097 ... ELSE IF '${container_type}' == 'K8S'
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001098 ... SSHLibrary.Execute Command kubectl -n ${namespace} exec ${container_name} -- ${cmd}
Andy Baviereff938d2020-06-29 18:27:49 -07001099 ... return_stderr=True return_rc=True timeout=${timeout}
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001100 ... ELSE
Andy Baviereff938d2020-06-29 18:27:49 -07001101 ... SSHLibrary.Execute Command ${cmd} return_stderr=True return_rc=True timeout=${timeout}
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001102
1103 Log ${stdout}
1104 Log ${stderr}
1105 Log ${rc}
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001106 SSHLibrary.Close Connection
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001107 [Return] ${stdout} ${stderr} ${rc}
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001108
Suraj Gour33651272020-05-04 10:10:16 +05301109Start Remote Command
1110 [Documentation] SSH into a remote host and execute a command on the bare host or in a container.
1111 ... This replaces and simplifies the Login And Run Command On Remote System keyword in CORDRobot.
1112 [Arguments] ${cmd} ${ip} ${user} ${pass}=${None}
1113 ... ${container_type}=${None} ${container_name}=${None}
1114 ${conn_id}= SSHLibrary.Open Connection ${ip}
1115 Run Keyword If '${pass}' != '${None}'
1116 ... SSHLibrary.Login ${user} ${pass}
1117 ... ELSE
1118 ... SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/id_rsa
1119 ${namespace}= Run Keyword If '${container_type}' == 'K8S' SSHLibrary.Execute Command
1120 ... kubectl get pods --all-namespaces | grep ${container_name} | awk '{print $1}'
1121 Run Keyword If '${container_type}' == 'LXC'
1122 ... SSHLibrary.Start Command lxc exec ${container_name} -- ${cmd}
1123 ... ELSE IF '${container_type}' == 'K8S'
1124 ... SSHLibrary.Start Command kubectl -n ${namespace} exec ${container_name} -- ${cmd}
1125 ... ELSE
1126 ... SSHLibrary.Start Command ${cmd}
Andy Bavier9fb23232020-06-30 15:12:20 -07001127 # It seems that closing the connection immediately will sometimes kill the command
1128 Sleep 1s
Suraj Gour33651272020-05-04 10:10:16 +05301129 SSHLibrary.Close Connection
1130
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001131Run Iperf3 Test Client
1132 [Arguments] ${src} ${server} ${args}
1133 [Documentation] Login to ${src} and run the iperf3 client against ${server} using ${args}.
1134 ... Return a Dictionary containing the results of the test.
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001135 ${output} ${stderr} ${rc}= Execute Remote Command iperf3 -J -c ${server} ${args} | jq -M -c '.'
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001136 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -07001137 Should Be Equal As Integers ${rc} 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +00001138 ${object}= Evaluate json.loads(r'''${output}''') json
1139 [Return] ${object}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001140
Suchitra Vemuri85cb7d62020-07-16 23:46:16 -07001141Run Iperf Test Client for MCAST
1142 [Arguments] ${src} ${server} ${args}
1143 [Documentation] Login to ${src} and run the iperf client against ${server} using ${args}.
1144 ... Return a Dictionary containing the results of the test.
1145 ${output} ${stderr} ${rc}= Execute Remote Command sudo iperf -c ${server} ${args} | jq -M -c '.'
1146 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
1147 Should Be Equal As Integers ${rc} 0
1148 ${object}= Evaluate json.loads(r'''${output}''') json
1149 [Return] ${object}
1150
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001151RestoreONUs
1152 [Documentation] Restore all connected ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -08001153 [Arguments] ${num_all_onus}
1154 FOR ${I} IN RANGE 0 ${num_all_onus}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001155 ${src}= Set Variable ${hosts.src[${I}]}
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001156 ${container_type}= Get Variable Value ${src['container_type']} "null"
1157 ${container_name}= Get Variable Value ${src['container_name']} "null"
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001158 ${onu_type}= Get Variable Value ${src['onu_type']} "null"
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001159 #Get ens6f0 from ens6f0.22
1160 ${if_name}= Replace String Using Regexp ${src['dp_iface_name']} \\..* \
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001161 Run Keyword IF '${onu_type}' == 'alpha' AlphaONURestoreDefault ${src['ip']} ${src['user']}
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001162 ... ${src['pass']} ${if_name} admin admin ${container_type} ${container_name}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001163 END
1164
1165AlphaONURestoreDefault
1166 [Documentation] Restore the Alpha ONU to factory setting
1167 [Arguments] ${rg_ip} ${rg_user} ${rg_pass} ${onu_ifname}
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001168 ... ${onu_user} ${onu_pass} ${container_type}=${None} ${container_name}=${None}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001169 ${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 -07001170 ... ${rg_ip} ${rg_user} ${rg_pass} ${container_type} ${container_name}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001171 ${cmd} Catenate
1172 ... (echo open "192.168.1.1"; sleep 1;
1173 ... echo "${onu_user}"; sleep 1;
1174 ... echo "${onu_pass}"; sleep 1;
1175 ... echo "restoredefault"; sleep 1) | telnet
1176 ${output}= Login And Run Command On Remote System ${cmd}
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001177 ... ${rg_ip} ${rg_user} ${rg_pass} ${container_type} ${container_name}
Hung-Wei Chiue0bec7c2020-05-29 22:16:56 +00001178 Log To Console ${output}
1179 ${output}= Login And Run Command On Remote System sudo ifconfig ${onu_ifname} 0
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -07001180 ... ${rg_ip} ${rg_user} ${rg_pass} ${container_type} ${container_name}
Suraj Gour33651272020-05-04 10:10:16 +05301181
1182Create traffic with each pbit and capture at other end
1183 [Documentation] Generates upstream traffic using Mausezahn tool
1184 ... with each pbit and validates reception at other end using tcpdump
1185 [Arguments] ${target_ip} ${target_iface} ${src_iface}
1186 ... ${packet_count} ${packet_type} ${target_port} ${vlan} ${tcpdump_filter}
1187 ... ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
1188 ... ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
1189 FOR ${pbit} IN RANGE 8
Andy Baviereff938d2020-06-29 18:27:49 -07001190 Execute Remote Command sudo pkill mausezahn
Suraj Gour33651272020-05-04 10:10:16 +05301191 ... ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
Andy Baviereff938d2020-06-29 18:27:49 -07001192 ${var1}= Set Variable sudo mausezahn ${src_iface} -B ${target_ip} -c ${packet_count} -d 100m
Suraj Gour33651272020-05-04 10:10:16 +05301193 ${var2}= Set Variable -t ${packet_type} "dp=${target_port}" -p 1472 -Q ${pbit}:${vlan}
1194 ${cmd}= Set Variable ${var1} ${var2}
1195 Start Remote Command ${cmd} ${src_ip} ${src_user} ${src_pass}
1196 ... ${src_container_type} ${src_container_name}
1197 ${output} ${stderr} ${rc}= Execute Remote Command
Andy Baviereff938d2020-06-29 18:27:49 -07001198 ... sudo tcpdump -l -U -c 30 -i ${target_iface} -e ${tcpdump_filter}
Suraj Gour33651272020-05-04 10:10:16 +05301199 ... ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
Andy Baviereff938d2020-06-29 18:27:49 -07001200 ... timeout=30 seconds
1201 Execute Remote Command sudo pkill mausezahn
Suraj Gour33651272020-05-04 10:10:16 +05301202 ... ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
1203 # VOL-3262: I'm seeing untagged downstream traffic at RG for pbit 0. According to Girish this is
1204 # incorrect behavior. Simplify the following check when VOL-3262 is resolved.
1205 Run Keyword If ${pbit}==0 and "${tcpdump_filter}"=="udp"
1206 ... Should Match Regexp ${output} \\.${target_port}: UDP,
1207 ... ELSE Should Match Regexp ${output} , p ${pbit},.*\\.${target_port}: UDP,
1208 END