fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Fix some tests that fail for exfat FS
@ 2021-03-26 15:41 Pavel Reichl
  2021-03-26 15:41 ` [PATCH 1/5] common: Add _require_{chown,chmod}() Pavel Reichl
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Pavel Reichl @ 2021-03-26 15:41 UTC (permalink / raw)
  To: fstests; +Cc: zlang, xzhou

Mostly just do not run test that require posix permissions and ownership.




Pavel Reichl (5):
  common: Add _require_{chown,chmod}()
  g/87,88,125,126,128,193,314,317,355: Add _require_chown/chmod
  common: hide permision warning from mkswap for exfat
  generic/554: hide permision warning on exfat
  generic/003: Amend the test for exfat

 common/rc         | 26 +++++++++++++++++++++++++-
 tests/generic/003 | 29 ++++++++++++++++++++---------
 tests/generic/087 |  1 +
 tests/generic/088 |  1 +
 tests/generic/125 |  1 +
 tests/generic/126 |  1 +
 tests/generic/128 |  1 +
 tests/generic/193 |  1 +
 tests/generic/314 |  1 +
 tests/generic/317 |  1 +
 tests/generic/355 |  1 +
 tests/generic/554 | 10 +++++++++-
 12 files changed, 63 insertions(+), 11 deletions(-)

-- 
2.30.2


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

* [PATCH 1/5] common: Add _require_{chown,chmod}()
  2021-03-26 15:41 [PATCH 0/5] Fix some tests that fail for exfat FS Pavel Reichl
@ 2021-03-26 15:41 ` Pavel Reichl
  2021-03-28 15:38   ` Eryu Guan
  2021-03-26 15:41 ` [PATCH 2/5] g/87,88,125,126,128,193,314,317,355: Add _require_chown/chmod Pavel Reichl
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Pavel Reichl @ 2021-03-26 15:41 UTC (permalink / raw)
  To: fstests; +Cc: zlang, xzhou

Add helper function that ensures that test is only executed on file
systems that implement chown and chmod.

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 common/rc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/common/rc b/common/rc
index 0ce3cb0d..b18d37fd 100644
--- a/common/rc
+++ b/common/rc
@@ -2129,6 +2129,24 @@ _require_user()
     [ "$?" == "0" ] || _notrun "$qa_user cannot execute commands."
 }
 
+# check for a chown support
+#
+_require_chown()
+{
+	if [ "$FSTYP" = "exfat" ]; then
+		_notrun "chown is not supported on $FSTYP"
+	fi
+}
+
+# check for a chmod support
+#
+_require_chmod()
+{
+	if [ "$FSTYP" = "exfat" ]; then
+		_notrun "chmod is not supported on $FSTYP"
+	fi
+}
+
 # check for a group on the machine, fsgqa as default
 #
 _require_group()
-- 
2.30.2


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

* [PATCH 2/5] g/87,88,125,126,128,193,314,317,355: Add _require_chown/chmod
  2021-03-26 15:41 [PATCH 0/5] Fix some tests that fail for exfat FS Pavel Reichl
  2021-03-26 15:41 ` [PATCH 1/5] common: Add _require_{chown,chmod}() Pavel Reichl
@ 2021-03-26 15:41 ` Pavel Reichl
  2021-03-28 12:11   ` Zorro Lang
  2021-03-26 15:41 ` [PATCH 3/5] common: hide permision warning from mkswap for exfat Pavel Reichl
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Pavel Reichl @ 2021-03-26 15:41 UTC (permalink / raw)
  To: fstests; +Cc: zlang, xzhou

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 tests/generic/087 | 1 +
 tests/generic/088 | 1 +
 tests/generic/125 | 1 +
 tests/generic/126 | 1 +
 tests/generic/128 | 1 +
 tests/generic/193 | 1 +
 tests/generic/314 | 1 +
 tests/generic/317 | 1 +
 tests/generic/355 | 1 +
 9 files changed, 9 insertions(+)

diff --git a/tests/generic/087 b/tests/generic/087
index 1f30dbf4..c3576117 100755
--- a/tests/generic/087
+++ b/tests/generic/087
@@ -37,6 +37,7 @@ _cleanup()
 # real QA test starts here
 _supported_fs generic
 _require_test
+_require_chown
 
 QA_FS_PERMS=$here/src/fs_perms
 
diff --git a/tests/generic/088 b/tests/generic/088
index 9388a083..ad99bd7e 100755
--- a/tests/generic/088
+++ b/tests/generic/088
@@ -29,6 +29,7 @@ _filter()
 # real QA test starts here
 _supported_fs generic
 _require_test
+_require_chown
 
 path=$TEST_DIR/t_access
 $here/src/t_access_root $path | tee $seqres.full | _filter
diff --git a/tests/generic/125 b/tests/generic/125
index e84248d3..8c8f5cd7 100755
--- a/tests/generic/125
+++ b/tests/generic/125
@@ -25,6 +25,7 @@ _supported_fs generic
 _require_test
 _require_user
 _require_odirect
+_require_chmod
 
 TESTDIR=$TEST_DIR/ftrunc
 TESTFILE=$TESTDIR/ftrunc.tmp
diff --git a/tests/generic/126 b/tests/generic/126
index ac25d294..636ca00d 100755
--- a/tests/generic/126
+++ b/tests/generic/126
@@ -27,6 +27,7 @@ _cleanup()
 # real QA test starts here
 _supported_fs generic
 _require_test
+_require_chown
 
 QA_FS_PERMS=$here/src/fs_perms
 
diff --git a/tests/generic/128 b/tests/generic/128
index b3e49eff..c1eae77a 100755
--- a/tests/generic/128
+++ b/tests/generic/128
@@ -24,6 +24,7 @@ _supported_fs generic
 
 _require_scratch
 _require_user
+_require_chmod
 
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount "-o nosuid"
diff --git a/tests/generic/193 b/tests/generic/193
index 3125efdd..fd0ebbf6 100755
--- a/tests/generic/193
+++ b/tests/generic/193
@@ -56,6 +56,7 @@ _supported_fs generic
 
 _require_test
 _require_user
+_require_chown
 
 test_root=$TEST_DIR/$seq.$$.root
 test_user=$TEST_DIR/$seq.$$.user
diff --git a/tests/generic/314 b/tests/generic/314
index 03df81ce..540f0feb 100755
--- a/tests/generic/314
+++ b/tests/generic/314
@@ -29,6 +29,7 @@ _cleanup()
 _supported_fs generic
 _require_test
 _require_user
+_require_chown
 
 rm -rf $TEST_DIR/$seq-dir
 
diff --git a/tests/generic/317 b/tests/generic/317
index 29c37a57..289dfabe 100755
--- a/tests/generic/317
+++ b/tests/generic/317
@@ -45,6 +45,7 @@ _require_scratch
 _require_user
 _require_ugid_map
 _require_userns
+_require_chown
 qa_user_id=`id -u $qa_user`
 
 _filter_output()
diff --git a/tests/generic/355 b/tests/generic/355
index 161dd042..74fba0f9 100755
--- a/tests/generic/355
+++ b/tests/generic/355
@@ -32,6 +32,7 @@ _supported_fs generic
 _require_test
 _require_user
 _require_odirect
+_require_chown
 
 testfile=$TEST_DIR/$seq.test
 rm -f $testfile
-- 
2.30.2


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

* [PATCH 3/5] common: hide permision warning from mkswap for exfat
  2021-03-26 15:41 [PATCH 0/5] Fix some tests that fail for exfat FS Pavel Reichl
  2021-03-26 15:41 ` [PATCH 1/5] common: Add _require_{chown,chmod}() Pavel Reichl
  2021-03-26 15:41 ` [PATCH 2/5] g/87,88,125,126,128,193,314,317,355: Add _require_chown/chmod Pavel Reichl
@ 2021-03-26 15:41 ` Pavel Reichl
  2021-03-26 15:41 ` [PATCH 4/5] generic/554: hide permision warning on exfat Pavel Reichl
  2021-03-26 15:41 ` [PATCH 5/5] generic/003: Amend the test for exfat Pavel Reichl
  4 siblings, 0 replies; 11+ messages in thread
From: Pavel Reichl @ 2021-03-26 15:41 UTC (permalink / raw)
  To: fstests; +Cc: zlang, xzhou

exfat does not support posix file permisions, so warning from mkswap is
inavitable. This patch hides the warning message so the test won't fail.

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 common/rc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/common/rc b/common/rc
index b18d37fd..9977b264 100644
--- a/common/rc
+++ b/common/rc
@@ -2383,7 +2383,13 @@ _format_swapfile() {
 	# Swap files must be nocow on Btrfs.
 	$CHATTR_PROG +C "$fname" > /dev/null 2>&1
 	_pwrite_byte 0x61 0 "$sz" "$fname" >> $seqres.full
-	$MKSWAP_PROG "$fname" >> $seqres.full
+	if [ "$FSTYP" = "exfat" ]; then
+		# exfat does not support posix file permisions, so warning is
+		# to be expected
+		$MKSWAP_PROG "$fname" 2>&1 | grep -v 'insecure permission' >> $seqres.full
+	else
+		$MKSWAP_PROG "$fname" >> $seqres.full
+	fi
 }
 
 # Check that the filesystem supports swapfiles
-- 
2.30.2


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

* [PATCH 4/5] generic/554: hide permision warning on exfat
  2021-03-26 15:41 [PATCH 0/5] Fix some tests that fail for exfat FS Pavel Reichl
                   ` (2 preceding siblings ...)
  2021-03-26 15:41 ` [PATCH 3/5] common: hide permision warning from mkswap for exfat Pavel Reichl
@ 2021-03-26 15:41 ` Pavel Reichl
  2021-03-28 13:06   ` Zorro Lang
  2021-03-28 15:40   ` Eryu Guan
  2021-03-26 15:41 ` [PATCH 5/5] generic/003: Amend the test for exfat Pavel Reichl
  4 siblings, 2 replies; 11+ messages in thread
From: Pavel Reichl @ 2021-03-26 15:41 UTC (permalink / raw)
  To: fstests; +Cc: zlang, xzhou

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 tests/generic/554 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/generic/554 b/tests/generic/554
index fa4f97d2..365628e2 100755
--- a/tests/generic/554
+++ b/tests/generic/554
@@ -46,7 +46,15 @@ $XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $SCRATCH_MNT/file >> $seqres.full 2>&
 
 echo swap files return ETXTBUSY
 _format_swapfile $SCRATCH_MNT/swapfile 16m
-swapon $SCRATCH_MNT/swapfile
+if [ "$FSTYP" = "exfat" ]; then
+	# exfat does not support posix file permisions, so warning is
+	# to be expected
+	swapon $SCRATCH_MNT/swapfile 2>&1 |\
+		grep -v 'insecure permission' >> $seqres.full
+else
+	swapon $SCRATCH_MNT/swapfile
+fi
+
 $XFS_IO_PROG -f -c "copy_range -l 32k $SCRATCH_MNT/file" $SCRATCH_MNT/swapfile
 swapoff $SCRATCH_MNT/swapfile
 
-- 
2.30.2


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

* [PATCH 5/5] generic/003: Amend the test for exfat
  2021-03-26 15:41 [PATCH 0/5] Fix some tests that fail for exfat FS Pavel Reichl
                   ` (3 preceding siblings ...)
  2021-03-26 15:41 ` [PATCH 4/5] generic/554: hide permision warning on exfat Pavel Reichl
@ 2021-03-26 15:41 ` Pavel Reichl
  4 siblings, 0 replies; 11+ messages in thread
From: Pavel Reichl @ 2021-03-26 15:41 UTC (permalink / raw)
  To: fstests; +Cc: zlang, xzhou

Update the test so it can be run even for exfat which has 2 seconds
granularity for access_time and does not have a timestamp for
metadata change.

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 tests/generic/003 | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/tests/generic/003 b/tests/generic/003
index ec4fdfc1..39596665 100755
--- a/tests/generic/003
+++ b/tests/generic/003
@@ -37,6 +37,13 @@ _require_relatime
 
 rm -f $seqres.full
 
+if [ "$FSTYP" = "exfat" ]; then
+	# exfat's timestamp for access_time has double seconds granularity
+	access_delay=2
+else
+	access_delay=1
+fi
+
 _stat() {
 	stat -c "%x;%y;%z" $1
 }
@@ -79,14 +86,14 @@ echo "aaa" > $TPATH/dir1/file1
 file1_stat_before_first_access=`_stat $TPATH/dir1/file1`
 
 # Accessing file1 the first time
-sleep 1
+sleep $access_delay
 cat $TPATH/dir1/file1 > /dev/null
 file1_stat_after_first_access=`_stat $TPATH/dir1/file1`
 _compare_stat_times YNN "$file1_stat_before_first_access" \
 	"$file1_stat_after_first_access" "after accessing file1 first time"
 
 # Accessing file1 a second time
-sleep 1
+sleep $access_delay
 cat $TPATH/dir1/file1 > /dev/null
 file1_stat_after_second_access=`_stat $TPATH/dir1/file1`
 _compare_stat_times NNN "$file1_stat_after_first_access" \
@@ -109,7 +116,7 @@ _compare_stat_times NYY "$dir2_stat_before_file_creation" \
 
 # Accessing file2
 file2_stat_before_first_access=`_stat $TPATH/dir2/file2`
-sleep 1
+sleep $access_delay
 cat $TPATH/dir2/file2 > /dev/null
 file2_stat_after_first_access=`_stat $TPATH/dir2/file2`
 _compare_stat_times YNN "$file2_stat_before_first_access" \
@@ -135,11 +142,15 @@ echo "xyz" > $TPATH/dir1/file1
 file1_stat_after_modify=`_stat $TPATH/dir1/file1`
 _compare_stat_times NYY "$file1_stat_before_modify" \
 	"$file1_stat_after_modify" "after modifying file1"
-sleep 1
-mv $TPATH/dir1/file1 $TPATH/dir1/file1_renamed
-file1_stat_after_change=`_stat $TPATH/dir1/file1_renamed`
-_compare_stat_times NNY "$file1_stat_after_modify" \
-	"$file1_stat_after_change" "after changing file1"
+
+# exfat does not support last metadata change timestamp
+if [ "$FSTYP" != "exfat" ]; then
+	sleep 1
+	mv $TPATH/dir1/file1 $TPATH/dir1/file1_renamed
+	file1_stat_after_change=`_stat $TPATH/dir1/file1_renamed`
+	_compare_stat_times NNY "$file1_stat_after_modify" \
+		"$file1_stat_after_change" "after changing file1"
+fi
 
 # Mounting with strictatime option and
 # accessing a previously created file twice
@@ -148,7 +159,7 @@ cat $TPATH/dir2/file3 > /dev/null
 file3_stat_after_second_access=`_stat $TPATH/dir2/file3`
 _compare_stat_times YNN "$file3_stat_after_first_access" \
 	"$file3_stat_after_second_access" "after accessing file3 second time"
-sleep 1
+sleep $access_delay
 cat $TPATH/dir2/file3 > /dev/null
 file3_stat_after_third_access=`_stat $TPATH/dir2/file3`
 _compare_stat_times YNN "$file3_stat_after_second_access" \
-- 
2.30.2


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

* Re: [PATCH 2/5] g/87,88,125,126,128,193,314,317,355: Add _require_chown/chmod
  2021-03-26 15:41 ` [PATCH 2/5] g/87,88,125,126,128,193,314,317,355: Add _require_chown/chmod Pavel Reichl
@ 2021-03-28 12:11   ` Zorro Lang
  0 siblings, 0 replies; 11+ messages in thread
From: Zorro Lang @ 2021-03-28 12:11 UTC (permalink / raw)
  To: Pavel Reichl; +Cc: fstests, xzhou

On Fri, Mar 26, 2021 at 04:41:31PM +0100, Pavel Reichl wrote:
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
>  tests/generic/087 | 1 +
>  tests/generic/088 | 1 +
>  tests/generic/125 | 1 +
>  tests/generic/126 | 1 +
>  tests/generic/128 | 1 +
>  tests/generic/193 | 1 +
>  tests/generic/314 | 1 +
>  tests/generic/317 | 1 +
>  tests/generic/355 | 1 +

From my testing, generic/597[1] and generic/598[2] fails on chown and chmod too.

Thanks,
Zorro

[1]
--- /dev/fd/63	2021-03-18 05:06:27.234268437 -0400
+++ generic/597.out.bad	2021-03-18 05:06:26.964267727 -0400
@@ -1,14 +1,24 @@
 QA output created by 597
+chmod: changing permissions of '/mnt/xfstests/test/597/sticky_dir': Operation not permitted
...

[2]
--- /dev/fd/63	2021-03-18 05:06:47.854322650 -0400
+++ generic/598.out.bad	2021-03-18 05:06:47.614322018 -0400
@@ -1,12 +1,21 @@
 QA output created by 598
+chmod: changing permissions of '/mnt/xfstests/test/598/sticky_dir': Operation not permitted
+chown: changing ownership of '/mnt/xfstests/test/598/sticky_dir': Operation not permitted
...


>  9 files changed, 9 insertions(+)
> 
> diff --git a/tests/generic/087 b/tests/generic/087
> index 1f30dbf4..c3576117 100755
> --- a/tests/generic/087
> +++ b/tests/generic/087
> @@ -37,6 +37,7 @@ _cleanup()
>  # real QA test starts here
>  _supported_fs generic
>  _require_test
> +_require_chown
>  
>  QA_FS_PERMS=$here/src/fs_perms
>  
> diff --git a/tests/generic/088 b/tests/generic/088
> index 9388a083..ad99bd7e 100755
> --- a/tests/generic/088
> +++ b/tests/generic/088
> @@ -29,6 +29,7 @@ _filter()
>  # real QA test starts here
>  _supported_fs generic
>  _require_test
> +_require_chown
>  
>  path=$TEST_DIR/t_access
>  $here/src/t_access_root $path | tee $seqres.full | _filter
> diff --git a/tests/generic/125 b/tests/generic/125
> index e84248d3..8c8f5cd7 100755
> --- a/tests/generic/125
> +++ b/tests/generic/125
> @@ -25,6 +25,7 @@ _supported_fs generic
>  _require_test
>  _require_user
>  _require_odirect
> +_require_chmod
>  
>  TESTDIR=$TEST_DIR/ftrunc
>  TESTFILE=$TESTDIR/ftrunc.tmp
> diff --git a/tests/generic/126 b/tests/generic/126
> index ac25d294..636ca00d 100755
> --- a/tests/generic/126
> +++ b/tests/generic/126
> @@ -27,6 +27,7 @@ _cleanup()
>  # real QA test starts here
>  _supported_fs generic
>  _require_test
> +_require_chown
>  
>  QA_FS_PERMS=$here/src/fs_perms
>  
> diff --git a/tests/generic/128 b/tests/generic/128
> index b3e49eff..c1eae77a 100755
> --- a/tests/generic/128
> +++ b/tests/generic/128
> @@ -24,6 +24,7 @@ _supported_fs generic
>  
>  _require_scratch
>  _require_user
> +_require_chmod
>  
>  _scratch_mkfs >/dev/null 2>&1
>  _scratch_mount "-o nosuid"
> diff --git a/tests/generic/193 b/tests/generic/193
> index 3125efdd..fd0ebbf6 100755
> --- a/tests/generic/193
> +++ b/tests/generic/193
> @@ -56,6 +56,7 @@ _supported_fs generic
>  
>  _require_test
>  _require_user
> +_require_chown
>  
>  test_root=$TEST_DIR/$seq.$$.root
>  test_user=$TEST_DIR/$seq.$$.user
> diff --git a/tests/generic/314 b/tests/generic/314
> index 03df81ce..540f0feb 100755
> --- a/tests/generic/314
> +++ b/tests/generic/314
> @@ -29,6 +29,7 @@ _cleanup()
>  _supported_fs generic
>  _require_test
>  _require_user
> +_require_chown
>  
>  rm -rf $TEST_DIR/$seq-dir
>  
> diff --git a/tests/generic/317 b/tests/generic/317
> index 29c37a57..289dfabe 100755
> --- a/tests/generic/317
> +++ b/tests/generic/317
> @@ -45,6 +45,7 @@ _require_scratch
>  _require_user
>  _require_ugid_map
>  _require_userns
> +_require_chown
>  qa_user_id=`id -u $qa_user`
>  
>  _filter_output()
> diff --git a/tests/generic/355 b/tests/generic/355
> index 161dd042..74fba0f9 100755
> --- a/tests/generic/355
> +++ b/tests/generic/355
> @@ -32,6 +32,7 @@ _supported_fs generic
>  _require_test
>  _require_user
>  _require_odirect
> +_require_chown
>  
>  testfile=$TEST_DIR/$seq.test
>  rm -f $testfile
> -- 
> 2.30.2
> 


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

* Re: [PATCH 4/5] generic/554: hide permision warning on exfat
  2021-03-26 15:41 ` [PATCH 4/5] generic/554: hide permision warning on exfat Pavel Reichl
@ 2021-03-28 13:06   ` Zorro Lang
  2021-03-28 13:12     ` Zorro Lang
  2021-03-28 15:40   ` Eryu Guan
  1 sibling, 1 reply; 11+ messages in thread
From: Zorro Lang @ 2021-03-28 13:06 UTC (permalink / raw)
  To: Pavel Reichl; +Cc: fstests, xzhou

On Fri, Mar 26, 2021 at 04:41:33PM +0100, Pavel Reichl wrote:
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
>  tests/generic/554 | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/generic/554 b/tests/generic/554

If you'd like to filter this warning, besides generic/554, generic/472 [1] and
generic/495 [2] have this warning too. But g/495 has more failures. I'm wondering
is that worth testing swap on exfat filesystem ...

Thanks,
Zorro

[1]
--- /dev/fd/63	2021-03-18 04:33:53.788956817 -0400
+++ generic/472.out.bad	2021-03-18 04:33:53.608956319 -0400
@@ -1,4 +1,5 @@
 QA output created by 472
+mkswap: /mnt/xfstests/scratch/swap: insecure permissions 0755, 0600 suggested.
...

[2]
--- /dev/fd/63	2021-03-18 04:53:17.762100589 -0400
+++ generic/495.out.bad	2021-03-18 04:53:17.542100020 -0400
@@ -1,5 +1,5 @@
 QA output created by 495
+mkswap: /mnt/xfstests/scratch/swap: insecure permissions 0755, 0600 suggested.
 File with holes
-swapon: Invalid argument
...

> index fa4f97d2..365628e2 100755
> --- a/tests/generic/554
> +++ b/tests/generic/554
> @@ -46,7 +46,15 @@ $XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $SCRATCH_MNT/file >> $seqres.full 2>&
>  
>  echo swap files return ETXTBUSY
>  _format_swapfile $SCRATCH_MNT/swapfile 16m
> -swapon $SCRATCH_MNT/swapfile
> +if [ "$FSTYP" = "exfat" ]; then
> +	# exfat does not support posix file permisions, so warning is
> +	# to be expected
> +	swapon $SCRATCH_MNT/swapfile 2>&1 |\
> +		grep -v 'insecure permission' >> $seqres.full
> +else
> +	swapon $SCRATCH_MNT/swapfile
> +fi
> +
>  $XFS_IO_PROG -f -c "copy_range -l 32k $SCRATCH_MNT/file" $SCRATCH_MNT/swapfile
>  swapoff $SCRATCH_MNT/swapfile
>  
> -- 
> 2.30.2
> 


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

* Re: [PATCH 4/5] generic/554: hide permision warning on exfat
  2021-03-28 13:06   ` Zorro Lang
@ 2021-03-28 13:12     ` Zorro Lang
  0 siblings, 0 replies; 11+ messages in thread
From: Zorro Lang @ 2021-03-28 13:12 UTC (permalink / raw)
  To: Pavel Reichl, fstests, xzhou

On Sun, Mar 28, 2021 at 09:06:17PM +0800, Zorro Lang wrote:
> On Fri, Mar 26, 2021 at 04:41:33PM +0100, Pavel Reichl wrote:
> > Signed-off-by: Pavel Reichl <preichl@redhat.com>
> > ---
> >  tests/generic/554 | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/generic/554 b/tests/generic/554
> 
> If you'd like to filter this warning, besides generic/554, generic/472 [1] and
> generic/495 [2] have this warning too. But g/495 has more failures. I'm wondering

Oh, sorry, I read this patch before [PATCH 3/5]. Ignore this suggestion about
g/472 and g/495.

> is that worth testing swap on exfat filesystem ...
> 
> Thanks,
> Zorro
> 
> [1]
> --- /dev/fd/63	2021-03-18 04:33:53.788956817 -0400
> +++ generic/472.out.bad	2021-03-18 04:33:53.608956319 -0400
> @@ -1,4 +1,5 @@
>  QA output created by 472
> +mkswap: /mnt/xfstests/scratch/swap: insecure permissions 0755, 0600 suggested.
> ...
> 
> [2]
> --- /dev/fd/63	2021-03-18 04:53:17.762100589 -0400
> +++ generic/495.out.bad	2021-03-18 04:53:17.542100020 -0400
> @@ -1,5 +1,5 @@
>  QA output created by 495
> +mkswap: /mnt/xfstests/scratch/swap: insecure permissions 0755, 0600 suggested.
>  File with holes
> -swapon: Invalid argument
> ...
> 
> > index fa4f97d2..365628e2 100755
> > --- a/tests/generic/554
> > +++ b/tests/generic/554
> > @@ -46,7 +46,15 @@ $XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $SCRATCH_MNT/file >> $seqres.full 2>&
> >  
> >  echo swap files return ETXTBUSY
> >  _format_swapfile $SCRATCH_MNT/swapfile 16m
> > -swapon $SCRATCH_MNT/swapfile
> > +if [ "$FSTYP" = "exfat" ]; then
> > +	# exfat does not support posix file permisions, so warning is
> > +	# to be expected
> > +	swapon $SCRATCH_MNT/swapfile 2>&1 |\
> > +		grep -v 'insecure permission' >> $seqres.full
> > +else
> > +	swapon $SCRATCH_MNT/swapfile
> > +fi
> > +
> >  $XFS_IO_PROG -f -c "copy_range -l 32k $SCRATCH_MNT/file" $SCRATCH_MNT/swapfile
> >  swapoff $SCRATCH_MNT/swapfile
> >  
> > -- 
> > 2.30.2
> > 


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

* Re: [PATCH 1/5] common: Add _require_{chown,chmod}()
  2021-03-26 15:41 ` [PATCH 1/5] common: Add _require_{chown,chmod}() Pavel Reichl
@ 2021-03-28 15:38   ` Eryu Guan
  0 siblings, 0 replies; 11+ messages in thread
From: Eryu Guan @ 2021-03-28 15:38 UTC (permalink / raw)
  To: Pavel Reichl; +Cc: fstests, zlang, xzhou

On Fri, Mar 26, 2021 at 04:41:30PM +0100, Pavel Reichl wrote:
> Add helper function that ensures that test is only executed on file
> systems that implement chown and chmod.
> 
> Signed-off-by: Pavel Reichl <preichl@redhat.com>

I think patch 1 and patch 2 could be folded into one patch, introduce
new helpers and use them in the same patch.

Thanks,
Eryu

> ---
>  common/rc | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 0ce3cb0d..b18d37fd 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2129,6 +2129,24 @@ _require_user()
>      [ "$?" == "0" ] || _notrun "$qa_user cannot execute commands."
>  }
>  
> +# check for a chown support
> +#
> +_require_chown()
> +{
> +	if [ "$FSTYP" = "exfat" ]; then
> +		_notrun "chown is not supported on $FSTYP"
> +	fi
> +}
> +
> +# check for a chmod support
> +#
> +_require_chmod()
> +{
> +	if [ "$FSTYP" = "exfat" ]; then
> +		_notrun "chmod is not supported on $FSTYP"
> +	fi
> +}
> +
>  # check for a group on the machine, fsgqa as default
>  #
>  _require_group()
> -- 
> 2.30.2

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

* Re: [PATCH 4/5] generic/554: hide permision warning on exfat
  2021-03-26 15:41 ` [PATCH 4/5] generic/554: hide permision warning on exfat Pavel Reichl
  2021-03-28 13:06   ` Zorro Lang
@ 2021-03-28 15:40   ` Eryu Guan
  1 sibling, 0 replies; 11+ messages in thread
From: Eryu Guan @ 2021-03-28 15:40 UTC (permalink / raw)
  To: Pavel Reichl; +Cc: fstests, zlang, xzhou

On Fri, Mar 26, 2021 at 04:41:33PM +0100, Pavel Reichl wrote:
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
>  tests/generic/554 | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/generic/554 b/tests/generic/554
> index fa4f97d2..365628e2 100755
> --- a/tests/generic/554
> +++ b/tests/generic/554
> @@ -46,7 +46,15 @@ $XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $SCRATCH_MNT/file >> $seqres.full 2>&
>  
>  echo swap files return ETXTBUSY
>  _format_swapfile $SCRATCH_MNT/swapfile 16m
> -swapon $SCRATCH_MNT/swapfile
> +if [ "$FSTYP" = "exfat" ]; then
> +	# exfat does not support posix file permisions, so warning is
> +	# to be expected
> +	swapon $SCRATCH_MNT/swapfile 2>&1 |\
> +		grep -v 'insecure permission' >> $seqres.full
> +else
> +	swapon $SCRATCH_MNT/swapfile
> +fi

Introduce a new helper like _format_swapfile and do the check there?

Thanks,
Eryu

> +
>  $XFS_IO_PROG -f -c "copy_range -l 32k $SCRATCH_MNT/file" $SCRATCH_MNT/swapfile
>  swapoff $SCRATCH_MNT/swapfile
>  
> -- 
> 2.30.2

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

end of thread, other threads:[~2021-03-28 15:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 15:41 [PATCH 0/5] Fix some tests that fail for exfat FS Pavel Reichl
2021-03-26 15:41 ` [PATCH 1/5] common: Add _require_{chown,chmod}() Pavel Reichl
2021-03-28 15:38   ` Eryu Guan
2021-03-26 15:41 ` [PATCH 2/5] g/87,88,125,126,128,193,314,317,355: Add _require_chown/chmod Pavel Reichl
2021-03-28 12:11   ` Zorro Lang
2021-03-26 15:41 ` [PATCH 3/5] common: hide permision warning from mkswap for exfat Pavel Reichl
2021-03-26 15:41 ` [PATCH 4/5] generic/554: hide permision warning on exfat Pavel Reichl
2021-03-28 13:06   ` Zorro Lang
2021-03-28 13:12     ` Zorro Lang
2021-03-28 15:40   ` Eryu Guan
2021-03-26 15:41 ` [PATCH 5/5] generic/003: Amend the test for exfat Pavel Reichl

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