fstests: add _require_mknod
authorEric Sandeen <sandeen@redhat.com>
Mon, 18 May 2020 16:16:47 +0000 (11:16 -0500)
committerEryu Guan <guaneryu@gmail.com>
Sun, 24 May 2020 15:09:42 +0000 (23:09 +0800)
Add a _require_mknod test so that filesystems with no ->mknod
operation will _notrun instead of fail, and add the helper to
all necessary tests.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc
tests/generic/062
tests/generic/184
tests/generic/306
tests/generic/401
tests/generic/434
tests/generic/479
tests/generic/564

index 6295203..310fdc4 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -4215,6 +4215,13 @@ _require_sysctl_variable()
        sysctl $name &>/dev/null || _notrun "$name sysctl unavailable"
 }
 
+_require_mknod()
+{
+       mknod $TEST_DIR/$seq.null c 1 3 \
+               || _notrun "$FSTYP does not support mknod/mkfifo"
+       rm -f $TEST_DIR/$seq.null
+}
+
 init_rc
 
 ################################################################################
index ba74488..d2a0ac9 100755 (executable)
@@ -60,6 +60,7 @@ _supported_os Linux
 _require_scratch
 _require_attrs
 _require_symlinks
+_require_mknod
 
 rm -f $tmp.backup1 $tmp.backup2 $seqres.full
 
index 8aca1a0..94f4d0e 100755 (executable)
@@ -29,6 +29,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_test
+_require_mknod
 
 rm -f $TEST_DIR/null
 mknod $TEST_DIR/null c 1 3
index 046f451..6f16a5f 100755 (executable)
@@ -34,6 +34,7 @@ _supported_os Linux
 _require_scratch
 _require_test
 _require_symlinks
+_require_mknod
 
 DEVNULL=$SCRATCH_MNT/devnull
 DEVZERO=$SCRATCH_MNT/devzero
index 00e9bbe..f8b1fd2 100755 (executable)
@@ -38,6 +38,7 @@ _supported_fs generic
 _supported_os Linux
 _require_scratch
 _require_symlinks
+_require_mknod
 _require_test_program "t_dir_type"
 
 rm -f $seqres.full
index edbf49d..131c5d9 100755 (executable)
@@ -30,6 +30,7 @@ _supported_os Linux
 
 _require_xfs_io_command "copy_range"
 _require_test
+_require_mknod
 
 testdir=$TEST_DIR/test-$seq
 rm -rf $testdir
index aaf864a..fc0b3b6 100755 (executable)
@@ -33,6 +33,7 @@ _supported_fs generic
 _supported_os Linux
 _require_scratch
 _require_symlinks
+_require_mknod
 _require_dm_target flakey
 
 rm -f $seqres.full
index 4958b3b..b9b2113 100755 (executable)
@@ -37,6 +37,9 @@ rm -f $seqres.full
 
 _require_test
 _require_loop
+# for mkfifo
+_require_mknod
+
 #
 # This test effectively requires xfs_io with these commits
 #  2a42470b xfs_io: copy_file_range length is a size_t