From da24798df6a6204ffe78d16da42d4090de8ab355 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 10 Dec 2014 19:31:41 +0000 Subject: show test option in the usage, don't check for running instances on test --- leap-platform-test | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/leap-platform-test b/leap-platform-test index 91f06a9..4a7e30e 100755 --- a/leap-platform-test +++ b/leap-platform-test @@ -26,7 +26,7 @@ COMMANDS create_provider creates a provider instance deploy deploy node(s) reset_deploy reset and deploy node(s) - + test run leap test EOF } @@ -53,6 +53,9 @@ add_nodes() { bootstrap_nodes() { + + check_for_running_instances + for vm in $@ do $LEAP_CMD $OPTS local start "$vm" @@ -63,14 +66,27 @@ bootstrap_nodes() { # make sure machines are rebooted in order to be able to load kernel modules after a kernel update # https://leap.se/code/issues/6494 - cd test + cd ${PROVIDERDIR}/test vagrant reload $vm $LEAP_CMD $OPTS local save "$vm" done } +check_for_running_instances() { + + if [[ $( pidof -x "$( basename "$0" )" -o %PPID ) ]] + then + echo "Other process(es) found running for $(basename "$0") - exiting." + exit 1 + fi + +} + create_provider() { + + check_for_running_instances + if [ -e "$PROVIDERDIR" ] then echo "$PROVIDERDIR" exists - exiting @@ -171,6 +187,8 @@ log_start() { reset_deploy() { + check_for_running_instances + local nodes="$*" update_platform update_leap_cli @@ -237,7 +255,7 @@ run_tests () { echo -e "\nRunning leap test on $date" | tee -a "$TEST_LOG1" "$TEST_LOG2" - $LEAP_CMD "$OPTS" test --continue 2>&1 | egrep -v "$TEST_FILTER" | tee -a "$TEST_LOG1" "$TEST_LOG2" + $LEAP_CMD $OPTS test --continue 2>&1 | egrep -v "$TEST_FILTER" | tee -a "$TEST_LOG1" "$TEST_LOG2" test_failure=${PIPESTATUS[0]} if [ "$test_failure" -ne 0 ] @@ -390,11 +408,6 @@ else nodes=$nodelist fi -if [[ $( pidof -x "$( basename "$0" )" -o %PPID ) ]] -then - echo "Other process(es) found running for $(basename "$0") - exiting." - exit 1 -fi case $cmd in add_nodes) add_nodes "$nodes";; -- cgit v1.2.3