generic: Add nocheck shutdown stress test
authorKhazhismel Kumykov <khazhy@google.com>
Fri, 22 Sep 2017 20:10:47 +0000 (13:10 -0700)
committerEryu Guan <eguan@redhat.com>
Mon, 25 Sep 2017 10:25:36 +0000 (18:25 +0800)
Most shutdown tests only run on filesystems with metadata
journaling, so we lose coverage. Add a shutdown stress test that
doesn't check for consistency, so does not require journaling. This
is a modified version of generic/051, with some extras trimmed and
fs checking removed.

Signed-off-by: Khazhismel Kumykov <khazhy@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/generic/461 [new file with mode: 0755]
tests/generic/461.out [new file with mode: 0644]
tests/generic/group

diff --git a/tests/generic/461 b/tests/generic/461
new file mode 100755 (executable)
index 0000000..2f85114
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/bash
+# FS QA Test No. 461
+#
+# Shutdown stress test - exercise shutdown codepath with fsstress,
+# make sure we don't BUG/WARN. Coverage for all fs with shutdown.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+# Copyright (c) 2017 Google, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+_cleanup()
+{
+       cd /
+       _scratch_unmount 2>/dev/null
+       rm -f $tmp.*
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+
+_require_scratch_nocheck
+_require_scratch_shutdown
+_require_command "$KILLALL_PROG" killall
+
+rm -f $seqres.full
+
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount
+
+SLEEP_TIME=$((10 * $TIME_FACTOR))
+PROCS=$((4 * LOAD_FACTOR))
+
+load_dir=$SCRATCH_MNT/test
+
+$FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
+sleep $SLEEP_TIME
+sync
+
+# now shutdown and unmount
+sleep 5
+$here/src/godown $load_dir
+$KILLALL_PROG -q $FSSTRESS_PROG
+wait
+
+# for some reason fsstress processes manage to live on beyond the wait?
+sleep 5
+
+_scratch_unmount
+
+echo "Silence is golden"
+
+status=0
+exit
diff --git a/tests/generic/461.out b/tests/generic/461.out
new file mode 100644 (file)
index 0000000..a06a605
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 461
+Silence is golden
index f922b496b30fab986eb2c5214f70cc2b38131f16..5d32b83fdb372a92f03dd177dbf77198390fd3e5 100644 (file)
 458 auto quick clone
 459 auto dangerous
 460 auto quick rw
+461 auto shutdown stress