From: Luis Chamberlain <mcgrof@kernel.org>
To: Eryu Guan <guaneryu@gmail.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] check: force hostname to be unique
Date: Thu, 24 Jan 2019 08:45:43 -0800 [thread overview]
Message-ID: <20190124164543.GI11489@garbanzo.do-not-panic.com> (raw)
In-Reply-To: <20190116081212.GI2713@desktop>
On Wed, Jan 16, 2019 at 04:12:12PM +0800, Eryu Guan wrote:
> On Fri, Jan 11, 2019 at 01:54:20PM -0800, Luis Chamberlain wrote:
> > If you use a hostname which is part of the output of
> > standard tools you end up with failures with fstests
> > due to differences in output against the golden output.
> >
> > The failures are false positives due to the hostname.
> > For instance if you hostname is 'xfs' _dump_filter_main()
> > will substitute the initiial 'xfs' with HOSTNAME as part
> > of your logs, and will fail the output will fail against
> > the golden output on say all xfsdump / xfsrestores tests.
> >
> > The hostname must be a unique string, not used as part
> > of the output from any tool used when capturing output.
> >
> > Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
>
> IMHO, a better fix would be improving the regexp in _dump_filter_main to
> match hostname more precisely. I did the following update and it seemed
> to work fine, I tested with '-g dump' and all tests passed (some tests
> _notrun due to missing tape device).
>
> --- a/common/dump
> +++ b/common/dump
> @@ -826,7 +826,8 @@ _dump_filter_main()
> -e "s#$__XFSDUMP_PROG#xfsdump#" \
> -e "s#$XFSRESTORE_PROG#xfsrestore#" \
> -e "s#$XFSINVUTIL_PROG#xfsinvutil#" \
> - -e "s/`hostname`/HOSTNAME/" \
> + -e "s/`hostname`:/HOSTNAME:/" \
> + -e "s/: `hostname`/: HOSTNAME/" \
> -e "s#$SCRATCH_DEV#SCRATCH_DEV#" \
> -e "s#$SCRATCH_RAWDEV#SCRATCH_DEV#" \
> -e "s#$dumptape#TAPE_DEV#" \
>
> It's based on the fact that there're basically two patterns that contain
> 'HOSTNAME':
>
> xfsrestore: hostname: HOSTNAME
> xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
Works for me but this is still pretty fragile, and it does not cover
the what other filesystems use as best-practices for issuign a hostname
either. Even if we consider xfs: are we *certain* that the above regexp
covers all output issued by xfs utils when hostname is used? We're
talking about a generic rule of thumb here.
So I'd say we do both for now. Just my 0.01 CRC.
Luis
prev parent reply other threads:[~2019-01-24 16:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 21:54 [PATCH] check: force hostname to be unique Luis Chamberlain
2019-01-16 8:12 ` Eryu Guan
2019-01-24 16:45 ` Luis Chamberlain [this message]
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=20190124164543.GI11489@garbanzo.do-not-panic.com \
--to=mcgrof@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=guaneryu@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox