summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitrios Markou <mardim@intracom-telecom.com>2018-04-25 17:37:03 +0300
committerDimitrios Markou <mardim@intracom-telecom.com>2018-05-08 12:53:49 +0300
commit57045b4e11ecffa256ec084919d6d34b9abaa109 (patch)
tree99f062205a3db992757b1476f3c2ff668224530b
parentc778b2494c4280035193a324a230b66ab9081300 (diff)
Add support for restarting a service
JIRA: YARDSTICK-1138 Change-Id: Id57defb574eb7e0f5be81b52803cdb05f46796ab Signed-off-by: Dimitrios Markou <mardim@intracom-telecom.com> (cherry picked from commit 131b9f04a360ccc894510a275bd33c57634608fc)
-rwxr-xr-xyardstick/benchmark/scenarios/availability/ha_tools/start_service.bash7
1 files changed, 4 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 858d86ca0..1d0fffd06 100755
--- a/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash
+++ b/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash
@@ -9,11 +9,12 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-# Start a service and check the service is started
+# Start or restart a service and check the service is started
set -e
service_name=$1
+operation=${2-start} # values are "start" or "restart"
Distributor=$(lsb_release -a | grep "Distributor ID" | awk '{print $3}')
@@ -26,7 +27,7 @@ elif [ "$service_name" = "keystone" ]; then
fi
if which systemctl 2>/dev/null; then
- systemctl start $service_name
+ systemctl $operation $service_name
else
- service $service_name start
+ service $service_name $operation
fi