1 ##############################################################################
2 # Copyright (c) 2019 AT&T Intellectual Property. #
3 # Copyright (c) 2019 Nokia. #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you maynot use this file except in compliance with the License. #
8 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ##############################################################################
29 ${result}= Run Process kubectl get nodes -l node-role.kubernetes.io/master
30 ... -o jsonpath\='{.items[*].metadata.name}'
31 ${output}= Evaluate ${result.stdout}
32 @{nodes}= Split String ${output}
33 Set Test Variable ${pod} etcd-@{nodes}[0]
34 ${members}= Get Etcd Members
35 Set Test Variable ${members}
38 ${result}= Run Process kubectl exec -n kube-system -it ${pod}
39 ... etcdctl${ETCD_VERSION} member list
40 [Return] ${result.stdout}
43 ${result}= Run Process kubectl delete pod -n kube-system ${pod}
44 Should Be Equal As Strings ${result.stdout} pod "${pod}" deleted msg="pod delete failed"
46 Wait For Etcd Node To Recover
47 Wait Until Keyword Succeeds 5m 10s Etcd Node Should Be Running
49 Etcd Node Should Be Running
50 ${result}= Run Process kubectl get -n kube-system -o template pod/${pod}
51 ... --template\='{{.status.phase}}'
52 Should Be Equal As Strings ${result.stdout} 'Running'
54 Etcd Endpoint Should Be Healthy
55 ${result}= Run Process kubectl exec -n kube-system -ti ${pod}
56 ... etcdctl${ETCD_VERSION} endpoint health
57 Should Contain ${result.stdout} is healthy:
59 Etcd Members Should Be Unchanged
60 ${output}= Get Etcd Members
61 Should Be Equal As Strings ${output} ${members}
63 Etcd Cluster Should Be Healthy
64 Etcd Node Should Be Running
65 Etcd Endpoint Should Be Healthy
66 Etcd Members Should Be Unchanged