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}
31 Looking up LF Jenkins successful build iso number
32 ${command}= set variable rpm -qa | grep product | awk -F '-' '{sub(/-.*$/, "", $3); print $3}'
33 ${out}= ssh.Execute Command ${command} controller-1
37 ${search}= set variable Docker version 19.03.2
38 ${command}= set variable docker --version
39 ${out}= ssh.Execute Command ${command} controller-1
41 Should contain ${out} ${search}
43 Testing Kubernetes Cluster
44 ${command}= set variable kubectl get po --no-headers --namespace=kube-system --field-selector status.phase!=Running 2> /dev/null
45 ${out}= ssh.Execute Command ${command} controller-1
47 Should be empty ${out}
49 Testing State Services
50 Test Service State docker.service
51 Test Service State kubelet.service
54 [Arguments] ${service}
55 ${running}= set variable running
56 ${active}= set variable active
57 ${command1}= set variable systemctl show -p SubState ${service} | sed 's/SubState=//g'
58 ${command2}= set variable systemctl show -p ActiveState ${service} | sed 's/ActiveState=//g'
59 ${out1}= ssh.Execute Command ${command1} controller-1
60 ${out2}= ssh.Execute Command ${command2} controller-1
63 Should contain ${out1} ${running}
64 Should contain ${out2} ${active}
67 ${count1}= get length ${ALL_MASTERS_IN_SYSTEM}
68 ${count2}= get length ${ALL_PURE_WORKERS_IN_SYSTEM}
69 ${total}= evaluate ${count1}+${count2}
70 ${command}= set variable kubectl get no --no-headers | grep Ready | grep -v SchedulingDisabled | wc -l
71 ${out}= ssh.Execute Command ${command} controller-1
73 Should be equal as integers ${out} ${total}
75 Testing Package Manager Status
76 ${docker_image}= set variable docker images -f \'reference=*/caas/hyperkube\' --format=\"{{.Repository}}:{{.Tag}}\"
77 ${out1}= ssh.Execute Command ${docker_image} controller-1
78 ${image_pull}= set variable docker pull ${out1} | grep -i status
79 ${out2}= ssh.Execute Command ${image_pull} controller-1
80 ${uptodate}= set variable Status: Image is up to date for ${out1}
81 ${out3}= ssh.Execute Command ${image_pull} controller-1
83 Should be equal ${out3} ${uptodate}
85 Testing Helm Caas infra Status
87 ${search}= set variable STATUS: DEPLOYED
88 ${command}= set variable helm status caas-infra --kube-context string | grep STATUS:
89 ${out}= ssh.Execute Command ${command} controller-1
91 Should be equal ${out} ${search}
97 Verify Image Build Number
98 Looking up LF Jenkins successful build iso number
101 Verify Kubernetes Clusters
102 Testing Kubernetes Cluster
103 Verify State of required services
104 Testing State Services
105 Verify Node Functionality
107 Verify Package Manager Status
108 Testing Package Manager Status
109 Verify Helm Caas Infra Status
110 Testing Helm Caas infra Status