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 629520367db7cfda6a02c17800c438d19597fd25..310fdc46a888f7bbd7b315531579431791ae0021 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -4215,6 +4215,13 @@ _require_sysctl_variable()
        sysctl $name &>/dev/null || _notrun "$name sysctl unavailable"
 }
 
        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
 
 ################################################################################
 init_rc
 
 ################################################################################
index ba7448854996fb8675cda6f6406c31aadda5a21d..d2a0ac9a9a21e4c3398e206b82879866e3a21379 100755 (executable)
@@ -60,6 +60,7 @@ _supported_os Linux
 _require_scratch
 _require_attrs
 _require_symlinks
 _require_scratch
 _require_attrs
 _require_symlinks
+_require_mknod
 
 rm -f $tmp.backup1 $tmp.backup2 $seqres.full
 
 
 rm -f $tmp.backup1 $tmp.backup2 $seqres.full
 
index 8aca1a0d68d59c9fc6c6c96bd6ef6fa24e802fbe..94f4d0e1c14408a61f932b8f630ff17192d79149 100755 (executable)
@@ -29,6 +29,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_test
 _supported_fs generic
 _supported_os Linux
 _require_test
+_require_mknod
 
 rm -f $TEST_DIR/null
 mknod $TEST_DIR/null c 1 3
 
 rm -f $TEST_DIR/null
 mknod $TEST_DIR/null c 1 3
index 046f4516ec990ff621ab180a3bc66ea312c947dc..6f16a5f52e999fb762435d6af25cce00e1b31f23 100755 (executable)
@@ -34,6 +34,7 @@ _supported_os Linux
 _require_scratch
 _require_test
 _require_symlinks
 _require_scratch
 _require_test
 _require_symlinks
+_require_mknod
 
 DEVNULL=$SCRATCH_MNT/devnull
 DEVZERO=$SCRATCH_MNT/devzero
 
 DEVNULL=$SCRATCH_MNT/devnull
 DEVZERO=$SCRATCH_MNT/devzero
index 00e9bbe0aac74276a04d850344bb00063a5471bf..f8b1fd21878ef58542ba1112203a497db8542d52 100755 (executable)
@@ -38,6 +38,7 @@ _supported_fs generic
 _supported_os Linux
 _require_scratch
 _require_symlinks
 _supported_os Linux
 _require_scratch
 _require_symlinks
+_require_mknod
 _require_test_program "t_dir_type"
 
 rm -f $seqres.full
 _require_test_program "t_dir_type"
 
 rm -f $seqres.full
index edbf49d3ccf1871c9a8f032a59733544d44258c6..131c5d99e36fc48aaead46a29d7362405d8ce57b 100755 (executable)
@@ -30,6 +30,7 @@ _supported_os Linux
 
 _require_xfs_io_command "copy_range"
 _require_test
 
 _require_xfs_io_command "copy_range"
 _require_test
+_require_mknod
 
 testdir=$TEST_DIR/test-$seq
 rm -rf $testdir
 
 testdir=$TEST_DIR/test-$seq
 rm -rf $testdir
index aaf864a413575e2e028675df66759ee7175862c1..fc0b3b6c8ae93aadd4d2fd0a1b8cdf5f2c8310bb 100755 (executable)
@@ -33,6 +33,7 @@ _supported_fs generic
 _supported_os Linux
 _require_scratch
 _require_symlinks
 _supported_os Linux
 _require_scratch
 _require_symlinks
+_require_mknod
 _require_dm_target flakey
 
 rm -f $seqres.full
 _require_dm_target flakey
 
 rm -f $seqres.full
index 4958b3b5696ec0f167ef9c8c0638ebf1f769229f..b9b21134df7312439e55d23a17f93dd469226151 100755 (executable)
@@ -37,6 +37,9 @@ rm -f $seqres.full
 
 _require_test
 _require_loop
 
 _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
 #
 # This test effectively requires xfs_io with these commits
 #  2a42470b xfs_io: copy_file_range length is a size_t