blob: 765a31bcaaf8e182984b74b1c7268bc47e9fcd61 [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
Gilles Depatie675a2062019-10-22 12:44:42 -040032 ${rc} ${ip}= Run and Return Rc and Output
33 ... kubectl get svc -n ${namespace} ${name} -o jsonpath={.spec.clusterIP}
David Bainbridge117d23e2019-09-30 20:37:51 +000034 Should Be Equal as Integers ${rc} 0
35 [Return] ${ip}
36
37Lookup Service PORT
38 [Arguments] ${namespace} ${name}
39 [Documentation] Uses kubeclt to resolve a service name to an PORT
Gilles Depatie675a2062019-10-22 12:44:42 -040040 ${rc} ${port}= Run and Return Rc and Output
41 ... kubectl get svc -n ${namespace} ${name} -o jsonpath={.spec.ports[0].port}
David Bainbridge117d23e2019-09-30 20:37:51 +000042 Should Be Equal as Integers ${rc} 0
43 [Return] ${port}