blob: c2067aeaa2577149244c3a1e12cf5858339eb7ba [file] [log] [blame]
David Bainbridge117d23e2019-09-30 20:37:51 +00001# 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# voltctl common functions
16
17*** Settings ***
18Documentation Library for various utilities
19Library SSHLibrary
20Library HttpLibrary.HTTP
21Library String
22Library DateTime
23Library Process
24Library Collections
25Library RequestsLibrary
26Library OperatingSystem
27
28*** Keywords ***
29Lookup Service IP
30 [Arguments] ${namespace} ${name}
31 [Documentation] Uses kubeclt to resolve a service name to an IP
32 ${rc} ${ip}= Run and Return Rc and Output kubectl get svc -n ${namespace} ${name} -o jsonpath={.spec.clusterIP}
33 Should Be Equal as Integers ${rc} 0
34 [Return] ${ip}
35
36Lookup Service PORT
37 [Arguments] ${namespace} ${name}
38 [Documentation] Uses kubeclt to resolve a service name to an PORT
39 ${rc} ${port}= Run and Return Rc and Output kubectl get svc -n ${namespace} ${name} -o jsonpath={.spec.ports[0].port}
40 Should Be Equal as Integers ${rc} 0
41 [Return] ${port}