diff options
author | JingLu5 <lvjing5@huawei.com> | 2017-05-06 01:10:27 +0000 |
---|---|---|
committer | JingLu5 <lvjing5@huawei.com> | 2017-05-06 03:40:34 +0000 |
commit | 67da8f2ddb5cbf14bbf0df48b10240ba6ebadbe9 (patch) | |
tree | 3e70dbb2419248518c2ad4f1146c2bdb7f9a7fa2 /yardstick/benchmark/scenarios/availability/ha_tools | |
parent | 9b19d7542e494c9c39da7aead2ef630a866b8455 (diff) |
Bugfix: Support HA test cases in TripleO
Change-Id: Ib1f6f45677e66ca88fb546ea0662f52588e9d336
Signed-off-by: JingLu5 <lvjing5@huawei.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/availability/ha_tools')
-rwxr-xr-x | yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash | 14 | ||||
-rwxr-xr-x | yardstick/benchmark/scenarios/availability/ha_tools/stop_service.bash | 17 |
2 files changed, 28 insertions, 3 deletions
diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash b/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash index 3164c44df..858d86ca0 100755 --- a/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash +++ b/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash @@ -15,8 +15,18 @@ set -e service_name=$1 -if [ "$service_name" = "keystone" ]; then - service apache2 start +Distributor=$(lsb_release -a | grep "Distributor ID" | awk '{print $3}') + +if [ "$Distributor" != "Ubuntu" -a "$service_name" != "keystone" -a "$service_name" != "neutron-server" -a "$service_name" != "haproxy" ]; then + service_name="openstack-"${service_name} +elif [ "$Distributor" = "Ubuntu" -a "$service_name" = "keystone" ]; then + service_name="apache2" +elif [ "$service_name" = "keystone" ]; then + service_name="httpd" +fi + +if which systemctl 2>/dev/null; then + systemctl start $service_name else service $service_name start fi diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/stop_service.bash b/yardstick/benchmark/scenarios/availability/ha_tools/stop_service.bash index a8901784e..fd8534e24 100755 --- a/yardstick/benchmark/scenarios/availability/ha_tools/stop_service.bash +++ b/yardstick/benchmark/scenarios/availability/ha_tools/stop_service.bash @@ -15,7 +15,22 @@ set -e service_name=$1 -service $service_name stop +Distributor=$(lsb_release -a | grep "Distributor ID" | awk '{print $3}') + +if [ "$Distributor" != "Ubuntu" -a "$service_name" != "keystone" -a "$service_name" != "neutron-server" -a "$service_name" != "haproxy" ]; then + service_name="openstack-"${service_name} +elif [ "$Distributor" = "Ubuntu" -a "$service_name" = "keystone" ]; then + service_name="apache2" +elif [ "$service_name" = "keystone" ]; then + service_name="httpd" +fi + +if which systemctl 2>/dev/null; then + systemctl stop $service_name +else + service $service_name stop +fi + # TODO # check the service status |