strace/tests/uio.test
Dmitry V. Levin 3ec5c0492c tests: cleanup checks for basic programs
* 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.
2014-09-23 01:51:05 +00:00

39 lines
840 B
Bash
Executable File

#!/bin/sh
# Check how pread/pwrite and preadv/pwritev syscalls are traced.
. "${srcdir=.}/init.sh"
check_prog grep
./uio || {
if [ $? -eq 77 ]; then
framework_skip_ 'preadv/pwritev syscalls are not available'
else
fail_ 'uio failed'
fi
}
args="-edesc ./uio"
$STRACE $args > $LOG 2>&1 || {
cat $LOG
fail_ "$STRACE $args failed"
}
grep_log()
{
local syscall="$1"; shift
LC_ALL=C grep -E -x "$syscall$*" $LOG > /dev/null || {
cat $LOG
fail_ "$STRACE $args failed to trace \"$syscall\" properly"
}
}
grep_log 'pread(64)?' '\(3, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4'
grep_log 'preadv' '\(3, \[{"\\0\\0\\0\\0", 4}\], 1, 1004211379570065135\) += 4'
grep_log 'pwrite(64)?' '\(3, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4'
grep_log 'pwritev' '\(3, \[{"\\0\\0\\0\\0", 4}\], 1, 1004211379570065135\) += 4'
exit 0