mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fstests: add _require_hardlinks for all necessary tests
Add a new _require function for hardlinks, to test hardlink support in all tests which need it. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
@@ -3493,6 +3493,18 @@ _require_symlinks()
|
||||
rm -f $target $link
|
||||
}
|
||||
|
||||
_require_hardlinks()
|
||||
{
|
||||
local target=`mktemp -p $TEST_DIR`
|
||||
local link=`mktemp -p $TEST_DIR -u`
|
||||
ln $target $link
|
||||
if [ "$?" -ne 0 ]; then
|
||||
rm -f $target
|
||||
_notrun "No hardlink support"
|
||||
fi
|
||||
rm -f $target $link
|
||||
}
|
||||
|
||||
_require_test_fcntl_advisory_locks()
|
||||
{
|
||||
[ "$FSTYP" != "cifs" ] && return 0
|
||||
|
||||
@@ -28,6 +28,7 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_hardlinks
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -44,6 +44,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -48,6 +48,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -37,6 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -37,6 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -36,6 +36,7 @@ addentries()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_hardlinks
|
||||
|
||||
rm -f $seqres.full
|
||||
[ "X$TEST_DIR" = "X" ] && exit 1
|
||||
|
||||
@@ -36,6 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -31,6 +31,7 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -30,6 +30,7 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -33,6 +33,7 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
+1
-1
@@ -25,8 +25,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
# real QA test starts here
|
||||
_supported_fs generic
|
||||
# only Linux supports fallocate
|
||||
_supported_os Linux
|
||||
_require_hardlinks
|
||||
_require_test
|
||||
|
||||
rm -f $TEST_DIR/ouch*
|
||||
|
||||
@@ -32,6 +32,7 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -32,6 +32,7 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -39,6 +39,7 @@ _supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_user
|
||||
_require_hardlinks
|
||||
|
||||
# Setup testfile and its hardlink
|
||||
testfile=$TEST_DIR/testfile.$seq
|
||||
|
||||
@@ -32,6 +32,7 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -31,6 +31,7 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
@@ -34,6 +34,7 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_hardlinks
|
||||
_require_dm_target flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user