blob: ac6a43b69cada2e333468f82c69b8fbb9f1e62c8 [file] [log] [blame]
Kailash Khalasic930eac2018-09-05 12:18:23 -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.
14
15*** Settings ***
Suchitra Vemuri6357e692018-09-07 11:11:47 -070016Documentation Library of functions related to RG (source host)
Kailash Khalasic930eac2018-09-05 12:18:23 -070017Library OperatingSystem
18Library SSHLibrary
Suchitra Vemurief989602018-09-10 13:45:26 -070019Library restApi.py
Kailash Khalasic930eac2018-09-05 12:18:23 -070020
21*** Keywords ***
22Send EAPOL Message
23 [Arguments] ${ip} ${user} ${pass} ${iface} ${conf_file} ${prompt}=$ ${prompt_timeout}=60s
24 [Documentation] SSH's into the RG (src) and executes a particular auth request via wpa_supplicant client. Requested packet should exist on src.
25 ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
Kailash Khalasie030eee2018-09-10 09:19:46 -070026 SSHLibrary.Login ${user} ${pass}
Kailash Khalasi449388f2018-09-06 16:52:22 -070027 SSHLibrary.Write sudo wpa_supplicant -B -i ${iface} -Dwired -c /etc/wpa_supplicant/${conf_file}
Kailash Khalasic930eac2018-09-05 12:18:23 -070028 Read Until [sudo] password for ${user}:
29 SSHLibrary.Write ${pass}
30 ${result}= Read Until ${prompt}
31 SSHLibrary.Close Connection
Kailash Khalasie030eee2018-09-10 09:19:46 -070032 Should Contain ${result} Successfully initialized wpa_supplicant
Suchitra Vemuri6357e692018-09-07 11:11:47 -070033 [Return] ${result}
34
35Subscriber Status Check
36 [Arguments] ${onu_device}
37 [Documentation] Returns Status from Subscribers List for a particular ONU device
38 ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER
39 Log ${json_result}
40 ${json_result_list}= Get From dictionary ${json_result} items
Suchitra Vemurief989602018-09-10 13:45:26 -070041 ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} onu_device ${onu_device}
Suchitra Vemuri32fc2f22018-09-10 12:06:01 -070042 ${status}= Get From Dictionary ${getJsonDict} status
Suchitra Vemuri6357e692018-09-07 11:11:47 -070043 [Return] ${status}