diff mbox series

[4/5] fstests: add _require_mknod

Message ID 5c99e460-11bf-ade8-c2bd-afaccabf4b9f@redhat.com (mailing list archive)
State New, archived
Headers show
Series fstests: recent series rollup / misc tests & fixes | expand

Commit Message

Eric Sandeen May 18, 2020, 4:16 p.m. UTC
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>
---
 common/rc         | 7 +++++++
 tests/generic/062 | 1 +
 tests/generic/184 | 1 +
 tests/generic/306 | 1 +
 tests/generic/401 | 1 +
 tests/generic/434 | 1 +
 tests/generic/479 | 1 +
 tests/generic/564 | 3 +++
 8 files changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index 62952036..310fdc46 100644
--- 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
 
 ################################################################################
diff --git a/tests/generic/062 b/tests/generic/062
index ba744885..d2a0ac9a 100755
--- a/tests/generic/062
+++ b/tests/generic/062
@@ -60,6 +60,7 @@  _supported_os Linux
 _require_scratch
 _require_attrs
 _require_symlinks
+_require_mknod
 
 rm -f $tmp.backup1 $tmp.backup2 $seqres.full
 
diff --git a/tests/generic/184 b/tests/generic/184
index 8aca1a0d..94f4d0e1 100755
--- a/tests/generic/184
+++ b/tests/generic/184
@@ -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
diff --git a/tests/generic/306 b/tests/generic/306
index 046f4516..6f16a5f5 100755
--- a/tests/generic/306
+++ b/tests/generic/306
@@ -34,6 +34,7 @@  _supported_os Linux
 _require_scratch
 _require_test
 _require_symlinks
+_require_mknod
 
 DEVNULL=$SCRATCH_MNT/devnull
 DEVZERO=$SCRATCH_MNT/devzero
diff --git a/tests/generic/401 b/tests/generic/401
index 00e9bbe0..f8b1fd21 100755
--- a/tests/generic/401
+++ b/tests/generic/401
@@ -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
diff --git a/tests/generic/434 b/tests/generic/434
index edbf49d3..131c5d99 100755
--- a/tests/generic/434
+++ b/tests/generic/434
@@ -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
diff --git a/tests/generic/479 b/tests/generic/479
index aaf864a4..fc0b3b6c 100755
--- a/tests/generic/479
+++ b/tests/generic/479
@@ -33,6 +33,7 @@  _supported_fs generic
 _supported_os Linux
 _require_scratch
 _require_symlinks
+_require_mknod
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/564 b/tests/generic/564
index 4958b3b5..b9b21134 100755
--- a/tests/generic/564
+++ b/tests/generic/564
@@ -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