All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] fstests: add/enhance requires tests for hardlinks & softlinks
@ 2020-04-09 19:05 Eric Sandeen
  2020-04-09 19:09 ` [PATCH 1/2] fstests: use _require_symlinks on all necessary tests Eric Sandeen
  2020-04-09 19:10 ` [PATCH 2/2] fstests: add _require_hardlinks for " Eric Sandeen
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Sandeen @ 2020-04-09 19:05 UTC (permalink / raw)
  To: fstests; +Cc: Namjae Jeon

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] fstests: use _require_symlinks on all necessary tests
  2020-04-09 19:05 [PATCH 0/2] fstests: add/enhance requires tests for hardlinks & softlinks Eric Sandeen
@ 2020-04-09 19:09 ` Eric Sandeen
  2020-04-09 20:48   ` Darrick J. Wong
                     ` (2 more replies)
  2020-04-09 19:10 ` [PATCH 2/2] fstests: add _require_hardlinks for " Eric Sandeen
  1 sibling, 3 replies; 9+ messages in thread
From: Eric Sandeen @ 2020-04-09 19:09 UTC (permalink / raw)
  To: fstests; +Cc: Namjae Jeon

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.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/common/rc b/common/rc
index 24a8f145..476d3d07 100644
--- a/common/rc
+++ b/common/rc
@@ -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
 }
diff --git a/tests/generic/005 b/tests/generic/005
index 118fca20..c49109e9 100755
--- a/tests/generic/005
+++ b/tests/generic/005
@@ -48,7 +48,7 @@ _touch()
 # real QA test starts here
 _supported_fs generic
 _require_test
-_require_test_symlinks
+_require_symlinks
 
 _supported_os Linux
 
diff --git a/tests/generic/023 b/tests/generic/023
index ea40f3d2..1cfa25cd 100755
--- a/tests/generic/023
+++ b/tests/generic/023
@@ -30,7 +30,7 @@ _supported_os Linux
 
 _require_test
 _require_renameat2
-_require_test_symlinks
+_require_symlinks
 
 # real QA test starts here
 
diff --git a/tests/generic/024 b/tests/generic/024
index 531a515f..b6ac4182 100755
--- a/tests/generic/024
+++ b/tests/generic/024
@@ -30,7 +30,7 @@ _supported_os Linux
 
 _require_test
 _require_renameat2 noreplace
-_require_test_symlinks
+_require_symlinks
 
 # real QA test starts here
 
diff --git a/tests/generic/025 b/tests/generic/025
index e69d655f..e0f71375 100755
--- a/tests/generic/025
+++ b/tests/generic/025
@@ -30,7 +30,6 @@ _supported_os Linux
 
 _require_test
 _require_renameat2 exchange
-_require_test_symlinks
 
 # real QA test starts here
 
diff --git a/tests/generic/062 b/tests/generic/062
index 3fef02e8..ba744885 100755
--- a/tests/generic/062
+++ b/tests/generic/062
@@ -59,6 +59,7 @@ _supported_os Linux
 
 _require_scratch
 _require_attrs
+_require_symlinks
 
 rm -f $tmp.backup1 $tmp.backup2 $seqres.full
 
diff --git a/tests/generic/067 b/tests/generic/067
index bd72dc85..d4c710d2 100755
--- a/tests/generic/067
+++ b/tests/generic/067
@@ -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
diff --git a/tests/generic/078 b/tests/generic/078
index a421a8ab..ccc5c8d5 100755
--- a/tests/generic/078
+++ b/tests/generic/078
@@ -30,7 +30,6 @@ _supported_os Linux
 
 _require_test
 _require_renameat2 whiteout
-_require_test_symlinks
 
 # real QA test starts here
 
diff --git a/tests/generic/109 b/tests/generic/109
index 8be70c23..549a95b1 100755
--- a/tests/generic/109
+++ b/tests/generic/109
@@ -29,6 +29,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_symlinks
 
 rm -f $seqres.full
 
diff --git a/tests/generic/294 b/tests/generic/294
index b74579ac..32c89b03 100755
--- a/tests/generic/294
+++ b/tests/generic/294
@@ -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"
diff --git a/tests/generic/306 b/tests/generic/306
index 081d1a89..046f4516 100755
--- a/tests/generic/306
+++ b/tests/generic/306
@@ -33,6 +33,7 @@ _supported_fs generic
 _supported_os Linux
 _require_scratch
 _require_test
+_require_symlinks
 
 DEVNULL=$SCRATCH_MNT/devnull
 DEVZERO=$SCRATCH_MNT/devzero
diff --git a/tests/generic/348 b/tests/generic/348
index 630ff160..e0139d9a 100755
--- a/tests/generic/348
+++ b/tests/generic/348
@@ -32,6 +32,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_symlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/360 b/tests/generic/360
index a9a4f2f9..f15548e2 100755
--- a/tests/generic/360
+++ b/tests/generic/360
@@ -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
diff --git a/tests/generic/397 b/tests/generic/397
index f2e22950..c2245bd5 100755
--- a/tests/generic/397
+++ b/tests/generic/397
@@ -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
 
diff --git a/tests/generic/399 b/tests/generic/399
index a9b3997a..a4013720 100755
--- a/tests/generic/399
+++ b/tests/generic/399
@@ -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
 
diff --git a/tests/generic/401 b/tests/generic/401
index 9d45fbcd..00e9bbe0 100755
--- a/tests/generic/401
+++ b/tests/generic/401
@@ -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
diff --git a/tests/generic/423 b/tests/generic/423
index b61d5de0..6db55fd6 100755
--- a/tests/generic/423
+++ b/tests/generic/423
@@ -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
diff --git a/tests/generic/440 b/tests/generic/440
index 1ec1ed48..3446c147 100755
--- a/tests/generic/440
+++ b/tests/generic/440
@@ -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.
diff --git a/tests/generic/479 b/tests/generic/479
index ad20aaee..aaf864a4 100755
--- a/tests/generic/479
+++ b/tests/generic/479
@@ -32,6 +32,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_symlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/556 b/tests/generic/556
index b7239e34..4899b403 100755
--- a/tests/generic/556
+++ b/tests/generic/556
@@ -19,6 +19,7 @@ _supported_os Linux
 _supported_fs generic
 _require_scratch_nocheck
 _require_scratch_casefold
+_require_symlinks
 _require_check_dmesg
 _require_attrs
 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] fstests: add _require_hardlinks for all necessary tests
  2020-04-09 19:05 [PATCH 0/2] fstests: add/enhance requires tests for hardlinks & softlinks Eric Sandeen
  2020-04-09 19:09 ` [PATCH 1/2] fstests: use _require_symlinks on all necessary tests Eric Sandeen
@ 2020-04-09 19:10 ` Eric Sandeen
  2020-04-12  7:05   ` Zorro Lang
  1 sibling, 1 reply; 9+ messages in thread
From: Eric Sandeen @ 2020-04-09 19:10 UTC (permalink / raw)
  To: fstests; +Cc: Namjae Jeon

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>
---

diff --git a/common/rc b/common/rc
index 476d3d07..8bb9aa1f 100644
--- a/common/rc
+++ b/common/rc
@@ -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
diff --git a/tests/generic/002 b/tests/generic/002
index 575ac42b..480b77bc 100755
--- a/tests/generic/002
+++ b/tests/generic/002
@@ -28,6 +28,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_test
+_require_hardlinks
 
 rm -f $seqres.full
 
diff --git a/tests/generic/039 b/tests/generic/039
index daa2e353..27cd6bf5 100755
--- a/tests/generic/039
+++ b/tests/generic/039
@@ -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
diff --git a/tests/generic/040 b/tests/generic/040
index 712ae595..b69d8127 100755
--- a/tests/generic/040
+++ b/tests/generic/040
@@ -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
diff --git a/tests/generic/041 b/tests/generic/041
index 8001e8ce..1674d544 100755
--- a/tests/generic/041
+++ b/tests/generic/041
@@ -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
diff --git a/tests/generic/056 b/tests/generic/056
index 9caf1166..28920d36 100755
--- a/tests/generic/056
+++ b/tests/generic/056
@@ -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
diff --git a/tests/generic/057 b/tests/generic/057
index ba51dbb9..91e1d98e 100755
--- a/tests/generic/057
+++ b/tests/generic/057
@@ -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
diff --git a/tests/generic/065 b/tests/generic/065
index d6a1670b..30f3c32e 100755
--- a/tests/generic/065
+++ b/tests/generic/065
@@ -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
diff --git a/tests/generic/089 b/tests/generic/089
index 3d608269..52649596 100755
--- a/tests/generic/089
+++ b/tests/generic/089
@@ -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
diff --git a/tests/generic/090 b/tests/generic/090
index bf38d1c8..db1aeef3 100755
--- a/tests/generic/090
+++ b/tests/generic/090
@@ -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
diff --git a/tests/generic/104 b/tests/generic/104
index d78689f4..4b6256db 100755
--- a/tests/generic/104
+++ b/tests/generic/104
@@ -31,6 +31,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_hardlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/106 b/tests/generic/106
index 74d5dc30..e1c859e5 100755
--- a/tests/generic/106
+++ b/tests/generic/106
@@ -30,6 +30,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_hardlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/107 b/tests/generic/107
index 5c6bbfca..214f3389 100755
--- a/tests/generic/107
+++ b/tests/generic/107
@@ -33,6 +33,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_hardlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/236 b/tests/generic/236
index f207165f..2110b053 100755
--- a/tests/generic/236
+++ b/tests/generic/236
@@ -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*
diff --git a/tests/generic/336 b/tests/generic/336
index e007552c..6832ccde 100755
--- a/tests/generic/336
+++ b/tests/generic/336
@@ -32,6 +32,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_hardlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/343 b/tests/generic/343
index e35488dd..2034197e 100755
--- a/tests/generic/343
+++ b/tests/generic/343
@@ -32,6 +32,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_hardlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/378 b/tests/generic/378
index 393d1ce7..ea776949 100755
--- a/tests/generic/378
+++ b/tests/generic/378
@@ -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
diff --git a/tests/generic/480 b/tests/generic/480
index ba2c34ad..63a87519 100755
--- a/tests/generic/480
+++ b/tests/generic/480
@@ -32,6 +32,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_hardlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/498 b/tests/generic/498
index 71f5091c..7adf0b32 100755
--- a/tests/generic/498
+++ b/tests/generic/498
@@ -31,6 +31,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_hardlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/502 b/tests/generic/502
index a60ac9a7..a49ee0b3 100755
--- a/tests/generic/502
+++ b/tests/generic/502
@@ -34,6 +34,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_hardlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/526 b/tests/generic/526
index d0b51f87..934d263f 100755
--- a/tests/generic/526
+++ b/tests/generic/526
@@ -32,6 +32,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_hardlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/527 b/tests/generic/527
index 61dd4f0b..4b664da9 100755
--- a/tests/generic/527
+++ b/tests/generic/527
@@ -32,6 +32,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_hardlinks
 _require_dm_target flakey
 
 rm -f $seqres.full


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] fstests: use _require_symlinks on all necessary tests
  2020-04-09 19:09 ` [PATCH 1/2] fstests: use _require_symlinks on all necessary tests Eric Sandeen
@ 2020-04-09 20:48   ` Darrick J. Wong
  2020-04-09 21:31     ` Eric Sandeen
  2020-04-09 22:49   ` [PATCH 1.1/2] fstests: rename _require_test_symlinks Eric Sandeen
  2020-04-09 22:50   ` [PATCH 1.2/2] fstests: use _require_symlinks on all necessary tests Eric Sandeen
  2 siblings, 1 reply; 9+ messages in thread
From: Darrick J. Wong @ 2020-04-09 20:48 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: fstests, Namjae Jeon

On Thu, Apr 09, 2020 at 02:09:04PM -0500, Eric Sandeen wrote:
> Consistently use _require_symlinks on 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...

> "_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 <sandeen@redhat.com>
> ---
> 
> diff --git a/common/rc b/common/rc
> index 24a8f145..476d3d07 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -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
>  }
> diff --git a/tests/generic/005 b/tests/generic/005
> index 118fca20..c49109e9 100755
> --- a/tests/generic/005
> +++ b/tests/generic/005
> @@ -48,7 +48,7 @@ _touch()
>  # real QA test starts here
>  _supported_fs generic
>  _require_test
> -_require_test_symlinks
> +_require_symlinks
>  
>  _supported_os Linux
>  
> diff --git a/tests/generic/023 b/tests/generic/023
> index ea40f3d2..1cfa25cd 100755
> --- a/tests/generic/023
> +++ b/tests/generic/023
> @@ -30,7 +30,7 @@ _supported_os Linux
>  
>  _require_test
>  _require_renameat2
> -_require_test_symlinks
> +_require_symlinks
>  
>  # real QA test starts here
>  
> diff --git a/tests/generic/024 b/tests/generic/024
> index 531a515f..b6ac4182 100755
> --- a/tests/generic/024
> +++ b/tests/generic/024
> @@ -30,7 +30,7 @@ _supported_os Linux
>  
>  _require_test
>  _require_renameat2 noreplace
> -_require_test_symlinks
> +_require_symlinks
>  
>  # real QA test starts here
>  
> diff --git a/tests/generic/025 b/tests/generic/025
> index e69d655f..e0f71375 100755
> --- a/tests/generic/025
> +++ b/tests/generic/025
> @@ -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

>  
>  # real QA test starts here
>  
> diff --git a/tests/generic/062 b/tests/generic/062
> index 3fef02e8..ba744885 100755
> --- a/tests/generic/062
> +++ b/tests/generic/062
> @@ -59,6 +59,7 @@ _supported_os Linux
>  
>  _require_scratch
>  _require_attrs
> +_require_symlinks
>  
>  rm -f $tmp.backup1 $tmp.backup2 $seqres.full
>  
> diff --git a/tests/generic/067 b/tests/generic/067
> index bd72dc85..d4c710d2 100755
> --- a/tests/generic/067
> +++ b/tests/generic/067
> @@ -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
> diff --git a/tests/generic/078 b/tests/generic/078
> index a421a8ab..ccc5c8d5 100755
> --- a/tests/generic/078
> +++ b/tests/generic/078
> @@ -30,7 +30,6 @@ _supported_os Linux
>  
>  _require_test
>  _require_renameat2 whiteout
> -_require_test_symlinks
>  
>  # real QA test starts here
>  
> diff --git a/tests/generic/109 b/tests/generic/109
> index 8be70c23..549a95b1 100755
> --- a/tests/generic/109
> +++ b/tests/generic/109
> @@ -29,6 +29,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_symlinks
>  
>  rm -f $seqres.full
>  
> diff --git a/tests/generic/294 b/tests/generic/294
> index b74579ac..32c89b03 100755
> --- a/tests/generic/294
> +++ b/tests/generic/294
> @@ -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"
> diff --git a/tests/generic/306 b/tests/generic/306
> index 081d1a89..046f4516 100755
> --- a/tests/generic/306
> +++ b/tests/generic/306
> @@ -33,6 +33,7 @@ _supported_fs generic
>  _supported_os Linux
>  _require_scratch
>  _require_test
> +_require_symlinks
>  
>  DEVNULL=$SCRATCH_MNT/devnull
>  DEVZERO=$SCRATCH_MNT/devzero
> diff --git a/tests/generic/348 b/tests/generic/348
> index 630ff160..e0139d9a 100755
> --- a/tests/generic/348
> +++ b/tests/generic/348
> @@ -32,6 +32,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_symlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> diff --git a/tests/generic/360 b/tests/generic/360
> index a9a4f2f9..f15548e2 100755
> --- a/tests/generic/360
> +++ b/tests/generic/360
> @@ -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
> diff --git a/tests/generic/397 b/tests/generic/397
> index f2e22950..c2245bd5 100755
> --- a/tests/generic/397
> +++ b/tests/generic/397
> @@ -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
>  
> diff --git a/tests/generic/399 b/tests/generic/399
> index a9b3997a..a4013720 100755
> --- a/tests/generic/399
> +++ b/tests/generic/399
> @@ -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
>  
> diff --git a/tests/generic/401 b/tests/generic/401
> index 9d45fbcd..00e9bbe0 100755
> --- a/tests/generic/401
> +++ b/tests/generic/401
> @@ -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
> diff --git a/tests/generic/423 b/tests/generic/423
> index b61d5de0..6db55fd6 100755
> --- a/tests/generic/423
> +++ b/tests/generic/423
> @@ -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
> diff --git a/tests/generic/440 b/tests/generic/440
> index 1ec1ed48..3446c147 100755
> --- a/tests/generic/440
> +++ b/tests/generic/440
> @@ -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.
> diff --git a/tests/generic/479 b/tests/generic/479
> index ad20aaee..aaf864a4 100755
> --- a/tests/generic/479
> +++ b/tests/generic/479
> @@ -32,6 +32,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_symlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> diff --git a/tests/generic/556 b/tests/generic/556
> index b7239e34..4899b403 100755
> --- a/tests/generic/556
> +++ b/tests/generic/556
> @@ -19,6 +19,7 @@ _supported_os Linux
>  _supported_fs generic
>  _require_scratch_nocheck
>  _require_scratch_casefold
> +_require_symlinks
>  _require_check_dmesg
>  _require_attrs
>  
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] fstests: use _require_symlinks on all necessary tests
  2020-04-09 20:48   ` Darrick J. Wong
@ 2020-04-09 21:31     ` Eric Sandeen
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Sandeen @ 2020-04-09 21:31 UTC (permalink / raw)
  To: Darrick J. Wong, Eric Sandeen; +Cc: fstests, Namjae Jeon

On 4/9/20 3:48 PM, Darrick J. Wong wrote:
> On Thu, Apr 09, 2020 at 02:09:04PM -0500, Eric Sandeen wrote:
>> Consistently use _require_symlinks on 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...

meh, purely cosmetic but *shrug*

>> "_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 <sandeen@redhat.com>
>> ---


>> diff --git a/tests/generic/025 b/tests/generic/025
>> index e69d655f..e0f71375 100755
>> --- a/tests/generic/025
>> +++ b/tests/generic/025
>> @@ -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.

whoops.

well, yeah, the test doesn't use symlinks but that wasn't supposed to be here. :P

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1.1/2] fstests: rename _require_test_symlinks
  2020-04-09 19:09 ` [PATCH 1/2] fstests: use _require_symlinks on all necessary tests Eric Sandeen
  2020-04-09 20:48   ` Darrick J. Wong
@ 2020-04-09 22:49   ` Eric Sandeen
  2020-04-09 22:50   ` [PATCH 1.2/2] fstests: use _require_symlinks on all necessary tests Eric Sandeen
  2 siblings, 0 replies; 9+ messages in thread
From: Eric Sandeen @ 2020-04-09 22:49 UTC (permalink / raw)
  To: fstests; +Cc: Namjae Jeon

Generally 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.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/common/rc b/common/rc
index 24a8f145..31361d0e 100644
--- a/common/rc
+++ b/common/rc
@@ -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`
diff --git a/tests/generic/005 b/tests/generic/005
index 118fca20..c49109e9 100755
--- a/tests/generic/005
+++ b/tests/generic/005
@@ -48,7 +48,7 @@ _touch()
 # real QA test starts here
 _supported_fs generic
 _require_test
-_require_test_symlinks
+_require_symlinks
 
 _supported_os Linux
 
diff --git a/tests/generic/023 b/tests/generic/023
index ea40f3d2..1cfa25cd 100755
--- a/tests/generic/023
+++ b/tests/generic/023
@@ -30,7 +30,7 @@ _supported_os Linux
 
 _require_test
 _require_renameat2
-_require_test_symlinks
+_require_symlinks
 
 # real QA test starts here
 
diff --git a/tests/generic/024 b/tests/generic/024
index 531a515f..b6ac4182 100755
--- a/tests/generic/024
+++ b/tests/generic/024
@@ -30,7 +30,7 @@ _supported_os Linux
 
 _require_test
 _require_renameat2 noreplace
-_require_test_symlinks
+_require_symlinks
 
 # real QA test starts here
 
diff --git a/tests/generic/025 b/tests/generic/025
index e69d655f..2eb3e5e8 100755
--- a/tests/generic/025
+++ b/tests/generic/025
@@ -30,7 +30,7 @@ _supported_os Linux
 
 _require_test
 _require_renameat2 exchange
-_require_test_symlinks
+_require_symlinks
 
 # real QA test starts here
 
diff --git a/tests/generic/067 b/tests/generic/067
index bd72dc85..d4c710d2 100755
--- a/tests/generic/067
+++ b/tests/generic/067
@@ -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
diff --git a/tests/generic/078 b/tests/generic/078
index a421a8ab..ce0201c9 100755
--- a/tests/generic/078
+++ b/tests/generic/078
@@ -30,7 +30,7 @@ _supported_os Linux
 
 _require_test
 _require_renameat2 whiteout
-_require_test_symlinks
+_require_symlinks
 
 # real QA test starts here
 



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 1.2/2] fstests: use _require_symlinks on all necessary tests
  2020-04-09 19:09 ` [PATCH 1/2] fstests: use _require_symlinks on all necessary tests Eric Sandeen
  2020-04-09 20:48   ` Darrick J. Wong
  2020-04-09 22:49   ` [PATCH 1.1/2] fstests: rename _require_test_symlinks Eric Sandeen
@ 2020-04-09 22:50   ` Eric Sandeen
  2 siblings, 0 replies; 9+ messages in thread
From: Eric Sandeen @ 2020-04-09 22:50 UTC (permalink / raw)
  To: fstests; +Cc: Namjae Jeon

Consistently use _require_symlinks on all generic tests which
create a symlink when they run.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/tests/generic/062 b/tests/generic/062
index 3fef02e8..ba744885 100755
--- a/tests/generic/062
+++ b/tests/generic/062
@@ -59,6 +59,7 @@ _supported_os Linux
 
 _require_scratch
 _require_attrs
+_require_symlinks
 
 rm -f $tmp.backup1 $tmp.backup2 $seqres.full
 
diff --git a/tests/generic/109 b/tests/generic/109
index 8be70c23..549a95b1 100755
--- a/tests/generic/109
+++ b/tests/generic/109
@@ -29,6 +29,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_symlinks
 
 rm -f $seqres.full
 
diff --git a/tests/generic/294 b/tests/generic/294
index b74579ac..32c89b03 100755
--- a/tests/generic/294
+++ b/tests/generic/294
@@ -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"
diff --git a/tests/generic/306 b/tests/generic/306
index 081d1a89..046f4516 100755
--- a/tests/generic/306
+++ b/tests/generic/306
@@ -33,6 +33,7 @@ _supported_fs generic
 _supported_os Linux
 _require_scratch
 _require_test
+_require_symlinks
 
 DEVNULL=$SCRATCH_MNT/devnull
 DEVZERO=$SCRATCH_MNT/devzero
diff --git a/tests/generic/348 b/tests/generic/348
index 630ff160..e0139d9a 100755
--- a/tests/generic/348
+++ b/tests/generic/348
@@ -32,6 +32,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_symlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/360 b/tests/generic/360
index a9a4f2f9..f15548e2 100755
--- a/tests/generic/360
+++ b/tests/generic/360
@@ -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
diff --git a/tests/generic/397 b/tests/generic/397
index f2e22950..c2245bd5 100755
--- a/tests/generic/397
+++ b/tests/generic/397
@@ -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
 
diff --git a/tests/generic/399 b/tests/generic/399
index a9b3997a..a4013720 100755
--- a/tests/generic/399
+++ b/tests/generic/399
@@ -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
 
diff --git a/tests/generic/401 b/tests/generic/401
index 9d45fbcd..00e9bbe0 100755
--- a/tests/generic/401
+++ b/tests/generic/401
@@ -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
diff --git a/tests/generic/423 b/tests/generic/423
index b61d5de0..6db55fd6 100755
--- a/tests/generic/423
+++ b/tests/generic/423
@@ -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
diff --git a/tests/generic/440 b/tests/generic/440
index 1ec1ed48..3446c147 100755
--- a/tests/generic/440
+++ b/tests/generic/440
@@ -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.
diff --git a/tests/generic/479 b/tests/generic/479
index ad20aaee..aaf864a4 100755
--- a/tests/generic/479
+++ b/tests/generic/479
@@ -32,6 +32,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_symlinks
 _require_dm_target flakey
 
 rm -f $seqres.full
diff --git a/tests/generic/556 b/tests/generic/556
index b7239e34..4899b403 100755
--- a/tests/generic/556
+++ b/tests/generic/556
@@ -19,6 +19,7 @@ _supported_os Linux
 _supported_fs generic
 _require_scratch_nocheck
 _require_scratch_casefold
+_require_symlinks
 _require_check_dmesg
 _require_attrs
 



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] fstests: add _require_hardlinks for all necessary tests
  2020-04-09 19:10 ` [PATCH 2/2] fstests: add _require_hardlinks for " Eric Sandeen
@ 2020-04-12  7:05   ` Zorro Lang
       [not found]     ` <62208b4b-ef01-5f08-b09d-4cb77fc82c9a@sandeen.net>
  0 siblings, 1 reply; 9+ messages in thread
From: Zorro Lang @ 2020-04-12  7:05 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: fstests, Namjae Jeon

On Thu, Apr 09, 2020 at 02:10:36PM -0500, Eric Sandeen wrote:
> 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>
> ---
> 
> diff --git a/common/rc b/common/rc
> index 476d3d07..8bb9aa1f 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -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

> +	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
> diff --git a/tests/generic/002 b/tests/generic/002
> index 575ac42b..480b77bc 100755
> --- a/tests/generic/002
> +++ b/tests/generic/002
> @@ -28,6 +28,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_test
> +_require_hardlinks
>  
>  rm -f $seqres.full
>  
> diff --git a/tests/generic/039 b/tests/generic/039
> index daa2e353..27cd6bf5 100755
> --- a/tests/generic/039
> +++ b/tests/generic/039
> @@ -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
> diff --git a/tests/generic/040 b/tests/generic/040
> index 712ae595..b69d8127 100755
> --- a/tests/generic/040
> +++ b/tests/generic/040
> @@ -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
> diff --git a/tests/generic/041 b/tests/generic/041
> index 8001e8ce..1674d544 100755
> --- a/tests/generic/041
> +++ b/tests/generic/041
> @@ -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
> diff --git a/tests/generic/056 b/tests/generic/056
> index 9caf1166..28920d36 100755
> --- a/tests/generic/056
> +++ b/tests/generic/056
> @@ -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
> diff --git a/tests/generic/057 b/tests/generic/057
> index ba51dbb9..91e1d98e 100755
> --- a/tests/generic/057
> +++ b/tests/generic/057
> @@ -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
> diff --git a/tests/generic/065 b/tests/generic/065
> index d6a1670b..30f3c32e 100755
> --- a/tests/generic/065
> +++ b/tests/generic/065
> @@ -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
> diff --git a/tests/generic/089 b/tests/generic/089
> index 3d608269..52649596 100755
> --- a/tests/generic/089
> +++ b/tests/generic/089
> @@ -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
> diff --git a/tests/generic/090 b/tests/generic/090
> index bf38d1c8..db1aeef3 100755
> --- a/tests/generic/090
> +++ b/tests/generic/090
> @@ -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
> diff --git a/tests/generic/104 b/tests/generic/104
> index d78689f4..4b6256db 100755
> --- a/tests/generic/104
> +++ b/tests/generic/104
> @@ -31,6 +31,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_hardlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> diff --git a/tests/generic/106 b/tests/generic/106
> index 74d5dc30..e1c859e5 100755
> --- a/tests/generic/106
> +++ b/tests/generic/106
> @@ -30,6 +30,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_hardlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> diff --git a/tests/generic/107 b/tests/generic/107
> index 5c6bbfca..214f3389 100755
> --- a/tests/generic/107
> +++ b/tests/generic/107
> @@ -33,6 +33,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_hardlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> diff --git a/tests/generic/236 b/tests/generic/236
> index f207165f..2110b053 100755
> --- a/tests/generic/236
> +++ b/tests/generic/236
> @@ -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*
> diff --git a/tests/generic/336 b/tests/generic/336
> index e007552c..6832ccde 100755
> --- a/tests/generic/336
> +++ b/tests/generic/336
> @@ -32,6 +32,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_hardlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> diff --git a/tests/generic/343 b/tests/generic/343
> index e35488dd..2034197e 100755
> --- a/tests/generic/343
> +++ b/tests/generic/343
> @@ -32,6 +32,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_hardlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> diff --git a/tests/generic/378 b/tests/generic/378
> index 393d1ce7..ea776949 100755
> --- a/tests/generic/378
> +++ b/tests/generic/378
> @@ -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
> diff --git a/tests/generic/480 b/tests/generic/480
> index ba2c34ad..63a87519 100755
> --- a/tests/generic/480
> +++ b/tests/generic/480
> @@ -32,6 +32,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_hardlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> diff --git a/tests/generic/498 b/tests/generic/498
> index 71f5091c..7adf0b32 100755
> --- a/tests/generic/498
> +++ b/tests/generic/498
> @@ -31,6 +31,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_hardlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> diff --git a/tests/generic/502 b/tests/generic/502
> index a60ac9a7..a49ee0b3 100755
> --- a/tests/generic/502
> +++ b/tests/generic/502
> @@ -34,6 +34,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_hardlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> diff --git a/tests/generic/526 b/tests/generic/526
> index d0b51f87..934d263f 100755
> --- a/tests/generic/526
> +++ b/tests/generic/526
> @@ -32,6 +32,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_hardlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> diff --git a/tests/generic/527 b/tests/generic/527
> index 61dd4f0b..4b664da9 100755
> --- a/tests/generic/527
> +++ b/tests/generic/527
> @@ -32,6 +32,7 @@ _cleanup()
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_hardlinks
>  _require_dm_target flakey
>  
>  rm -f $seqres.full
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] fstests: add _require_hardlinks for all necessary tests
       [not found]     ` <62208b4b-ef01-5f08-b09d-4cb77fc82c9a@sandeen.net>
@ 2020-04-13 14:53       ` Zorro Lang
  0 siblings, 0 replies; 9+ messages in thread
From: Zorro Lang @ 2020-04-13 14:53 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: fstests

On Mon, Apr 13, 2020 at 08:33:29AM -0500, Eric Sandeen wrote:
> On 4/12/20 2:05 AM, Zorro Lang wrote:
> > On Thu, Apr 09, 2020 at 02:10:36PM -0500, Eric Sandeen wrote:
> >> 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>
> >> ---
> >>
> >> diff --git a/common/rc b/common/rc
> >> index 476d3d07..8bb9aa1f 100644
> >> --- a/common/rc
> >> +++ b/common/rc
> >> @@ -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.
> 
> Sigh, no I'm wrong.  I just copied _require_symlinks without 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

> 
> $ 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.zjKtdM7Y0r
> 
> Thanks for catching this, and sorry for making such a mess of this series.
> 
> -Eric
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-04-13 14:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 19:05 [PATCH 0/2] fstests: add/enhance requires tests for hardlinks & softlinks Eric Sandeen
2020-04-09 19:09 ` [PATCH 1/2] fstests: use _require_symlinks on all necessary tests Eric Sandeen
2020-04-09 20:48   ` Darrick J. Wong
2020-04-09 21:31     ` Eric Sandeen
2020-04-09 22:49   ` [PATCH 1.1/2] fstests: rename _require_test_symlinks Eric Sandeen
2020-04-09 22:50   ` [PATCH 1.2/2] fstests: use _require_symlinks on all necessary tests Eric Sandeen
2020-04-09 19:10 ` [PATCH 2/2] fstests: add _require_hardlinks for " Eric Sandeen
2020-04-12  7:05   ` Zorro Lang
     [not found]     ` <62208b4b-ef01-5f08-b09d-4cb77fc82c9a@sandeen.net>
2020-04-13 14:53       ` Zorro Lang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.