generic/035: Create new outfile for NFS
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Fri, 18 Oct 2019 17:33:42 +0000 (13:33 -0400)
committerEryu Guan <guaneryu@gmail.com>
Sun, 20 Oct 2019 11:14:21 +0000 (19:14 +0800)
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>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
.gitignore
common/rc
tests/generic/035
tests/generic/035.cfg [new file with mode: 0644]
tests/generic/035.out [deleted file]
tests/generic/035.out.default [new file with mode: 0644]
tests/generic/035.out.nfs [new file with mode: 0644]

index 0273442..6c11a40 100644 (file)
 /dmapi/src/suite2/src/test_rights
 
 # Symlinked files
+/tests/generic/035.out
 /tests/xfs/033.out
 /tests/xfs/071.out
 /tests/xfs/096.out
index 3d5c8b2..a29bd78 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2860,7 +2860,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
index 44db45e..8da3bc9 100755 (executable)
@@ -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 (file)
index 0000000..d02b0ce
--- /dev/null
@@ -0,0 +1 @@
+nfs: nfs
diff --git a/tests/generic/035.out b/tests/generic/035.out
deleted file mode 100644 (file)
index 4f68cc1..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-QA output created by 035
-overwriting regular file:
-overwriting directory:
diff --git a/tests/generic/035.out.default b/tests/generic/035.out.default
new file mode 100644 (file)
index 0000000..4f68cc1
--- /dev/null
@@ -0,0 +1,3 @@
+QA output created by 035
+overwriting regular file:
+overwriting directory:
diff --git a/tests/generic/035.out.nfs b/tests/generic/035.out.nfs
new file mode 100644 (file)
index 0000000..6359197
--- /dev/null
@@ -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