7 function test_cinder_service(){
8 echo "Starting Cinder $1..."
12 if [ "$1" == "api" ]; then
13 service_running=`netstat -nat | grep $2 | wc -l`
15 service_running=`ps -Af | grep cinder-$2 | wc -l`
18 if [ service_running ]; then
19 echo "Cinder API successfully started"
22 echo "Can not start Cinder $1 service"
28 function check_file_exists(){
29 if [ ! -f "$1" ]; then
35 function test_cinder_configs(){
36 declare -a files=("/etc/cinder/cinder.conf" "/etc/cinder/api-paste.ini" "/etc/cinder/policy.json")
37 for f in "${files[@]}"
39 check_file_exists "$f"
46 declare -a imports=("cinder" "cinder.volume.drivers.lvm" "cinder.volume.drivers.rbd")
47 for i in "${imports[@]}"
59 count=`ls -1 /usr/bin/cinder* 2>/dev/null | wc -l`
60 if [ $count -eq 0 ]; then
64 test_cinder_service openstack-cinder-api 8776
65 test_cinder_service openstack-cinder-volume
66 test_cinder_service openstack-cinder-scheduler
70 check_file_exists "/usr/bin/cinder-manage"
73 check_file_exists "/usr/bin/cinder-scheduler"
74 test_cinder_service cinder-scheduler
77 check_file_exists "/usr/bin/cinder-api"
78 test_cinder_service cinder-api 8776
81 check_file_exists "/usr/bin/cinder-api"
82 test_cinder_service cinder-volume
85 echo "No test for docs defined"
88 echo "Test is not defined, skipping..."