]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: Add support for specifying sub-tests with run-standalone.sh
authorDavid Zafman <dzafman@redhat.com>
Tue, 1 Aug 2017 23:04:10 +0000 (16:04 -0700)
committerDavid Zafman <dzafman@redhat.com>
Thu, 10 Aug 2017 15:30:47 +0000 (08:30 -0700)
Fix test-ceph-helpers.sh to pass additional arguments on

Signed-off-by: David Zafman <dzafman@redhat.com>
qa/run-standalone.sh
qa/standalone/README
qa/standalone/misc/test-ceph-helpers.sh

index 82c93c56632f45f672129370fbc825b6405b92a9..a30200993b4f2f54ac737a15a4e9e1bdefc76d51 100755 (executable)
@@ -40,6 +40,7 @@ location="../qa/standalone"
 
 count=0
 errors=0
+userargs=""
 for f in $(cd $location ; find . -perm $exec_mode -type f)
 do
     f=$(echo $f | sed 's/\.\///')
@@ -51,11 +52,16 @@ do
         found=false
         for c in "${!select[@]}"
         do
-            if [[ "${select[$c]}" = $(basename $f) ]]; then
+            # Get command and any arguments of subset of tests ro tun
+            allargs="${select[$c]}"
+            arg1=$(echo "$allargs" | cut --delimiter " " --field 1)
+            # Get user args for this selection for use below
+            userargs="$(echo $allargs | cut -s --delimiter " " --field 2-)"
+            if [[ "$arg1" = $(basename $f) ]]; then
                 found=true
                 break
             fi
-            if [[ "${select[$c]}" = "$f" ]]; then
+            if [[ "$arg1" = "$f" ]]; then
                 found=true
                 break
             fi
@@ -69,13 +75,14 @@ do
         continue
     fi
 
+    cmd="$location/$f $userargs"
     count=$(expr $count + 1)
-    echo "--- $f ---"
+    echo "--- $cmd ---"
     if [[ "$dryrun" != "true" ]]; then
         if ! PATH=$PATH:bin \
            CEPH_ROOT=.. \
            CEPH_LIB=lib \
-           $location/$f ; then
+           $cmd ; then
           echo "$f .............. FAILED"
           errors=$(expr $errors + 1)
         fi
index 8ec202639bdbd09e2164be00c1c6e911088b2e27..3082442cba3264bc1527a19f11eb1d5450595b29 100644 (file)
@@ -16,3 +16,8 @@ You can run them in a git checkout + build directory as well:
     qa/standalone as arguments to qa/run-standalone.sh.
 
 ../qa/run-standalone.sh misc.sh osd/osd-dup.sh
+
+  * Add support for specifying arguments to selected tests by simply adding
+    list of tests to each argument.
+
+../qa/run-standalone.sh "test-ceph-helpers.sh test_get_last_scrub_stamp"
index 3a6788ecaa36409327f10da8f9271cccecb8c977..932fcf3fa324ffb9485da4050311314883fafee8 100755 (executable)
@@ -18,4 +18,4 @@
 # GNU Library Public License for more details.
 #
 
-$CEPH_ROOT/qa/standalone/ceph-helpers.sh TESTS
+$CEPH_ROOT/qa/standalone/ceph-helpers.sh TESTS "$@"