You Wang | 0c2b366 | 2018-10-01 16:56:17 -0700 | [diff] [blame] | 1 | # 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 *** |
| 16 | Documentation Library of functions related to kubectl and helm |
| 17 | Library SSHLibrary |
| 18 | Library Collections |
| 19 | Library String |
| 20 | Library OperatingSystem |
| 21 | Library RequestsLibrary |
| 22 | Library utils/utils.py |
| 23 | Library restApi.py |
| 24 | |
| 25 | *** Keywords *** |
| 26 | Helm Chart is Removed |
You Wang | 88e1d85 | 2018-10-05 11:44:19 -0700 | [diff] [blame] | 27 | [Arguments] ${helm_chart} |
You Wang | 0c2b366 | 2018-10-01 16:56:17 -0700 | [diff] [blame] | 28 | [Documentation] Verify the specified helm chart has been removed |
You Wang | 88e1d85 | 2018-10-05 11:44:19 -0700 | [diff] [blame] | 29 | ${rc}= Run And Return Rc ${export_kubeconfig}; helm ls -q | grep ${helm_chart} |
You Wang | 0c2b366 | 2018-10-01 16:56:17 -0700 | [diff] [blame] | 30 | Should Be Equal As Integers ${rc} 1 |
| 31 | |
| 32 | Kubernetes PODs in Namespace are Removed |
You Wang | 88e1d85 | 2018-10-05 11:44:19 -0700 | [diff] [blame] | 33 | [Arguments] ${namespace} |
You Wang | 0c2b366 | 2018-10-01 16:56:17 -0700 | [diff] [blame] | 34 | [Documentation] Verify all Kubernetes pods in specified namespace have been removed |
You Wang | 88e1d85 | 2018-10-05 11:44:19 -0700 | [diff] [blame] | 35 | ${rc} ${output}= Run And Return Rc And Output ${export_kubeconfig}; kubectl get pods --no-headers -n ${namespace} |
You Wang | 0c2b366 | 2018-10-01 16:56:17 -0700 | [diff] [blame] | 36 | Should Contain ${output} No resources found |
| 37 | |
| 38 | Kubernetes PODs in Namespace are Running |
You Wang | 88e1d85 | 2018-10-05 11:44:19 -0700 | [diff] [blame] | 39 | [Arguments] ${namespace} ${pod_num} |
You Wang | 0c2b366 | 2018-10-01 16:56:17 -0700 | [diff] [blame] | 40 | [Documentation] Verify the number of Kubernetes pods that are running in specified namespace is as expected |
You Wang | 88e1d85 | 2018-10-05 11:44:19 -0700 | [diff] [blame] | 41 | ${rc} ${output}= Run And Return Rc And Output ${export_kubeconfig}; kubectl get pods -n ${namespace} | grep -i running | grep 1/1 | wc -l |
You Wang | 0c2b366 | 2018-10-01 16:56:17 -0700 | [diff] [blame] | 42 | Should Be Equal As Integers ${output} ${pod_num} |