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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 Library cluster.cluster.Cluster WITH NAME Cluster
18 Library crl.remotesession.remotesession.RemoteSession
19 ... WITH NAME RemoteSession
21 Test Setup ssh.Setup Connections
25 ${search}= set variable log_installation_success Installation complete, Installation Succeeded
26 ${command}= set variable tail -n 1 /srv/deployment/log/bootstrap.log
27 ${out}= ssh.Execute Command ${command} controller-1
29 Should contain ${out} ${search}
32 ${search}= set variable Docker version 18.09.2
33 ${command}= set variable docker --version
34 ${out}= ssh.Execute Command ${command} controller-1
36 Should contain ${out} ${search}
38 Testing Kubernetes Cluster
39 ${command}= set variable kubectl get po --no-headers --namespace=kube-system --field-selector status.phase!=Running 2> /dev/null
40 ${out}= ssh.Execute Command ${command} controller-1
42 Should be empty ${out}
44 Testing State Services
45 Test Service State docker.service
46 Test Service State kubelet.service
49 [Arguments] ${service}
50 ${running}= set variable running
51 ${active}= set variable active
52 ${command1}= set variable systemctl show -p SubState ${service} | sed 's/SubState=//g'
53 ${command2}= set variable systemctl show -p ActiveState ${service} | sed 's/ActiveState=//g'
54 ${out1}= ssh.Execute Command ${command1} controller-1
55 ${out2}= ssh.Execute Command ${command2} controller-1
58 Should contain ${out1} ${running}
59 Should contain ${out2} ${active}
62 ${count1}= get length ${ALL_MASTERS_IN_SYSTEM}
63 ${count2}= get length ${ALL_PURE_WORKERS_IN_SYSTEM}
64 ${total}= evaluate ${count1}+${count2}
65 ${command}= set variable kubectl get no --no-headers | grep Ready | grep -v SchedulingDisabled | wc -l
66 ${out}= ssh.Execute Command ${command} controller-1
68 Should be equal as integers ${out} ${total}
70 Testing Package Manager Status
71 ${docker_image}= set variable docker images -f \'reference=*/caas/hyperkube\' --format=\"{{.Repository}}:{{.Tag}}\"
72 ${out1}= ssh.Execute Command ${docker_image} controller-1
73 ${image_pull}= set variable docker pull ${out1} | grep -i status
74 ${out2}= ssh.Execute Command ${image_pull} controller-1
75 ${uptodate}= set variable Status: Image is up to date for ${out1}
76 ${out3}= ssh.Execute Command ${image_pull} controller-1
78 Should be equal ${out3} ${uptodate}
80 Testing Helm Caas infra Status
82 ${search}= set variable STATUS: DEPLOYED
83 ${command}= set variable helm status caas-infra --kube-context string | grep STATUS:
84 ${out}= ssh.Execute Command ${command} controller-1
86 Should be equal ${out} ${search}
94 Verify Kubernetes Clusters
95 Testing Kubernetes Cluster
96 Verify State of required services
97 Testing State Services
98 Verify Node Functionality
100 Verify Package Manager Status
101 Testing Package Manager Status
102 Verify Helm Caas Infra Status
103 Testing Helm Caas infra Status