Merge "Remove useless files in Bottlenecks repo"
[bottlenecks.git] / run_tests.sh
index 9901269..3bf18c6 100755 (executable)
@@ -17,17 +17,16 @@ where:
     -h|--help         show the help text
     -s|--teststory    run specific test story
       <test story>        one of the following:
-                              (rubbos, vstf, posca_factor_test)
+                              (posca_factor_test)
                       user can also define their own test story and pass as var to this file,
                       please refer to testsuites/posca/testsuite_story/ for details
     -c|--testcase     run specific test case
       <test case>         one of the following:
-                              (posca_factor_system_bandwidth, posca_factor_ping)
+                              (posca_factor_ping, posca_factor_soak_throughputs, ...)
     --cleanup         cleanup test dockers runing when test is done (false by default)
     --report          push results to DB (false by default)
 
 examples:
-    $(basename "$0")
     $(basename "$0") -s posca_factor_test"
 
 # Define global variables
@@ -42,11 +41,11 @@ cleanup=false
 
 # Define alias for log printing
 info () {
-    logger -s -t "bottlenecks.info" "$*"
+    logger -s -t "BOTTLENECKS INFO" "$*"
 }
 
 error () {
-    logger -s -t "bottlenecks.error" "$*"
+    logger -s -t "BOTTLENECKS ERROR" "$*"
     exit 1
 }
 
@@ -104,7 +103,12 @@ function run_test(){
         ;;
         *)
             info "Running posca $test_level: $test_exec"
-            python ${POSCA_SUITE}/../run_testsuite.py $test_level $test_exec $REPORT
+            opts="--privileged=true -id"
+            docker_volume="-v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp"
+            docker run $opts --name bottlenecks-load-master $docker_volume opnfv/bottlenecks:latest /bin/bash
+            sleep 5
+            POSCA_SCRIPT="/home/opnfv/bottlenecks/testsuites/posca"
+            docker exec bottlenecks-load-master python ${POSCA_SCRIPT}/../run_testsuite.py ${test_level} ${test_exec} ${REPORT}
         ;;
     esac
 }
@@ -172,7 +176,8 @@ fi
 # Clean up testing dockers
 if [[ ${cleanup} == true ]]; then
     info "Cleaning up docker-compose images and dockers"
-    docker-compose -f $BASEDIR/docker/bottleneck-compose/docker-compose.yml down --rmi all
     bash ${BASEDIR}/docker/docker_cleanup.sh -d influxdb --debug
     bash ${BASEDIR}/docker/docker_cleanup.sh -d bottlenecks --debug
+    bash ${BASEDIR}/docker/docker_cleanup.sh -d yardstick --debug
+    bash ${BASEDIR}/docker/docker_cleanup.sh -d elk --debug
 fi