[PATCH v7 4/4] tests: check status qualifier

Dmitry V. Levin ldv at altlinux.org
Wed Jul 10 00:16:33 UTC 2019


On Sat, Jul 06, 2019 at 09:20:15AM +0200, Paul Chaignon wrote:
[...]
> diff --git a/tests/status-detached.test b/tests/status-detached.test
> new file mode 100755
> index 00000000..8db11163
> --- /dev/null
> +++ b/tests/status-detached.test
> @@ -0,0 +1,17 @@
> +#!/bin/sh
> +#
> +# Check -e status=detached option.
> +#
> +# Copyright (c) 2019 Paul Chaignon <paul.chaignon at gmail.com>
> +# All rights reserved.
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +. "${srcdir=.}/init.sh"
> +
> +# -I2 avoids blocking all fatal signals, the default when using -o.
> +$STRACE -o "$LOG" -I2 -e status=detached ../sleep 2 &
> +pid=$!
> +../sleep 1
> +kill $pid
> +match_grep

There has to be a "wait" between kill and match_grep to avoid the race
between strace writing its "<detached ...>" output and match_grep checking it.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20190710/cfbfedb9/attachment.bin>


More information about the Strace-devel mailing list