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 ##############################################################################
22 Resource variables.resource
26 Open Connection And Log In
27 Open Connection ${HOST}
28 Login With Public Key ${USERNAME} ${KEYFILE}
32 :FOR ${node} IN @{nodes}
33 \ ${result}= Run Manager Start ${node}
37 :FOR ${node} IN @{nodes}
38 \ ${result}= Run Monitor Start ${node}
42 :FOR ${node} IN @{nodes}
43 \ ${result}= Run Ceph OSD Start ${node}
47 :FOR ${node} IN @{nodes}
48 \ ${stdout}= Execute Command ${SSH_CMD} ${node} "sudo pkill -u ceph ceph-mgr"
52 :FOR ${node} IN @{nodes}
53 \ ${stdout}= Execute Command ${SSH_CMD} ${node} "sudo pkill -u ceph ceph-mon"
57 :FOR ${node} IN @{nodes}
58 \ ${stdout}= Execute Command ${SSH_CMD} ${node} "sudo pkill -u ceph ceph-osd"
60 Ceph Should Be Healthy
61 ${stdout}= Execute Command ceph health --connect-timeout 20 sudo=True
62 Should Contain ${stdout} HEALTH_OK
64 Ceph Health Should Be Degraded
65 ${stdout}= Execute Command ceph health --connect-timeout 20 sudo=True
66 Should Contain ${stdout} HEALTH_WARN
69 ${stdout}= Execute Command ceph -f json osd stat sudo=True
70 ${stat}= Evaluate json.loads($stdout) json
71 [Return] ${stat["num_up_osds"]}
73 Number Of OSDs Up Should Be
74 [Arguments] ${num_expected}
75 ${num_up_osds}= Number Of OSDs Up
76 Should Be Equal ${num_up_osds} ${num_expected}
80 Execute Command ${SSH_CMD} ${node} "sudo systemctl start ceph-mgr@${node}"
81 ${stdout}= Execute Command ${SSH_CMD} ${node} "systemctl is-active ceph-mgr@${node}"
82 Return From Keyword If '${stdout}' == 'active'
83 Execute Command ${SSH_CMD} ${node} "sudo systemctl reset-failed ceph-mgr@${node}"
84 Execute Command ${SSH_CMD} ${node} "sudo systemctl start ceph-mgr@${node}"
85 ${stdout}= Execute Command ${SSH_CMD} ${node} "systemctl is-active ceph-mgr@${node}"
86 Should Be Equal As Strings ${stdout} active
90 Execute Command ${SSH_CMD} ${node} "sudo systemctl start ceph-mon@${node}"
91 ${stdout}= Execute Command ${SSH_CMD} ${node} "systemctl is-active ceph-mon@${node}"
92 Return From Keyword If '${stdout}' == 'active'
93 Execute Command ${SSH_CMD} ${node} "sudo systemctl reset-failed ceph-mon@${node}"
94 Execute Command ${SSH_CMD} ${node} "sudo systemctl start ceph-mon@${node}"
95 ${stdout}= Execute Command ${SSH_CMD} ${node} "systemctl is-active ceph-mon@${node}"
96 Should Be Equal As Strings ${stdout} active
100 Execute Command ${SSH_CMD} ${node} "sudo systemctl -a start ceph-osd@*"
101 ${stdout}= Execute Command ${SSH_CMD} ${node} "systemctl -a is-active ceph-osd@*"
102 Return From Keyword If '${stdout}' == 'active'
103 Execute Command ${SSH_CMD} ${node} "sudo systemctl -a reset-failed ceph-osd@*"
104 Execute Command ${SSH_CMD} ${node} "sudo systemctl -a start ceph-osd@*"
105 ${stdout}= Execute Command ${SSH_CMD} ${node} "systemctl -a is-active ceph-osd@*"
106 Should Be Equal As Strings ${stdout} active