Dmitry V. Levin
3ec5c0492c
* tests/init.sh: Check for cat and rm. * tests/getdents.test: Check for awk. * tests/ptrace_setoptions.test: Check for grep. * tests/net-fd.test: Do not check for rm. * tests/net.test: Likewise. * tests/scm_rights-fd.test: Likewise. * tests/stat.test: Likewise. * tests/uio.test: Likewise.
43 lines
1.3 KiB
Bash
Executable File
43 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Check how SCM_RIGHTS control messages are decoded in -y mode.
|
|
|
|
. "${srcdir=.}/init.sh"
|
|
|
|
# strace -y is implemented using /proc/$pid/fd
|
|
[ -d /proc/self/fd/ ] ||
|
|
framework_skip_ '/proc/self/fd/ is not available'
|
|
|
|
check_prog grep
|
|
|
|
rm -f $LOG.*
|
|
|
|
./scm_rights ||
|
|
fail_ 'scm_rights failed'
|
|
|
|
args="-tt -ff -y -xx -enetwork -o $LOG ./scm_rights"
|
|
$STRACE $args ||
|
|
fail_ "$STRACE $args failed"
|
|
|
|
"$srcdir"/../strace-log-merge $LOG > $LOG || {
|
|
cat $LOG
|
|
fail_ 'strace-log-merge failed'
|
|
}
|
|
rm -f $LOG.*
|
|
|
|
grep_log()
|
|
{
|
|
local syscall="$1"; shift
|
|
local prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +'
|
|
|
|
LC_ALL=C grep -E -x "$prefix$syscall$*" $LOG > /dev/null || {
|
|
cat $LOG
|
|
fail_ "$STRACE $args failed to trace \"$syscall\" properly"
|
|
}
|
|
}
|
|
|
|
grep_log sendmsg '\(1<socket:\[[0-9]+\]>, \{msg_name\(0\)=NULL, msg_iov\(1\)=\[\{"\\x00\\x00\\x00\\x00[^"]*", [1-9][0-9]*\}\], msg_controllen=[1-9][0-9]*, \{cmsg_len=[1-9][0-9]*, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, \{3</dev/null>\}\}, msg_flags=0\}, 0\) += [1-9][0-9]*'
|
|
grep_log recvmsg '\(0<socket:\[[0-9]+\]>, \{msg_name\(0\)=NULL, msg_iov\(1\)=\[\{"\\x00\\x00\\x00\\x00[^"]*", [1-9][0-9]*\}\], msg_controllen=[1-9][0-9]*, \{cmsg_len=[1-9][0-9]*, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, \{3</dev/null>\}\}, msg_flags=0\}, 0\) += [1-9][0-9]*'
|
|
|
|
exit 0
|