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 ##############################################################################
20 Documentation HA services tests: docker and kubelet
22 Library OperatingSystem
24 Suite Setup Open Connection And Log In
25 Suite Teardown Close All Connections
29 ${USERNAME} localadmin
30 ${LOG} ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
36 Verify status of container runtime
37 [Documentation] container runtime active
38 Start Command systemctl is-active docker.service
39 ${stdout}= Read Command Output
40 Append To File ${LOG} ${stdout}${\n}
41 Should Be Equal ${stdout} active
44 Fail container runtime
45 [Documentation] container runtime stopped
46 ${output} ${rc}= Execute Command systemctl stop docker.service return_rc=True sudo=True
47 Append To File ${LOG} ${output}${\n}
48 Should Be Equal As Integers ${rc} 0
50 Start Command systemctl is-active docker.service
51 ${stdout}= Read Command Output
52 Append To File ${LOG} ${stdout}${\n}
53 Should Be Equal ${stdout} inactive
56 Start container runtime
57 [Documentation] container runtime active
59 ${output} ${rc}= Execute Command systemctl start docker.service return_rc=True sudo=True
60 Append To File ${LOG} ${output}${\n}
61 Should Be Equal As Integers ${rc} 0
63 Start Command systemctl is-active docker.service
64 ${stdout}= Read Command Output
65 Append To File ${LOG} ${stdout}${\n}
66 Should Be Equal ${stdout} active
71 [Documentation] kubelet service active
72 Start Command systemctl is-active kubelet.service
73 ${stdout}= Read Command Output
74 Append To File ${LOG} ${stdout}${\n}
75 Should Be Equal ${stdout} active
79 [Documentation] kubelet service stopped
80 ${output} ${rc}= Execute Command systemctl stop kubelet.service return_rc=True sudo=True
81 Append To File ${LOG} ${output}${\n}
82 Should Be Equal As Integers ${rc} 0
84 Start Command systemctl is-active kubelet.service
85 ${stdout}= Read Command Output
86 Append To File ${LOG} ${stdout}${\n}
87 Should Be Equal ${stdout} inactive
91 [Documentation] kubelet active
93 ${output} ${rc}= Execute Command systemctl start kubelet.service return_rc=True sudo=True
94 Append To File ${LOG} ${output}${\n}
95 Should Be Equal As Integers ${rc} 0
97 Start Command systemctl is-active kubelet.service
98 ${stdout}= Read Command Output
99 Append To File ${LOG} ${stdout}${\n}
100 Should Be Equal ${stdout} active
105 Open Connection And Log In
106 Open Connection ${HOST}
107 Login With Public Key ${USERNAME} /root/.ssh/${USERNAME}_id_rsa