Util-Linux Archive on lore.kernel.org
 help / color / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] tests: use env and support both unbuffer/stdbuf
Date: Sat, 31 Aug 2019 09:41:26 +0200
Message-ID: <20190831074126.GA12599@ncase> (raw)
In-Reply-To: <20190828105107.tkhwqh3limxjo5yc@10.255.255.10>

[-- Attachment #1: Type: text/plain, Size: 2314 bytes --]

On Wed, Aug 28, 2019 at 12:51:07PM +0200, Karel Zak wrote:
> On Tue, Aug 27, 2019 at 02:26:08PM +0200, Patrick Steinhardt wrote:
> > Triggered by commit f612c4c67 (tests: fix --unbuffered mode with
> > ASAN, 2019-08-27), which says:
> > 
> >     Well, this patch sucks. It would be nice to have things in
> >     the way how it has been original expected by Patrick's patch,
> >     but ...
> > 
> > So this commit here effectively reverts it and instead tries to
> > improve the shortcomings of the original patch. First, it uses
> > env(1) to set ASAN_OPTIONS instead of directly adding it to the
> > args array to fix execution of "${args[@]}" "$@".
> > 
> > Second, it now supports both unbuffer(1) and stdbuf(1). The
> > latter uses LD_PRELOAD tricks, which doesn't play nicely with
> > ASAN, so it will not be used if ASAN has been requested. It's
> > still valuable to have support for both, as many more systems
> > will have stdbuf(1) from coreutils installed but not unbuffer(1)
> > from expect.
> 
> Applied, thanks.
> 
> Unfortunately, it seems result is fragile. It fails on travis
> https://travis-ci.org/karelzak/util-linux/jobs/577767328
> 
> The problem is the order of some output lines, for example:
> tests/output/rename/exit_codes
> 
> Maybe the best and most robust solution would be split stdout and
> stderr into two files for each test. Now we have $TS_OUTPUT, what about
> to replace it with $TS_STDOUT and $TS_STDERR? Something like:
> 
>  - $TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT >> $TS_OUTPUT 2>&1
>  + $TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT >> $TS_STDOUT 2>> $TS_STDERR
> 
> And also create tests/expected/<foo>/<bar>{.err} for tests where any
> output on stderr is expected, otherwise assume $TS_STDERR is empty.
> 
> This change will be pretty invasive, but than we can easily compare 
> outputs and keep track about what is where printed. 
> 
>     Karel

Sorry, I somehow didn't see this mail. I thought about splitting
it up too, but shied away as I expected it to be rather involved.
Anyway, I think in the long run it's definitely the best way to
tackle the issue at hand, so thanks for your effort!

I've just done a test run on musl libc, and everything except for
the known issue with POSIXLY_CORRECT getopt passes.

Patrick

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply index

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 10:16 [PATCH 0/6] Test suite fixes for musl libc Patrick Steinhardt
2019-08-23 10:16 ` [PATCH 1/6] tests: remove reliance on buffer behaviour of stderr/stdout streams Patrick Steinhardt
2019-08-23 10:16 ` [PATCH 2/6] tests: colcrt: fix reliance on EILSEQ in POSIX locale Patrick Steinhardt
2019-08-23 10:17 ` [PATCH 3/6] tests: column: use actually invalid multibytes to test encoding Patrick Steinhardt
2019-08-23 10:17 ` [PATCH 4/6] tests: col: avoid hardcoding of errno string Patrick Steinhardt
2019-08-23 10:17 ` [PATCH 5/6] tests: fdisk: " Patrick Steinhardt
2019-08-23 10:17 ` [PATCH 6/6] tests: libfdisk: remove reliance on buffer behaviour of standard streams Patrick Steinhardt
2019-08-23 12:15   ` Karel Zak
2019-08-23 13:32 ` [PATCH v2 0/6] Test suite fixes for musl libc Patrick Steinhardt
2019-08-23 13:32   ` [PATCH v2 1/6] tests: remove reliance on buffer behaviour of stderr/stdout streams Patrick Steinhardt
2019-08-27 11:17     ` Karel Zak
2019-08-27 11:49       ` Patrick Steinhardt
2019-08-27 12:32         ` Karel Zak
2019-08-27 11:55       ` Patrick Steinhardt
2019-08-27 12:31         ` Karel Zak
2019-08-27 12:26       ` [PATCH] tests: use env and support both unbuffer/stdbuf Patrick Steinhardt
2019-08-27 12:46         ` Karel Zak
2019-08-28 10:51         ` Karel Zak
2019-08-30 19:08           ` Karel Zak
2019-08-31  7:41           ` Patrick Steinhardt [this message]
2019-08-23 13:32   ` [PATCH v2 2/6] tests: libfdisk: remove reliance on buffer behaviour of standard streams Patrick Steinhardt
2019-08-23 13:32   ` [PATCH v2 3/6] tests: colcrt: fix reliance on EILSEQ in POSIX locale Patrick Steinhardt
2019-08-23 13:32   ` [PATCH v2 4/6] tests: column: use actually invalid multibytes to test encoding Patrick Steinhardt
2019-08-23 13:32   ` [PATCH v2 5/6] tests: col: avoid hardcoding of errno string Patrick Steinhardt
2019-08-23 13:32   ` [PATCH v2 6/6] tests: fdisk: " Patrick Steinhardt

Reply instructions:

You may reply publically 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=20190831074126.GA12599@ncase \
    --to=ps@pks.im \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /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

Util-Linux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/util-linux/0 util-linux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 util-linux util-linux/ https://lore.kernel.org/util-linux \
		util-linux@vger.kernel.org
	public-inbox-index util-linux

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.util-linux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git