]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: fix skipped backend API tests
authoralfonsomthd <almartin@redhat.com>
Wed, 30 Jan 2019 12:05:02 +0000 (13:05 +0100)
committeralfonsomthd <almartin@redhat.com>
Wed, 30 Jan 2019 12:05:02 +0000 (13:05 +0100)
* When the creation of the cluster is delegated to vstart_runner.py
(--create or --create-target-only) the amount of MGRs required
is calculated by the script so there is no more skipped tests
due to insufficient amount of MGRs.

* Additionally, this issue is not reproducible anymore:
Fixes: https://tracker.ceph.com/issues/37964
* Fixed typo: TEUTHOLOFY_PY_REQS

Signed-off-by: Alfonso Martínez <almartin@redhat.com>
qa/tasks/vstart_runner.py
src/pybind/mgr/dashboard/run-backend-api-tests.sh

index e0d805010991a6177fc8539c81d31defafba6fba..260e9907cb23c22d7edc7c7f74a60c40276d6eef 100644 (file)
@@ -23,6 +23,11 @@ Alternative usage:
     # If you wish to run a named test case, pass it as an argument:
     python ~/git/ceph/qa/tasks/vstart_runner.py tasks.cephfs.test_data_scan
 
+    # Also, you can create the cluster once and then run named test cases against it:
+    python ~/git/ceph/qa/tasks/vstart_runner.py --create-cluster-only
+    python ~/git/ceph/qa/tasks/vstart_runner.py tasks.mgr.dashboard.test_health
+    python ~/git/ceph/qa/tasks/vstart_runner.py tasks.mgr.dashboard.test_rgw
+
 """
 
 from StringIO import StringIO
@@ -878,6 +883,7 @@ def exec_test():
     # Parse arguments
     interactive_on_error = False
     create_cluster = False
+    create_cluster_only = False
 
     args = sys.argv[1:]
     flags = [a for a in args if a.startswith("-")]
@@ -887,6 +893,8 @@ def exec_test():
             interactive_on_error = True
         elif f == "--create":
             create_cluster = True
+        elif f == "--create-cluster-only":
+            create_cluster_only = True
         else:
             log.error("Unknown option '{0}'".format(f))
             sys.exit(-1)
@@ -917,7 +925,7 @@ def exec_test():
             os.kill(pid, signal.SIGKILL)
 
     # Fire up the Ceph cluster if the user requested it
-    if create_cluster:
+    if create_cluster or create_cluster_only:
         log.info("Creating cluster with {0} MDS daemons".format(
             max_required_mds))
         remote.run([os.path.join(SRC_PREFIX, "stop.sh")], check_status=False)
@@ -940,6 +948,9 @@ def exec_test():
         # definitely succeed
         LocalCephCluster(LocalContext()).mon_manager.wait_for_all_osds_up(timeout=30)
 
+    if create_cluster_only:
+        return
+
     # List of client mounts, sufficient to run the selected tests
     clients = [i.__str__() for i in range(0, max_required_clients)]
 
index c9efb2d5bc17276095273673dd96cbca43336acd..630adac9e0a48ccf2ac0c2ae0275e9ff1f39560d 100755 (executable)
@@ -30,7 +30,7 @@ setup_teuthology() {
     CURR_DIR=`pwd`
     BUILD_DIR="$CURR_DIR/../../../../build"
 
-    read -r -d '' TEUTHOLOFY_PY_REQS <<EOF
+    read -r -d '' TEUTHOLOGY_PY_REQS <<EOF
 apache-libcloud==2.2.1 \
 asn1crypto==0.22.0 \
 bcrypt==3.1.4 \
@@ -70,7 +70,7 @@ EOF
 
     virtualenv --python=/usr/bin/python venv
     source venv/bin/activate
-    eval pip install $TEUTHOLOFY_PY_REQS
+    eval pip install $TEUTHOLOGY_PY_REQS
     pip install -r $CURR_DIR/requirements.txt
     deactivate
 
@@ -92,8 +92,6 @@ EOF
 #    export COVERAGE_ENABLED=true
 #    export COVERAGE_FILE=.coverage.mgr.dashboard
 
-    MGR=2 RGW=1 ../src/vstart.sh -n -d
-    sleep 10
     cd $CURR_DIR
 }
 
@@ -102,21 +100,28 @@ run_teuthology_tests() {
     find ../src/pybind/mgr/dashboard/ -name '*.pyc' -exec rm -f {} \;
     source $TEMP_DIR/venv/bin/activate
 
-
-    if [ "$#" -gt 0 ]; then
-      TEST_CASES=""
+    OPTIONS=''
+    TEST_CASES=''
+    if [[ "$@" == '' || "$@" == '--create-cluster-only' ]]; then
+      TEST_CASES=`for i in \`ls $BUILD_DIR/../qa/tasks/mgr/dashboard/test_*\`; do F=$(basename $i); M="${F%.*}"; echo -n " tasks.mgr.dashboard.$M"; done`
+      TEST_CASES="tasks.mgr.test_dashboard $TEST_CASES"
+      if [[ "$@" == '--create-cluster-only' ]]; then
+        OPTIONS="$@"
+      fi
+    else
       for t in "$@"; do
         TEST_CASES="$TEST_CASES $t"
       done
-    else
-      TEST_CASES=`for i in \`ls $BUILD_DIR/../qa/tasks/mgr/dashboard/test_*\`; do F=$(basename $i); M="${F%.*}"; echo -n " tasks.mgr.dashboard.$M"; done`
-      TEST_CASES="tasks.mgr.test_dashboard $TEST_CASES"
     fi
 
     export PATH=$BUILD_DIR/bin:$PATH
     export LD_LIBRARY_PATH=$BUILD_DIR/lib/cython_modules/lib.${CEPH_PY_VERSION_MAJOR}/:$BUILD_DIR/lib
     export PYTHONPATH=$TEMP_DIR/teuthology:$BUILD_DIR/../qa:$BUILD_DIR/lib/cython_modules/lib.${CEPH_PY_VERSION_MAJOR}/:$BUILD_DIR/../src/pybind
-    eval python ../qa/tasks/vstart_runner.py $TEST_CASES
+    if [[ -z "$RGW" ]]; then
+        export RGW=1
+    fi
+
+    eval python ../qa/tasks/vstart_runner.py $OPTIONS $TEST_CASES
 
     deactivate
     cd $CURR_DIR
@@ -141,6 +146,7 @@ cleanup_teuthology() {
 }
 
 setup_teuthology
+run_teuthology_tests --create-cluster-only
 
 # End sourced section
 return 2> /dev/null