]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: Add special test_failure.sh script (not run by default)
authorDavid Zafman <dzafman@redhat.com>
Mon, 31 Jul 2017 16:28:12 +0000 (09:28 -0700)
committerDavid Zafman <dzafman@redhat.com>
Fri, 4 Aug 2017 13:38:09 +0000 (06:38 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
qa/run-standalone.sh
qa/standalone/special/test-failure.sh [new file with mode: 0755]

index 6b94958568725a095dfa5b4adcf1081d73a4a015..ce86d0ef749f2f1cf4500035b36b933206c6f900 100755 (executable)
@@ -60,6 +60,11 @@ do
             continue
         fi
     fi
+    # Don't run test-failure.sh unless explicitly specified
+    if [ "$all" = "true" -a "$f" = "special/test-failure.sh" ]; then
+        continue
+    fi
+
     count=$(expr $count + 1)
     echo "--- $f ---"
     if [[ "$dryrun" != "true" ]]; then
diff --git a/qa/standalone/special/test-failure.sh b/qa/standalone/special/test-failure.sh
new file mode 100755 (executable)
index 0000000..d110d94
--- /dev/null
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+set -ex
+
+source $CEPH_ROOT/qa/standalone/ceph-helpers.sh
+
+function run() {
+    local dir=$1
+    shift
+
+    local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
+    for func in $funcs ; do
+        setup $dir || return 1
+        $func $dir || return 1
+        teardown $dir || return 1
+    done
+}
+
+function TEST_failure_log() {
+    local dir=$1
+
+    cat > $dir/test_failure.log << EOF
+This is a fake log file
+*
+*
+*
+*
+*
+This ends the fake log file
+EOF
+
+    # Test fails
+    return 1
+}
+
+main test_failure "$@"