public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] generic: honor the FSSTRESS_AVOID environment variable
@ 2017-02-05  6:53 Theodore Ts'o
  2017-02-05  6:53 ` [PATCH 2/3] common/log: add ext4 support for log state probing Theodore Ts'o
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Theodore Ts'o @ 2017-02-05  6:53 UTC (permalink / raw)
  To: fstests; +Cc: Theodore Ts'o

Make sure all tests which run fsstress, and which do not have a very
specific custom profile of which file system operations to run, honor
the FSSTRESS_AVOID environment variable.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 tests/generic/051 | 2 +-
 tests/generic/232 | 2 +-
 tests/generic/388 | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/generic/051 b/tests/generic/051
index b0c37824..7b807b9f 100755
--- a/tests/generic/051
+++ b/tests/generic/051
@@ -63,7 +63,7 @@ PROCS=$((2 * LOAD_FACTOR))
 load_dir=$SCRATCH_MNT/test
 
 # let this run for a while
-$FSSTRESS_PROG -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
+$FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
 sleep $SLEEP_TIME
 $KILLALL_PROG -q $FSSTRESS_PROG
 wait
diff --git a/tests/generic/232 b/tests/generic/232
index 6b197791..f4853f72 100755
--- a/tests/generic/232
+++ b/tests/generic/232
@@ -53,7 +53,7 @@ _fsstress()
 
 	out=$SCRATCH_MNT/fsstress.$$
 	count=2000
-	args=`_scale_fsstress_args -d $out -n $count -p 7`
+	args=`_scale_fsstress_args -d $out -n $count -p 7 $FSSTRESS_AVOID`
 
 	echo "fsstress $args" >> $seqres.full
 	if ! $FSSTRESS_PROG $args | tee -a $seqres.full | _filter_num
diff --git a/tests/generic/388 b/tests/generic/388
index 9d4ba9d6..3729aa5b 100755
--- a/tests/generic/388
+++ b/tests/generic/388
@@ -65,7 +65,7 @@ _scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount || _fail "mount failed"
 
 for i in $(seq 1 50); do
-	($FSSTRESS_PROG -d $SCRATCH_MNT -n 999999 -p 4 >> $seqres.full &) \
+	($FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p 4 >> $seqres.full &) \
 		> /dev/null 2>&1
 
 	# purposely include 0 second sleeps to test shutdown immediately after
-- 
2.11.0.rc0.7.gbe5a750


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] common/log: add ext4 support for log state probing
  2017-02-05  6:53 [PATCH 1/3] generic: honor the FSSTRESS_AVOID environment variable Theodore Ts'o
@ 2017-02-05  6:53 ` Theodore Ts'o
  2017-02-05  6:53 ` [PATCH 3/3] generic: filter out lost+found when running "ls $SCRATCH_MNT" Theodore Ts'o
  2017-02-05  8:02 ` [PATCH 1/3] generic: honor the FSSTRESS_AVOID environment variable Amir Goldstein
  2 siblings, 0 replies; 5+ messages in thread
From: Theodore Ts'o @ 2017-02-05  6:53 UTC (permalink / raw)
  To: fstests; +Cc: Theodore Ts'o

This enables generic/052, generic/054, and generic/055 for ext4.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 common/log | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/common/log b/common/log
index 82899c67..d1c19ff5 100644
--- a/common/log
+++ b/common/log
@@ -228,6 +228,14 @@ _scratch_f2fs_logstate()
     echo $?
 }
 
+_scratch_ext4_logstate()
+{
+    $DUMPE2FS_PROG -h $SCRATCH_DEV 2> /dev/null | tee -a $seqres.full | \
+	grep "^Filesystem features" | grep -q needs_recovery
+    test $? -ne 0
+    echo $?
+}
+
 _scratch_dump_log()
 {
 	case "$FSTYP" in
@@ -237,6 +245,9 @@ _scratch_dump_log()
 	f2fs)
 		$DUMP_F2FS_PROG $SCRATCH_DEV
 		;;
+	ext4)
+		$DUMPE2FS_PROG -h $SCRATCH_DEV
+		;;
 	*)
 		;;
 	esac
@@ -251,6 +262,9 @@ _test_dump_log()
 	f2fs)
 		$DUMP_F2FS_PROG $TEST_DEV
 		;;
+	ext4)
+		$DUMPE2FS_PROG -h $TEST_DEV
+		;;
 	*)
 		;;
 	esac
@@ -265,6 +279,9 @@ _print_logstate()
     f2fs)
         dirty=$(_scratch_f2fs_logstate)
         ;;
+    ext4)
+        dirty=$(_scratch_ext4_logstate)
+        ;;
     *)
         ;;
     esac
@@ -532,6 +549,11 @@ _require_logstate()
             _notrun "This test requires dump.f2fs utility."
         fi
         ;;
+    ext4)
+	if [ -z "$DUMPE2FS_PROG" ]; then
+		_notrun "This test requires dumpe2fs utility."
+	fi
+	;;
     *)
         _notrun "$FSTYP does not support log state probing."
         ;;
@@ -570,6 +592,22 @@ _f2fs_log_config()
     echo "  test10    active_logs=6,background_gc=on,discard,inline_data,inline_dentry"
 }
 
+_ext4_log_config()
+{
+    echo "# mkfs-opt             mount-opt"
+    echo "# ------------------------------"
+    echo "  /dev/null     data=writeback"
+    echo "  /dev/null     data=ordered"
+    echo "  /dev/null     data=journal"
+    echo "  /dev/null     data=ordered,data_err=abort"
+    echo "  /dev/null     data=writeback,nojournal_checksum"
+    echo "  /dev/null     data=ordered,nojournal_checksum"
+    echo "  /dev/null     data=journal,nojournal_checksum"
+    echo "  /dev/null     data=ordered,data_err=abort,nojournal_checksum"
+    echo "  /dev/null     data=writeback,journal_checksum"
+    echo "  /dev/null     data=ordered,journal_checksum"
+}
+
 _get_log_configs()
 {
     case "$FSTYP" in
@@ -579,6 +617,9 @@ _get_log_configs()
     f2fs)
         _f2fs_log_config
         ;;
+    ext4)
+        _ext4_log_config
+        ;;
     *)
         _notrun "$FSTYP does not support log configs."
         ;;
-- 
2.11.0.rc0.7.gbe5a750


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] generic: filter out lost+found when running "ls $SCRATCH_MNT"
  2017-02-05  6:53 [PATCH 1/3] generic: honor the FSSTRESS_AVOID environment variable Theodore Ts'o
  2017-02-05  6:53 ` [PATCH 2/3] common/log: add ext4 support for log state probing Theodore Ts'o
@ 2017-02-05  6:53 ` Theodore Ts'o
  2017-02-05  8:02 ` [PATCH 1/3] generic: honor the FSSTRESS_AVOID environment variable Amir Goldstein
  2 siblings, 0 replies; 5+ messages in thread
From: Theodore Ts'o @ 2017-02-05  6:53 UTC (permalink / raw)
  To: fstests; +Cc: Theodore Ts'o

The generic/052 and generic/054 tests run ls on the root directory,
and on ext4 we have a lost+found directory which is not in the golden
output.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 common/filter     | 5 +++++
 tests/generic/052 | 2 +-
 tests/generic/054 | 4 ++--
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/common/filter b/common/filter
index e39ac0e2..43281599 100644
--- a/common/filter
+++ b/common/filter
@@ -401,5 +401,10 @@ _filter_mknod()
 	sed -e "s/mknod: [\`']\(.*\)': File exists/mknod: \1: File exists/"
 }
 
+_filter_lostfound()
+{
+	sed -e '/^lost+found$/d'
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/tests/generic/052 b/tests/generic/052
index 74cf5b62..f7cdd09c 100755
--- a/tests/generic/052
+++ b/tests/generic/052
@@ -82,7 +82,7 @@ _scratch_mount $mnt >>$seqres.full 2>&1 \
     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
 
 echo "ls SCRATCH_MNT"
-ls $SCRATCH_MNT
+ls $SCRATCH_MNT | _filter_lostfound
 
 echo "unmount"
 _scratch_unmount
diff --git a/tests/generic/054 b/tests/generic/054
index 238741c1..8375e574 100755
--- a/tests/generic/054
+++ b/tests/generic/054
@@ -102,7 +102,7 @@ for s in sync nosync ; do
 
 	# check before on what FS should look like
 	_echofull "ls SCRATCH_MNT"
-	ls $SCRATCH_MNT
+	ls $SCRATCH_MNT | _filter_lostfound
 
 	_echofull "godown"
 	src/godown -v -f $SCRATCH_MNT >> $seqres.full
@@ -120,7 +120,7 @@ for s in sync nosync ; do
 
 	# check on what FS looks like after log recovery
 	_echofull "ls SCRATCH_MNT"
-	ls $SCRATCH_MNT
+	ls $SCRATCH_MNT | _filter_lostfound
 
 	_echofull "unmount"
 	_scratch_unmount
-- 
2.11.0.rc0.7.gbe5a750


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] generic: honor the FSSTRESS_AVOID environment variable
  2017-02-05  6:53 [PATCH 1/3] generic: honor the FSSTRESS_AVOID environment variable Theodore Ts'o
  2017-02-05  6:53 ` [PATCH 2/3] common/log: add ext4 support for log state probing Theodore Ts'o
  2017-02-05  6:53 ` [PATCH 3/3] generic: filter out lost+found when running "ls $SCRATCH_MNT" Theodore Ts'o
@ 2017-02-05  8:02 ` Amir Goldstein
  2017-02-05 20:09   ` Theodore Ts'o
  2 siblings, 1 reply; 5+ messages in thread
From: Amir Goldstein @ 2017-02-05  8:02 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: fstests

On Sun, Feb 5, 2017 at 8:53 AM, Theodore Ts'o <tytso@mit.edu> wrote:
> Make sure all tests which run fsstress, and which do not have a very
> specific custom profile of which file system operations to run,

Can you elaborate about this criteria?
Specifically, what about overlay/019? and several other {xfs,btrfs}/* stress
tests. Why do they not qualify?

> honor the FSSTRESS_AVOID environment variable.
>
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
>  tests/generic/051 | 2 +-
>  tests/generic/232 | 2 +-
>  tests/generic/388 | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/generic/051 b/tests/generic/051
> index b0c37824..7b807b9f 100755
> --- a/tests/generic/051
> +++ b/tests/generic/051
> @@ -63,7 +63,7 @@ PROCS=$((2 * LOAD_FACTOR))
>  load_dir=$SCRATCH_MNT/test
>
>  # let this run for a while
> -$FSSTRESS_PROG -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
> +$FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
>  sleep $SLEEP_TIME
>  $KILLALL_PROG -q $FSSTRESS_PROG
>  wait
> diff --git a/tests/generic/232 b/tests/generic/232
> index 6b197791..f4853f72 100755
> --- a/tests/generic/232
> +++ b/tests/generic/232
> @@ -53,7 +53,7 @@ _fsstress()
>
>         out=$SCRATCH_MNT/fsstress.$$
>         count=2000
> -       args=`_scale_fsstress_args -d $out -n $count -p 7`
> +       args=`_scale_fsstress_args -d $out -n $count -p 7 $FSSTRESS_AVOID`
>
>         echo "fsstress $args" >> $seqres.full
>         if ! $FSSTRESS_PROG $args | tee -a $seqres.full | _filter_num
> diff --git a/tests/generic/388 b/tests/generic/388
> index 9d4ba9d6..3729aa5b 100755
> --- a/tests/generic/388
> +++ b/tests/generic/388
> @@ -65,7 +65,7 @@ _scratch_mkfs >> $seqres.full 2>&1
>  _scratch_mount || _fail "mount failed"
>
>  for i in $(seq 1 50); do
> -       ($FSSTRESS_PROG -d $SCRATCH_MNT -n 999999 -p 4 >> $seqres.full &) \
> +       ($FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p 4 >> $seqres.full &) \
>                 > /dev/null 2>&1
>
>         # purposely include 0 second sleeps to test shutdown immediately after
> --
> 2.11.0.rc0.7.gbe5a750
>
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] generic: honor the FSSTRESS_AVOID environment variable
  2017-02-05  8:02 ` [PATCH 1/3] generic: honor the FSSTRESS_AVOID environment variable Amir Goldstein
@ 2017-02-05 20:09   ` Theodore Ts'o
  0 siblings, 0 replies; 5+ messages in thread
From: Theodore Ts'o @ 2017-02-05 20:09 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: fstests

On Sun, Feb 05, 2017 at 10:02:03AM +0200, Amir Goldstein wrote:
> On Sun, Feb 5, 2017 at 8:53 AM, Theodore Ts'o <tytso@mit.edu> wrote:
> > Make sure all tests which run fsstress, and which do not have a very
> > specific custom profile of which file system operations to run,
> 
> Can you elaborate about this criteria?
> Specifically, what about overlay/019? and several other {xfs,btrfs}/* stress
> tests. Why do they not qualify?

I didn't bother looking at the tests beyond tests/generic, sorry.

The general criteria I used is that fstress invocation didn't specify
any -f options, then I would definitely add a $FSSTRESS_AVOID.  If
there was a large number of -f options, then definitely don't add
$FSSTRESS_AVOID.  If there are only 2 or 3 -f options, then I'd
probably add $FSSTRESS_AVOID but it's more of a test by test basis.

	     		     	      	   - Ted

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-05 20:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-05  6:53 [PATCH 1/3] generic: honor the FSSTRESS_AVOID environment variable Theodore Ts'o
2017-02-05  6:53 ` [PATCH 2/3] common/log: add ext4 support for log state probing Theodore Ts'o
2017-02-05  6:53 ` [PATCH 3/3] generic: filter out lost+found when running "ls $SCRATCH_MNT" Theodore Ts'o
2017-02-05  8:02 ` [PATCH 1/3] generic: honor the FSSTRESS_AVOID environment variable Amir Goldstein
2017-02-05 20:09   ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox