Merge "Add template for BGPVPN test case in run_tests.sh"
[functest.git] / docker / run_tests.sh
index 2a523ed..8b48a82 100755 (executable)
@@ -15,8 +15,9 @@ usage:
 where:
     -o|--offline      optional offline mode (experimental)
     -h|--help         show this help text
+    -r|--report       push results to database (false by default)
     -t|--test         run specific set of tests
-      <test_name>     one or more of the following: vping,odl,rally,tempest. Separated by comma.
+      <test_name>     one or more of the following: vping,odl,rally,tempest,vims. Separated by comma.
 
 
 examples:
@@ -28,7 +29,8 @@ examples:
 # Support for Functest offline
 # NOTE: Still not 100% working when running the tests
 offline=false
-arr_test=(vping odl rally tempest vims)
+report=""
+arr_test=(vping odl tempest vims rally)
 
 
 function run_test(){
@@ -39,7 +41,8 @@ function run_test(){
     case $test_name in
         "vping")
             info "Running vPing test..."
-            python ${FUNCTEST_REPO_DIR}/testcases/vPing/CI/libraries/vPing.py --debug ${FUNCTEST_REPO_DIR}/ -r
+            python ${FUNCTEST_REPO_DIR}/testcases/vPing/CI/libraries/vPing.py \
+                --debug ${FUNCTEST_REPO_DIR}/ ${report}
         ;;
         "odl")
             info "Running ODL test..."
@@ -54,6 +57,15 @@ function run_test(){
             elif [ $INSTALLER_TYPE == "foreman" ]; then
                 #odl_port=8081
                 ${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/CI/start_tests.sh
+            elif [ $INSTALLER_TYPE == "apex" ]; then
+                # TODO
+                ${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/CI/start_tests.sh
+            elif [ $INSTALLER_TYPE == "joid" ]; then
+                # TODO
+                ${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/CI/start_tests.sh
+            elif [ $INSTALLER_TYPE == "compass" ]; then
+                # TODO
+                ${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/CI/start_tests.sh
             else
                 error "INSTALLER_TYPE not valid."
                 exit 1
@@ -66,8 +78,8 @@ function run_test(){
         ;;
         "tempest")
             info "Running Tempest smoke tests..."
-            rally verify start smoke
-            rally verify list
+            python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/run_tempest.py \
+                --debug ${FUNCTEST_REPO_DIR}/ -m smoke ${report}
             # save tempest.conf for further troubleshooting
             tempest_conf="${RALLY_VENV_DIR}/tempest/for-deployment-*/tempest.conf"
             if [ -f ${tempest_conf} ]; then
@@ -76,12 +88,26 @@ function run_test(){
         ;;
         "vims")
             info "Running vIMS test..."
-            python ${FUNCTEST_REPO_DIR}/testcases/vIMS/CI/vIMS.py --debug ${FUNCTEST_REPO_DIR}/
+            python ${FUNCTEST_REPO_DIR}/testcases/vIMS/CI/vIMS.py \
+                --debug ${FUNCTEST_REPO_DIR}/ ${report}
         ;;
         "rally")
             info "Running Rally benchmark suite..."
-            python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/run_rally.py --debug ${FUNCTEST_REPO_DIR}/ all
+            python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/run_rally.py \
+                --debug ${FUNCTEST_REPO_DIR}/ all ${report}
         ;;
+        "bgpvpn_template")
+            info "Running BGPVPN Tempest test case..."
+            tempest_dir=$(find /root/.rally -type d -name for-deploy*)
+            # TODO:
+            # do the call of your test case here.
+            # the bgpvpn repo is cloned in $BGPVPN_REPO_DIR
+            # tempest is installed in $tempest_dir
+            # Suggestion:
+            #   mkdir ${tempest_dir}/tempest/api/bgpvpn/
+            #   cp ${BGPVPN_REPO_DIR}/networking_bgpvpn_tempest/<whatever you need> \
+            #       ${tempest_dir}/tempest/api/bgpvpn/
+            #   ${tempest_dir}/run_tempest.sh tempest.api.bgpvpn.<test_case_name>
     esac
 }
 
@@ -99,6 +125,9 @@ while [[ $# > 0 ]]
         -o|--offline)
             offline=true
         ;;
+        -r|--report)
+            report="-r"
+        ;;
         -t|--test|--tests)
             TEST="$2"
             shift