linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] generic: Create new outfile for 035 over NFS
@ 2019-10-18 17:33 schumaker.anna
  2019-10-18 17:33 ` [PATCH 2/2] generic: 448 shouldn't delete $BASE_TEST_FILE if it isn't set yet schumaker.anna
  0 siblings, 1 reply; 3+ messages in thread
From: schumaker.anna @ 2019-10-18 17:33 UTC (permalink / raw)
  To: fstests, linux-nfs; +Cc: Anna.Schumaker

From: Anna Schumaker <Anna.Schumaker@Netapp.com>

Rename-overwrites over NFS work with a "silly rename" over the network,
so the nlink count stays at 1 instead of dropping to 0. This is expected
behavior for NFS, so we should use a different golden output file to
account for this.

 See the NFS faq at: nfs.sourceforge.net/#faq_d2 for more information
about silly renames.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---
 .gitignore                                 | 1 +
 common/rc                                  | 2 +-
 tests/generic/035                          | 4 ++++
 tests/generic/035.cfg                      | 1 +
 tests/generic/{035.out => 035.out.default} | 0
 tests/generic/035.out.nfs                  | 5 +++++
 6 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 tests/generic/035.cfg
 rename tests/generic/{035.out => 035.out.default} (100%)
 create mode 100644 tests/generic/035.out.nfs

diff --git a/.gitignore b/.gitignore
index 02734429..6c11a401 100644
--- a/.gitignore
+++ b/.gitignore
@@ -254,6 +254,7 @@
 /dmapi/src/suite2/src/test_rights
 
 # Symlinked files
+/tests/generic/035.out
 /tests/xfs/033.out
 /tests/xfs/071.out
 /tests/xfs/096.out
diff --git a/common/rc b/common/rc
index cfaabf10..562d48d8 100644
--- a/common/rc
+++ b/common/rc
@@ -2848,7 +2848,7 @@ _link_out_file()
 	local features
 
 	if [ $# -eq 0 ]; then
-		features="$(_get_os_name)"
+		features="$(_get_os_name),$FSTYP"
 		if [ -n "$MOUNT_OPTIONS" ]; then
 			features=$features,${MOUNT_OPTIONS##"-o "}
 		fi
diff --git a/tests/generic/035 b/tests/generic/035
index 44db45e6..8da3bc99 100755
--- a/tests/generic/035
+++ b/tests/generic/035
@@ -6,6 +6,7 @@
 #
 # Check overwriting rename system call
 #
+seqfull=$0
 seq=`basename $0`
 seqres=$RESULT_DIR/$seq
 echo "QA output created by $seq"
@@ -29,6 +30,9 @@ _supported_os Linux
 
 _require_test
 
+# Select appropriate golden output based on fstype
+_link_out_file
+
 # real QA test starts here
 
 rename_dir=$TEST_DIR/$$
diff --git a/tests/generic/035.cfg b/tests/generic/035.cfg
new file mode 100644
index 00000000..d02b0ce9
--- /dev/null
+++ b/tests/generic/035.cfg
@@ -0,0 +1 @@
+nfs: nfs
diff --git a/tests/generic/035.out b/tests/generic/035.out.default
similarity index 100%
rename from tests/generic/035.out
rename to tests/generic/035.out.default
diff --git a/tests/generic/035.out.nfs b/tests/generic/035.out.nfs
new file mode 100644
index 00000000..6359197f
--- /dev/null
+++ b/tests/generic/035.out.nfs
@@ -0,0 +1,5 @@
+QA output created by 035
+overwriting regular file:
+nlink is 1, should be 0
+overwriting directory:
+t_rename_overwrite: fstat(3): Stale file handle
-- 
2.23.0


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

* [PATCH 2/2] generic: 448 shouldn't delete $BASE_TEST_FILE if it isn't set yet
  2019-10-18 17:33 [PATCH 1/2] generic: Create new outfile for 035 over NFS schumaker.anna
@ 2019-10-18 17:33 ` schumaker.anna
  2019-10-20 13:50   ` Eryu Guan
  0 siblings, 1 reply; 3+ messages in thread
From: schumaker.anna @ 2019-10-18 17:33 UTC (permalink / raw)
  To: fstests, linux-nfs; +Cc: Anna.Schumaker

From: Anna Schumaker <Anna.Schumaker@Netapp.com>

NFS v4.2 supports SEEK_DATA and SEEK_HOLE, but earlier versions do not.
As a result, the test exits and runs the cleanup function without the
$BASE_TEST_FILE variable set and the shell expands it to "rm -f .*",
deleting all hidden files in the current directory.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---
 tests/generic/448 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/generic/448 b/tests/generic/448
index dada499b..d6cdebbf 100755
--- a/tests/generic/448
+++ b/tests/generic/448
@@ -17,7 +17,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
-	rm -f $tmp.* $BASE_TEST_FILE.*
+	rm -f $tmp.*
+	[ ! -z $BASE_TEST_FILE ] && rm -f $BASE_TEST_FILE.*
 }
 
 # get standard environment, filters and checks
-- 
2.23.0


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

* Re: [PATCH 2/2] generic: 448 shouldn't delete $BASE_TEST_FILE if it isn't set yet
  2019-10-18 17:33 ` [PATCH 2/2] generic: 448 shouldn't delete $BASE_TEST_FILE if it isn't set yet schumaker.anna
@ 2019-10-20 13:50   ` Eryu Guan
  0 siblings, 0 replies; 3+ messages in thread
From: Eryu Guan @ 2019-10-20 13:50 UTC (permalink / raw)
  To: schumaker.anna; +Cc: fstests, linux-nfs, Anna.Schumaker

On Fri, Oct 18, 2019 at 01:33:43PM -0400, schumaker.anna@gmail.com wrote:
> From: Anna Schumaker <Anna.Schumaker@Netapp.com>
> 
> NFS v4.2 supports SEEK_DATA and SEEK_HOLE, but earlier versions do not.
> As a result, the test exits and runs the cleanup function without the
> $BASE_TEST_FILE variable set and the shell expands it to "rm -f .*",
> deleting all hidden files in the current directory.
> 
> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
> ---
>  tests/generic/448 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/generic/448 b/tests/generic/448
> index dada499b..d6cdebbf 100755
> --- a/tests/generic/448
> +++ b/tests/generic/448
> @@ -17,7 +17,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>  
>  _cleanup()
>  {
> -	rm -f $tmp.* $BASE_TEST_FILE.*
> +	rm -f $tmp.*
> +	[ ! -z $BASE_TEST_FILE ] && rm -f $BASE_TEST_FILE.*
>  }

I'd just define BASE_TEST_FILE before _cleanup (and did it on commit).
Thanks for the fix!

Eryu
>  
>  # get standard environment, filters and checks
> -- 
> 2.23.0
> 

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

end of thread, other threads:[~2019-10-20 13:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18 17:33 [PATCH 1/2] generic: Create new outfile for 035 over NFS schumaker.anna
2019-10-18 17:33 ` [PATCH 2/2] generic: 448 shouldn't delete $BASE_TEST_FILE if it isn't set yet schumaker.anna
2019-10-20 13:50   ` Eryu Guan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).