]> granicus.if.org Git - strace/blob - tests/attach-p-cmd.test
Update copyright headers
[strace] / tests / attach-p-cmd.test
1 #!/bin/sh
2 #
3 # Check that simultaneous use of -p option and tracing of a command works.
4 #
5 # Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
6 # Copyright (c) 2016-2018 The strace developers.
7 # All rights reserved.
8 #
9 # SPDX-License-Identifier: GPL-2.0-or-later
10
11 . "${srcdir=.}/init.sh"
12
13 run_prog_skip_if_failed \
14         kill -0 $$
15
16 ../set_ptracer_any ../attach-p-cmd-p >> "$EXP" &
17 tracee_pid=$!
18
19 while ! [ -s "$EXP" ]; do
20         kill -0 $tracee_pid 2> /dev/null ||
21                 fail_ 'set_ptracer_any ../attach-p-cmd-p failed'
22 done
23
24 run_strace -a30 -echdir -p $tracee_pid ../attach-p-cmd-cmd > "$EXP"
25 match_diff "$LOG" "$EXP"