diff mbox series

[4/5] generic/554: hide permision warning on exfat

Message ID 20210326154134.309159-5-preichl@redhat.com (mailing list archive)
State New, archived
Headers show
Series Fix some tests that fail for exfat FS | expand

Commit Message

Pavel Reichl March 26, 2021, 3:41 p.m. UTC
Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 tests/generic/554 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Zorro Lang March 28, 2021, 1:06 p.m. UTC | #1
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
>
Zorro Lang March 28, 2021, 1:12 p.m. UTC | #2
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
> >
Eryu Guan March 28, 2021, 3:40 p.m. UTC | #3
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
diff mbox series

Patch

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