All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Gabriel Krisman Bertazi <krisman@collabora.com>,
	zlang@redhat.com, fstests@vger.kernel.org
Subject: Re: [PATCH] generic/556: Adequate expected output to touch behavior change
Date: Wed, 18 May 2022 15:11:48 -0700	[thread overview]
Message-ID: <YoVvJPpQBSHbe53r@magnolia> (raw)
In-Reply-To: <YoVl7MVtEUuupODz@sol.localdomain>

On Wed, May 18, 2022 at 02:32:28PM -0700, Eric Biggers wrote:
> On Wed, May 18, 2022 at 04:22:14PM -0400, Gabriel Krisman Bertazi wrote:
> > Coreutils commit d435cfc0bc55 ("touch: fix wrong
> > diagnostic (Bug#48106)"), released in coreutils v9.0, changed the error
> > reported by the tool when openat() fails with EINVAL.  Instead of
> > reporting a generic message for the failure of either openat() or the
> > following utimensat(), it now differentiates both failures with
> > different messages.
> > 
> > This change breaks generic/556, which relied on the parsing of that
> > message.  This test was originally developed by me on a Debian
> > Buster (coreutils v8.x), so I used the generic error message.  Now that
> > I tried to run it on a more modern distro, it reports a different error
> > message, which fails the test.
> > 
> > We could do it in a more flexible way to catch future changes.  These
> > are unlikely, and many other parts of fstests just use this generic
> > touch message, so don't bother with it here.
> > 
> > There is no change in behavior on the kernel side, just a broken test.
> > On both older and new distros, the kernel correctly rejects this invalid
> > sequence with -EINVAL, as shown in the strace hunk below:
> > 
> > ...
> > openat(AT_FDCWD, "/scratch_mnt/strict/corac\314\247\303", ...) = -1 EINVAL
> > utimensat(AT_FDCWD, "/scratch_mnt/strict/corac\314\247\303", ...) = -1 EINVAL
> > ...
> > 
> > Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
> > ---
> >  tests/generic/556.out | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tests/generic/556.out b/tests/generic/556.out
> > index f9dd9542fb12..12c77a5b0176 100644
> > --- a/tests/generic/556.out
> > +++ b/tests/generic/556.out
> > @@ -12,5 +12,5 @@ user.foo="bar"
> >  # file: SCRATCH_MNT/xattrs/x/f1
> >  user.foo="bar"
> >  
> > -touch: setting times of 'SCRATCH_MNT/strict/corac'$'\314\247\303': Invalid argument
> > -touch: setting times of 'SCRATCH_MNT/strict/cora'$'\303\247\303': Invalid argument
> > +touch: cannot touch 'SCRATCH_MNT/strict/corac'$'\314\247\303': Invalid argument
> > +touch: cannot touch 'SCRATCH_MNT/strict/cora'$'\303\247\303': Invalid argument
> 
> This would break the test on systems that still have an older version of
> coreutils, right?  For example, currently kvm-xfstests test appliances are based
> on Debian Bullseye by default, which isn't very old, but it has coreutils 8.32.
> 
> Can you filter the output to allow the test to pass with both old and new
> coreutils versions?  Or, find another way to test the same thing without relying
> on a tool that has changed its output.

Seconded, those of us running ancient distros like Ubuntu 22.04 will
need compatibility with 8.32 for a few years yet... ;)

--D

> - Eric

  reply	other threads:[~2022-05-18 22:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 20:22 [PATCH] generic/556: Adequate expected output to touch behavior change Gabriel Krisman Bertazi
2022-05-18 21:32 ` Eric Biggers
2022-05-18 22:11   ` Darrick J. Wong [this message]
2022-05-19 17:31   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YoVvJPpQBSHbe53r@magnolia \
    --to=djwong@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=krisman@collabora.com \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.