Signed-off-by: Indumathi Buddi <ib405q@att.com>
Change-Id: I9219a85f48cb722d609793e8f43dc953328d4ae6
Library BuiltIn
Library Process
Library String
Library BuiltIn
Library Process
Library String
+Library SSHLibrary
+Library OperatingSystem
*** Variables ***
${ETCD_VERSION} 3
*** Variables ***
${ETCD_VERSION} 3
+${SSH_KEYFILE} ${HOME}/.ssh/id_rsa
+Open Connection And Log In
+ Open Connection ${HOST}
+ Login With Public Key ${USERNAME} ${SSH_KEYFILE}
+
- ${result}= Run Process kubectl get nodes -l node-role.kubernetes.io/master
- ... -o jsonpath\='{.items[*].metadata.name}'
- ${output}= Evaluate ${result.stdout}
- @{nodes}= Split String ${output}
- Set Test Variable ${pod} etcd-@{nodes}[0]
- ${members}= Get Etcd Members
- Set Test Variable ${members}
+ ${result}= Execute Command kubectl get nodes -l node-role.kubernetes.io/master -o jsonpath\='{.items[*].metadata.name}'
+ @{nodes}= Split String ${result}
+ Set Test Variable ${pod} etcd-@{nodes}[0]
+ ${members}= Get Etcd Members
+ Set Test Variable ${members}
- ${result}= Run Process kubectl exec -n kube-system -it ${pod}
- ... etcdctl${ETCD_VERSION} member list
- [Return] ${result.stdout}
+ ${result}= Execute Command kubectl exec -n kube-system -it ${pod} etcdctl${ETCD_VERSION} member list
+ log ${result}
- ${result}= Run Process kubectl delete pod -n kube-system ${pod}
- Should Be Equal As Strings ${result.stdout} pod "${pod}" deleted msg="pod delete failed"
+ ${result}= Execute Command kubectl delete pod -n kube-system ${pod}
+ Should Be Equal As Strings ${result} pod "${pod}" deleted msg="pod delete failed"
Wait For Etcd Node To Recover
Wait Until Keyword Succeeds 5m 10s Etcd Node Should Be Running
Etcd Node Should Be Running
Wait For Etcd Node To Recover
Wait Until Keyword Succeeds 5m 10s Etcd Node Should Be Running
Etcd Node Should Be Running
- ${result}= Run Process kubectl get -n kube-system -o template pod/${pod}
- ... --template\='{{.status.phase}}'
- Should Be Equal As Strings ${result.stdout} 'Running'
+ ${result}= Execute Command kubectl get -n kube-system -o template pod/${pod} --template\='{{.status.phase}}'
+ Should Contain ${result} Running
Etcd Endpoint Should Be Healthy
Etcd Endpoint Should Be Healthy
- ${result}= Run Process kubectl exec -n kube-system -ti ${pod}
- ... etcdctl${ETCD_VERSION} endpoint health
- Should Contain ${result.stdout} is healthy:
+ ${result}= Execute Command kubectl exec -n kube-system -ti ${pod} etcdctl${ETCD_VERSION} endpoint health
+ Should Contain ${result} healthy
Etcd Members Should Be Unchanged
${output}= Get Etcd Members
Etcd Members Should Be Unchanged
${output}= Get Etcd Members
... If the etcd node command line supports etcdctl3 then pass ${ETCD_VERSION} as "3"
... If the etcd node command line supports etcdctl then pass ${ETCD_VERSION} as "${EMPTY}"
Resource etcd_ha.resource
... If the etcd node command line supports etcdctl3 then pass ${ETCD_VERSION} as "3"
... If the etcd node command line supports etcdctl then pass ${ETCD_VERSION} as "${EMPTY}"
Resource etcd_ha.resource
+Suite Setup Open Connection And Log In
+Suite Teardown Close All Connections