* [PATCH] overlay/026: Fix test expectation for newer kernels
@ 2023-11-12 8:02 Amir Goldstein
2023-11-16 7:52 ` Zorro Lang
0 siblings, 1 reply; 3+ messages in thread
From: Amir Goldstein @ 2023-11-12 8:02 UTC (permalink / raw)
To: Zorro Lang; +Cc: Alexander Larsson, Miklos Szeredi, linux-unionfs, fstests
From: Alexander Larsson <alexl@redhat.com>
We now support xattr of overlayfs.* xattrs, so check that either
both set and get work, or neither.
Signed-off-by: Alexander Larsson <alexl@redhat.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
Zorro,
This test is failing since overlayfs merge for v6.7-rc1, because it
encodes an expectation that set/get of private overlay.* xattrs
should fail.
This expectation is no longer correct for new kernel, so Alex has
fixed the test to expect consistent behavior of set/get of private
overlay.* xattrs.
We have some new tests for features merged for v6.7-rc1, but this fix
has higher priority, so sending it early.
Thanks,
Amir.
tests/overlay/026 | 35 +++++++++++++++++++++++++----------
tests/overlay/026.out | 2 --
2 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/tests/overlay/026 b/tests/overlay/026
index 77030d20..f71b3f13 100755
--- a/tests/overlay/026
+++ b/tests/overlay/026
@@ -57,21 +57,36 @@ $SETFATTR_PROG -n "trusted.overlayfsrz" -v "n" \
_getfattr --absolute-names -n "trusted.overlayfsrz" \
$SCRATCH_MNT/testf0 2>&1 | _filter_scratch
-# {s,g}etfattr of "trusted.overlay.xxx" should fail.
+# {s,g}etfattr of "trusted.overlay.xxx" fail on older kernels
# The errno returned varies among kernel versions,
-# v4.3/7 v4.8-rc1 v4.8 v4.10
-# setfattr not perm not perm not perm not supp
-# getfattr no attr no attr not perm not supp
+# v4.3/7 v4.8-rc1 v4.8 v4.10 v6.7
+# setfattr not perm not perm not perm not supp ok
+# getfattr no attr no attr not perm not supp ok
#
-# Consider "Operation not {supported,permitted}" pass.
+# Consider both "Operation not {supported,permitted}" and
+# "No such attribute" as pass for getattr to support all kernel
+# version. However, the setfattr result must match getattr.
#
-$SETFATTR_PROG -n "trusted.overlay.fsz" -v "n" \
- $SCRATCH_MNT/testf1 2>&1 | _filter_scratch | \
- sed -e 's/permitted/supported/g'
-_getfattr --absolute-names -n "trusted.overlay.fsz" \
+getres=$(_getfattr --absolute-names -n "trusted.overlay.fsz" \
+ $SCRATCH_MNT/testf1 2>&1 | _filter_scratch)
+
+supported=n
+if [[ "$getres" =~ "No such attribute" ]]; then
+ supported=y
+else
+ [[ "$getres" =~ Operation\ not\ (supported|permitted) ]] || echo unexpected getattr result: $getres
+fi
+
+setres=$($SETFATTR_PROG -n "trusted.overlay.fsz" -v "n" \
$SCRATCH_MNT/testf1 2>&1 | _filter_scratch | \
- sed -e 's/permitted/supported/g'
+ sed -e 's/permitted/supported/g')
+
+if [ $supported == 'y' ]; then
+ [[ "$setres" == "" ]] || echo unexpected setattr result: $setres
+else
+ [[ "$setres" =~ "Operation not supported" ]] || echo unexpected setattr result: $setres
+fi
# success, all done
status=0
diff --git a/tests/overlay/026.out b/tests/overlay/026.out
index c4572d67..53030009 100644
--- a/tests/overlay/026.out
+++ b/tests/overlay/026.out
@@ -2,5 +2,3 @@ QA output created by 026
# file: SCRATCH_MNT/testf0
trusted.overlayfsrz="n"
-setfattr: SCRATCH_MNT/testf1: Operation not supported
-SCRATCH_MNT/testf1: trusted.overlay.fsz: Operation not supported
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] overlay/026: Fix test expectation for newer kernels
2023-11-12 8:02 [PATCH] overlay/026: Fix test expectation for newer kernels Amir Goldstein
@ 2023-11-16 7:52 ` Zorro Lang
2023-11-16 12:07 ` Amir Goldstein
0 siblings, 1 reply; 3+ messages in thread
From: Zorro Lang @ 2023-11-16 7:52 UTC (permalink / raw)
To: Amir Goldstein; +Cc: Alexander Larsson, Miklos Szeredi, linux-unionfs, fstests
On Sun, Nov 12, 2023 at 10:02:42AM +0200, Amir Goldstein wrote:
> From: Alexander Larsson <alexl@redhat.com>
>
> We now support xattr of overlayfs.* xattrs, so check that either
> both set and get work, or neither.
>
> Signed-off-by: Alexander Larsson <alexl@redhat.com>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
>
> Zorro,
>
> This test is failing since overlayfs merge for v6.7-rc1, because it
> encodes an expectation that set/get of private overlay.* xattrs
> should fail.
>
> This expectation is no longer correct for new kernel, so Alex has
> fixed the test to expect consistent behavior of set/get of private
> overlay.* xattrs.
>
> We have some new tests for features merged for v6.7-rc1, but this fix
> has higher priority, so sending it early.
>
> Thanks,
> Amir.
>
>
> tests/overlay/026 | 35 +++++++++++++++++++++++++----------
> tests/overlay/026.out | 2 --
> 2 files changed, 25 insertions(+), 12 deletions(-)
>
> diff --git a/tests/overlay/026 b/tests/overlay/026
> index 77030d20..f71b3f13 100755
> --- a/tests/overlay/026
> +++ b/tests/overlay/026
> @@ -57,21 +57,36 @@ $SETFATTR_PROG -n "trusted.overlayfsrz" -v "n" \
> _getfattr --absolute-names -n "trusted.overlayfsrz" \
> $SCRATCH_MNT/testf0 2>&1 | _filter_scratch
>
> -# {s,g}etfattr of "trusted.overlay.xxx" should fail.
> +# {s,g}etfattr of "trusted.overlay.xxx" fail on older kernels
> # The errno returned varies among kernel versions,
> -# v4.3/7 v4.8-rc1 v4.8 v4.10
> -# setfattr not perm not perm not perm not supp
> -# getfattr no attr no attr not perm not supp
> +# v4.3/7 v4.8-rc1 v4.8 v4.10 v6.7
> +# setfattr not perm not perm not perm not supp ok
> +# getfattr no attr no attr not perm not supp ok
> #
> -# Consider "Operation not {supported,permitted}" pass.
> +# Consider both "Operation not {supported,permitted}" and
> +# "No such attribute" as pass for getattr to support all kernel
> +# version. However, the setfattr result must match getattr.
> #
> -$SETFATTR_PROG -n "trusted.overlay.fsz" -v "n" \
> - $SCRATCH_MNT/testf1 2>&1 | _filter_scratch | \
> - sed -e 's/permitted/supported/g'
>
> -_getfattr --absolute-names -n "trusted.overlay.fsz" \
> +getres=$(_getfattr --absolute-names -n "trusted.overlay.fsz" \
> + $SCRATCH_MNT/testf1 2>&1 | _filter_scratch)
Can we have a helper in common/overlay to check if current FSTYP supports
get or set overlay.* xattr, to deal with this patch?
Thanks,
Zorro
> +
> +supported=n
> +if [[ "$getres" =~ "No such attribute" ]]; then
> + supported=y
> +else
> + [[ "$getres" =~ Operation\ not\ (supported|permitted) ]] || echo unexpected getattr result: $getres
> +fi
> +
> +setres=$($SETFATTR_PROG -n "trusted.overlay.fsz" -v "n" \
> $SCRATCH_MNT/testf1 2>&1 | _filter_scratch | \
> - sed -e 's/permitted/supported/g'
> + sed -e 's/permitted/supported/g')
> +
> +if [ $supported == 'y' ]; then
> + [[ "$setres" == "" ]] || echo unexpected setattr result: $setres
> +else
> + [[ "$setres" =~ "Operation not supported" ]] || echo unexpected setattr result: $setres
> +fi
>
> # success, all done
> status=0
> diff --git a/tests/overlay/026.out b/tests/overlay/026.out
> index c4572d67..53030009 100644
> --- a/tests/overlay/026.out
> +++ b/tests/overlay/026.out
> @@ -2,5 +2,3 @@ QA output created by 026
> # file: SCRATCH_MNT/testf0
> trusted.overlayfsrz="n"
>
> -setfattr: SCRATCH_MNT/testf1: Operation not supported
> -SCRATCH_MNT/testf1: trusted.overlay.fsz: Operation not supported
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] overlay/026: Fix test expectation for newer kernels
2023-11-16 7:52 ` Zorro Lang
@ 2023-11-16 12:07 ` Amir Goldstein
0 siblings, 0 replies; 3+ messages in thread
From: Amir Goldstein @ 2023-11-16 12:07 UTC (permalink / raw)
To: Zorro Lang; +Cc: Alexander Larsson, Miklos Szeredi, linux-unionfs, fstests
On Thu, Nov 16, 2023 at 9:52 AM Zorro Lang <zlang@redhat.com> wrote:
>
> On Sun, Nov 12, 2023 at 10:02:42AM +0200, Amir Goldstein wrote:
> > From: Alexander Larsson <alexl@redhat.com>
> >
> > We now support xattr of overlayfs.* xattrs, so check that either
> > both set and get work, or neither.
> >
> > Signed-off-by: Alexander Larsson <alexl@redhat.com>
> > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > ---
> >
> > Zorro,
> >
> > This test is failing since overlayfs merge for v6.7-rc1, because it
> > encodes an expectation that set/get of private overlay.* xattrs
> > should fail.
> >
> > This expectation is no longer correct for new kernel, so Alex has
> > fixed the test to expect consistent behavior of set/get of private
> > overlay.* xattrs.
> >
> > We have some new tests for features merged for v6.7-rc1, but this fix
> > has higher priority, so sending it early.
> >
> > Thanks,
> > Amir.
> >
> >
> > tests/overlay/026 | 35 +++++++++++++++++++++++++----------
> > tests/overlay/026.out | 2 --
> > 2 files changed, 25 insertions(+), 12 deletions(-)
> >
> > diff --git a/tests/overlay/026 b/tests/overlay/026
> > index 77030d20..f71b3f13 100755
> > --- a/tests/overlay/026
> > +++ b/tests/overlay/026
> > @@ -57,21 +57,36 @@ $SETFATTR_PROG -n "trusted.overlayfsrz" -v "n" \
> > _getfattr --absolute-names -n "trusted.overlayfsrz" \
> > $SCRATCH_MNT/testf0 2>&1 | _filter_scratch
> >
> > -# {s,g}etfattr of "trusted.overlay.xxx" should fail.
> > +# {s,g}etfattr of "trusted.overlay.xxx" fail on older kernels
> > # The errno returned varies among kernel versions,
> > -# v4.3/7 v4.8-rc1 v4.8 v4.10
> > -# setfattr not perm not perm not perm not supp
> > -# getfattr no attr no attr not perm not supp
> > +# v4.3/7 v4.8-rc1 v4.8 v4.10 v6.7
> > +# setfattr not perm not perm not perm not supp ok
> > +# getfattr no attr no attr not perm not supp ok
> > #
> > -# Consider "Operation not {supported,permitted}" pass.
> > +# Consider both "Operation not {supported,permitted}" and
> > +# "No such attribute" as pass for getattr to support all kernel
> > +# version. However, the setfattr result must match getattr.
> > #
> > -$SETFATTR_PROG -n "trusted.overlay.fsz" -v "n" \
> > - $SCRATCH_MNT/testf1 2>&1 | _filter_scratch | \
> > - sed -e 's/permitted/supported/g'
> >
> > -_getfattr --absolute-names -n "trusted.overlay.fsz" \
> > +getres=$(_getfattr --absolute-names -n "trusted.overlay.fsz" \
> > + $SCRATCH_MNT/testf1 2>&1 | _filter_scratch)
>
> Can we have a helper in common/overlay to check if current FSTYP supports
> get or set overlay.* xattr, to deal with this patch?
>
I see that Alex has already created _require_scratch_overlay_xattr_escapes()
in the patch adding test overlay/084 that I posted.
Alex,
Can you pls refactor that into _check_scratch_overlay_xattr_escapes()
and use it in this patch?
Thanks,
Amir.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-16 12:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-12 8:02 [PATCH] overlay/026: Fix test expectation for newer kernels Amir Goldstein
2023-11-16 7:52 ` Zorro Lang
2023-11-16 12:07 ` Amir Goldstein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox