fstests: add/enhance requires tests for hardlinks & softlinks
cover fstests: add/enhance requires tests for hardlinks & softlinks
AFAICT exfat does not support hardlinks or softlinks, so any test which tries to link files will fail.
We have an older test for symlink capability, but it's not widely used. Fix that, and add a separate explicit _requires test for hardlinks as well.
With this ./check -g auto,quick on exfat failures are reduced to about 27 tests.
-Eric
PATCH 1/2 fstests: use _require_symlinks on all necessary tests
Consistently use _require_symlinks on all generic tests which create a symlink.
Rename an old require function, "_require_test_symlinks" to simply "_require_symlinks" because it's reasonable to assume that if the test device doesn't support it, neither does the scratch device and vice versa.
---
common/rc +2 -2
@@ -3481,14 +3481,14 @@ run_check() "$@" >> $seqres.full 2>&1 || _fail "failed: '$@'" } -_require_test_symlinks() +_require_symlinks() { local target=`mktemp -p $TEST_DIR` local link=`mktemp -p $TEST_DIR -u` ln -s `basename $target` $link if [ "$?" -ne 0 ]; then rm -f $target - _notrun "Require symlinks support" + _notrun "No symlink support" fi rm -f $target $link }
tests/generic/005 +1 -1
@@ -48,7 +48,7 @@ _touch() # real QA test starts here _supported_fs generic _require_test -_require_test_symlinks +_require_symlinks _supported_os Linux
tests/generic/023 +1 -1
@@ -30,7 +30,7 @@ _supported_os Linux _require_test _require_renameat2 -_require_test_symlinks +_require_symlinks # real QA test starts here
tests/generic/024 +1 -1
@@ -30,7 +30,7 @@ _supported_os Linux _require_test _require_renameat2 noreplace -_require_test_symlinks +_require_symlinks # real QA test starts here
tests/generic/025 +0 -1
@@ -30,7 +30,6 @@ _supported_os Linux _require_test _require_renameat2 exchange -_require_test_symlinks # real QA test starts here
tests/generic/062 +1 -0
@@ -59,6 +59,7 @@ _supported_os Linux _require_scratch _require_attrs +_require_symlinks rm -f $tmp.backup1 $tmp.backup2 $seqres.full
tests/generic/067 +1 -1
@@ -37,7 +37,7 @@ _cleanup() # Modify as appropriate. _supported_fs generic _supported_os Linux -_require_test_symlinks +_require_symlinks _require_test _require_scratch _require_loop
tests/generic/078 +0 -1
@@ -30,7 +30,6 @@ _supported_os Linux _require_test _require_renameat2 whiteout -_require_test_symlinks # real QA test starts here
tests/generic/109 +1 -0
@@ -29,6 +29,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks rm -f $seqres.full
tests/generic/294 +1 -0
@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks rm -f $seqres.full _scratch_mkfs > $seqres.full 2>&1 || _fail "Could not mkfs scratch device"
tests/generic/306 +1 -0
@@ -33,6 +33,7 @@ _supported_fs generic _supported_os Linux _require_scratch _require_test +_require_symlinks DEVNULL=$SCRATCH_MNT/devnull DEVZERO=$SCRATCH_MNT/devzero
tests/generic/348 +1 -0
@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/360 +1 -0
@@ -31,6 +31,7 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_test +_require_symlinks linkfile=$TEST_DIR/$seq.symlink rm -f $linkfile
tests/generic/397 +1 -0
@@ -36,6 +36,7 @@ rm -f $seqres.full # real QA test starts here _supported_fs generic _supported_os Linux +_require_symlinks _require_scratch_encryption _require_command "$KEYCTL_PROG" keyctl
tests/generic/399 +1 -0
@@ -43,6 +43,7 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_scratch_encryption +_require_symlinks _require_command "$XZ_PROG" xz _require_command "$KEYCTL_PROG" keyctl
tests/generic/401 +1 -0
@@ -37,6 +37,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks _require_test_program "t_dir_type" rm -f $seqres.full
tests/generic/423 +1 -0
@@ -38,6 +38,7 @@ _require_test _require_test_program "stat_test" _require_test_program "af_unix" _require_statx +_require_symlinks function check_stat () { $here/src/stat_test $* || echo stat_test failed
tests/generic/440 +1 -0
@@ -38,6 +38,7 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_scratch_encryption +_require_symlinks _require_command "$KEYCTL_PROG" keyctl # Set up an encryption-capable filesystem and an encryption key.
tests/generic/479 +1 -0
@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/556 +1 -0
@@ -19,6 +19,7 @@ _supported_os Linux _supported_fs generic _require_scratch_nocheck _require_scratch_casefold +_require_symlinks _require_check_dmesg _require_attrs
Re: [PATCH 1/2] fstests: use _require_symlinks on all necessary tests
Quoted 4 lines · Eric Sandeen
Consistently use
_require_symlinkson all generic tests which create a symlink.Rename an old require function, "
_require_test_symlinks" to simply
Wait, we're adding and renaming at the same time?
One thing per patch, please...
Quoted 72 lines
"
_require_symlinks" because it's reasonable to assume that if the test device doesn't support it, neither does the scratch device and vice versa.Signed-off-by Eric Sandeen <[email protected]>---
common/rc +2
-2@@ -3481,14 +3481,14 @@ run_check() "$@" >> $seqres.full 2>&1 || _fail "failed: '$@'" } -_require_test_symlinks() +_require_symlinks() { local target=`mktemp -p $TEST_DIR` local link=`mktemp -p $TEST_DIR -u` ln -s `basename $target` $link if [ "$?" -ne 0 ]; then rm -f $target - _notrun "Require symlinks support" + _notrun "No symlink support" fi rm -f $target $link }tests/generic/005 +1
-1@@ -48,7 +48,7 @@ _touch() # real QA test starts here _supported_fs generic _require_test -_require_test_symlinks +_require_symlinks _supported_os Linuxtests/generic/023 +1
-1@@ -30,7 +30,7 @@ _supported_os Linux _require_test _require_renameat2 -_require_test_symlinks +_require_symlinks # real QA test starts heretests/generic/024 +1
-1@@ -30,7 +30,7 @@ _supported_os Linux _require_test _require_renameat2 noreplace -_require_test_symlinks +_require_symlinks # real QA test starts heretests/generic/025 +0
-0
tests/generic/025 _supported_os Linux · line 33
Quoted 4 lines
tests/generic/025 +0
-1@@ -30,7 +30,6 @@ _supported_os Linux _require_test _require_renameat2 exchange -_require_test_symlinks
This drops _require_symlinks, in a add/renaming patch...
/me confused.
--D
Quoted 185 lines
tests/generic/025 +0
-0# real QA test starts heretests/generic/062 +1
-0@@ -59,6 +59,7 @@ _supported_os Linux _require_scratch _require_attrs +_require_symlinks rm -f $tmp.backup1 $tmp.backup2 $seqres.fulltests/generic/067 +1
-1@@ -37,7 +37,7 @@ _cleanup() # Modify as appropriate. _supported_fs generic _supported_os Linux -_require_test_symlinks +_require_symlinks _require_test _require_scratch _require_looptests/generic/078 +0
-1@@ -30,7 +30,6 @@ _supported_os Linux _require_test _require_renameat2 whiteout -_require_test_symlinks # real QA test starts heretests/generic/109 +1
-0@@ -29,6 +29,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks rm -f $seqres.fulltests/generic/294 +1
-0@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks rm -f $seqres.full _scratch_mkfs > $seqres.full 2>&1 || _fail "Could not mkfs scratch device"tests/generic/306 +1
-0@@ -33,6 +33,7 @@ _supported_fs generic _supported_os Linux _require_scratch _require_test +_require_symlinks DEVNULL=$SCRATCH_MNT/devnull DEVZERO=$SCRATCH_MNT/devzerotests/generic/348 +1
-0@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks _require_dm_target flakey rm -f $seqres.fulltests/generic/360 +1
-0@@ -31,6 +31,7 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_test +_require_symlinks linkfile=$TEST_DIR/$seq.symlink rm -f $linkfiletests/generic/397 +1
-0@@ -36,6 +36,7 @@ rm -f $seqres.full # real QA test starts here _supported_fs generic _supported_os Linux +_require_symlinks _require_scratch_encryption _require_command "$KEYCTL_PROG" keyctltests/generic/399 +1
-0@@ -43,6 +43,7 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_scratch_encryption +_require_symlinks _require_command "$XZ_PROG" xz _require_command "$KEYCTL_PROG" keyctltests/generic/401 +1
-0@@ -37,6 +37,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks _require_test_program "t_dir_type" rm -f $seqres.fulltests/generic/423 +1
-0@@ -38,6 +38,7 @@ _require_test _require_test_program "stat_test" _require_test_program "af_unix" _require_statx +_require_symlinks function check_stat () { $here/src/stat_test $* || echo stat_test failedtests/generic/440 +1
-0@@ -38,6 +38,7 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_scratch_encryption +_require_symlinks _require_command "$KEYCTL_PROG" keyctl # Set up an encryption-capable filesystem and an encryption key.tests/generic/479 +1
-0@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks _require_dm_target flakey rm -f $seqres.fulltests/generic/556 +1
-0@@ -19,6 +19,7 @@ _supported_os Linux _supported_fs generic _require_scratch_nocheck _require_scratch_casefold +_require_symlinks _require_check_dmesg _require_attrs
Re: [PATCH 1/2] fstests: use _require_symlinks on all necessary tests
Quoted 9 lines · Darrick J. Wong
Quoted 4 lines · Eric Sandeen
Consistently use
_require_symlinkson all generic tests which create a symlink.Rename an old require function, "
_require_test_symlinks" to simplyWait, we're adding and renaming at the same time?
One thing per patch, please...
meh, purely cosmetic but *shrug*
Quoted 14 lines
Quoted 14 lines
"
_require_symlinks" because it's reasonable to assume that if the test device doesn't support it, neither does the scratch device and vice versa.Signed-off-by Eric Sandeen <[email protected]>---
tests/generic/025 +0
-0@@ -30,7 +30,6 @@ _supported_os Linux
Quoted 7 lines
tests/generic/025 _supported_os Linux · line 33
Quoted 3 lines
tests/generic/025 +0
-1_require_test _require_renameat2 exchange -_require_test_symlinksThis drops
_require_symlinks, in a add/renaming patch.../me confused.
whoops.
well, yeah, the test doesn't use symlinks but that wasn't supposed to be here. :P
PATCH 1/1 fstests: rename _require_test_symlinks
In reply to Eric SandeenGenerally these tests are not restricted to one device or the other; testing the test device will suffice to determine the capability but it doesn't need to be named that way.
---
common/rc +1 -1
@@ -3481,7 +3481,7 @@ run_check() "$@" >> $seqres.full 2>&1 || _fail "failed: '$@'" } -_require_test_symlinks() +_require_symlinks() { local target=`mktemp -p $TEST_DIR` local link=`mktemp -p $TEST_DIR -u`
tests/generic/005 +1 -1
@@ -48,7 +48,7 @@ _touch() # real QA test starts here _supported_fs generic _require_test -_require_test_symlinks +_require_symlinks _supported_os Linux
tests/generic/023 +1 -1
@@ -30,7 +30,7 @@ _supported_os Linux _require_test _require_renameat2 -_require_test_symlinks +_require_symlinks # real QA test starts here
tests/generic/024 +1 -1
@@ -30,7 +30,7 @@ _supported_os Linux _require_test _require_renameat2 noreplace -_require_test_symlinks +_require_symlinks # real QA test starts here
tests/generic/025 +1 -1
@@ -30,7 +30,7 @@ _supported_os Linux _require_test _require_renameat2 exchange -_require_test_symlinks +_require_symlinks # real QA test starts here
tests/generic/067 +1 -1
@@ -37,7 +37,7 @@ _cleanup() # Modify as appropriate. _supported_fs generic _supported_os Linux -_require_test_symlinks +_require_symlinks _require_test _require_scratch _require_loop
tests/generic/078 +1 -1
@@ -30,7 +30,7 @@ _supported_os Linux _require_test _require_renameat2 whiteout -_require_test_symlinks +_require_symlinks # real QA test starts here
PATCH 1/1 fstests: use _require_symlinks on all necessary tests
In reply to Eric SandeenConsistently use _require_symlinks on all generic tests which create a symlink when they run.
---
tests/generic/062 +1 -0
@@ -59,6 +59,7 @@ _supported_os Linux _require_scratch _require_attrs +_require_symlinks rm -f $tmp.backup1 $tmp.backup2 $seqres.full
tests/generic/109 +1 -0
@@ -29,6 +29,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks rm -f $seqres.full
tests/generic/294 +1 -0
@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks rm -f $seqres.full _scratch_mkfs > $seqres.full 2>&1 || _fail "Could not mkfs scratch device"
tests/generic/306 +1 -0
@@ -33,6 +33,7 @@ _supported_fs generic _supported_os Linux _require_scratch _require_test +_require_symlinks DEVNULL=$SCRATCH_MNT/devnull DEVZERO=$SCRATCH_MNT/devzero
tests/generic/348 +1 -0
@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/360 +1 -0
@@ -31,6 +31,7 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_test +_require_symlinks linkfile=$TEST_DIR/$seq.symlink rm -f $linkfile
tests/generic/397 +1 -0
@@ -36,6 +36,7 @@ rm -f $seqres.full # real QA test starts here _supported_fs generic _supported_os Linux +_require_symlinks _require_scratch_encryption _require_command "$KEYCTL_PROG" keyctl
tests/generic/399 +1 -0
@@ -43,6 +43,7 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_scratch_encryption +_require_symlinks _require_command "$XZ_PROG" xz _require_command "$KEYCTL_PROG" keyctl
tests/generic/401 +1 -0
@@ -37,6 +37,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks _require_test_program "t_dir_type" rm -f $seqres.full
tests/generic/423 +1 -0
@@ -38,6 +38,7 @@ _require_test _require_test_program "stat_test" _require_test_program "af_unix" _require_statx +_require_symlinks function check_stat () { $here/src/stat_test $* || echo stat_test failed
tests/generic/440 +1 -0
@@ -38,6 +38,7 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_scratch_encryption +_require_symlinks _require_command "$KEYCTL_PROG" keyctl # Set up an encryption-capable filesystem and an encryption key.
tests/generic/479 +1 -0
@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_symlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/556 +1 -0
@@ -19,6 +19,7 @@ _supported_os Linux _supported_fs generic _require_scratch_nocheck _require_scratch_casefold +_require_symlinks _require_check_dmesg _require_attrs
PATCH 2/2 fstests: add _require_hardlinks for all necessary tests
In reply to Eric SandeenAdd a new _require function for hardlinks, to test hardlink support in all tests which need it.
---
common/rc +12 -0
@@ -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 `basename $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
tests/generic/002 +1 -0
@@ -28,6 +28,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_test +_require_hardlinks rm -f $seqres.full
tests/generic/039 +1 -0
@@ -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
tests/generic/040 +1 -0
@@ -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
tests/generic/041 +1 -0
@@ -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
tests/generic/056 +1 -0
@@ -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
tests/generic/057 +1 -0
@@ -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
tests/generic/065 +1 -0
@@ -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
tests/generic/089 +1 -0
@@ -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
tests/generic/090 +1 -0
@@ -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
tests/generic/104 +1 -0
@@ -31,6 +31,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/106 +1 -0
@@ -30,6 +30,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/107 +1 -0
@@ -33,6 +33,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/236 +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*
tests/generic/336 +1 -0
@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/343 +1 -0
@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/378 +1 -0
@@ -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
tests/generic/480 +1 -0
@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/498 +1 -0
@@ -31,6 +31,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/502 +1 -0
@@ -34,6 +34,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/526 +1 -0
@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full
tests/generic/527 +1 -0
@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full
Re: [PATCH 2/2] fstests: add _require_hardlinks for all necessary tests
Quoted 11 lines · Eric Sandeen
Add a new
_requirefunction for hardlinks, to test hardlink support in all tests which need it.Signed-off-by Eric Sandeen <[email protected]>---
common/rc +0
-0
common/rc _require_symlinks() · line 3500
Quoted 8 lines
common/rc +5
-0@@ -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 `basename $target` $link
I really doubt if it works. Why we need the basename of the $target? It cause we create a link in *current* directory, and the current directory isn't the $TEST_DIR.
The _require_symlinks won't fail due to symlink can be created cross filesystems, but hardlink can't. But that's not the _require_symlinks want to test, right?
So why we need the basename? Please correct me if I'm wrong.
Thanks,
Zorro
Quoted 265 lines
common/rc +7
-0+ if [ "$?" -ne 0 ]; then + rm -f $target + _notrun "No hardlink support" + fi + rm -f $target $link +} + _require_test_fcntl_advisory_locks() { [ "$FSTYP" != "cifs" ] && return 0tests/generic/002 +1
-0@@ -28,6 +28,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_test +_require_hardlinks rm -f $seqres.fulltests/generic/039 +1
-0@@ -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.fulltests/generic/040 +1
-0@@ -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.fulltests/generic/041 +1
-0@@ -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.fulltests/generic/056 +1
-0@@ -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.fulltests/generic/057 +1
-0@@ -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.fulltests/generic/065 +1
-0@@ -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.fulltests/generic/089 +1
-0@@ -36,6 +36,7 @@ addentries() _supported_fs generic _supported_os Linux _require_test +_require_hardlinks rm -f $seqres.full [ "X$TEST_DIR" = "X" ] && exit 1tests/generic/090 +1
-0@@ -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.fulltests/generic/104 +1
-0@@ -31,6 +31,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.fulltests/generic/106 +1
-0@@ -30,6 +30,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.fulltests/generic/107 +1
-0@@ -33,6 +33,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.fulltests/generic/236 +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*tests/generic/336 +1
-0@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.fulltests/generic/343 +1
-0@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.fulltests/generic/378 +1
-0@@ -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.$seqtests/generic/480 +1
-0@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.fulltests/generic/498 +1
-0@@ -31,6 +31,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.fulltests/generic/502 +1
-0@@ -34,6 +34,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.fulltests/generic/526 +1
-0@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.fulltests/generic/527 +1
-0@@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 2/2] fstests: add _require_hardlinks for all necessary tests
Quoted 31 lines · Eric Sandeen
Quoted 25 lines · Zorro Lang
Quoted 11 lines · Eric Sandeen
Add a new
_requirefunction for hardlinks, to test hardlink support in all tests which need it.Signed-off-by Eric Sandeen <[email protected]>---
common/rc +0
-0common/rc _require_symlinks() · line 3500
Quoted 8 lines
common/rc +5
-0@@ -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 `basename $target` $linkI really doubt if it works. Why we need the basename of the $target? It cause we create a link in *current* directory, and the current directory isn't the $TEST_DIR.
Quoted 4 lines
The
_require_symlinkswon't fail due to symlink can be created cross filesystems, but hardlink can't. But that's not the_require_symlinkswant to test, right?So why we need the basename? Please correct me if I'm wrong.
Quoted 7 lines
Sigh, no I'm wrong. I just copied
_require_symlinkswithout looking closely, and dropped the "-s" for a hardlink.I forgot that the argument to ln -s can be an arbitrary relative path,
"Symbolic links can hold arbitrary text; if later resolved, a relative link is interpreted in relation to its parent directory."
Wow, yes! The manual of *ln* talk about that. I even never noticed that :-P Thanks for telling me about it. So the _require_symlinks is fine, but the _require_hardlinks need to fixed.
Thanks,
Zorro
Quoted 22 lines
$ mkdir /tmp/test $ export TEST_DIR=/tmp/test $ target=`mktemp -p $TEST_DIR` $ link=`mktemp -p $TEST_DIR -u`$ echo $target /tmp/test/tmp.zjKtdM7Y0r $ echo $link /tmp/test/tmp.sdmFq6vyyl$ ln -s `basename $target` $link$ ls -l /tmp/test total 0 lrwxrwxrwx. 1 sandeen sandeen 14 Apr 13 08:27 tmp.sdmFq6vyyl -> tmp.zjKtdM7Y0r -rw-------. 1 sandeen sandeen 0 Apr 13 08:27 tmp.zjKtdM7Y0rThanks for catching this, and sorry for making such a mess of this series.
-Eric