strace/tests/readlink.test
Dmitry V. Levin d8a81dfa40 tests: extend readlink and readlinkat coverage
* tests/readlink.c (PREFIX, TARGET, LINKPATH): New macros.
(main): Allocate memory for string and buffer passed to the syscall
being tested using tail_alloc mechanism.  Create and cleanup test
symlink.  Test syscall error path output.  Print hexquoted strings
using hexquote_strndup.
* tests/readlinkat.c: Likewise.
* tests/readlink.test: Remove creation and cleanup of test symlinks.
2016-02-04 03:36:25 +00:00

15 lines
214 B
Bash
Executable File

#!/bin/sh
# Check readlink syscall decoding.
. "${srcdir=.}/init.sh"
syscall=${ME_%.test}
OUT="$LOG.out"
run_prog > /dev/null
run_strace -xx -e $syscall $args > "$OUT"
match_diff "$LOG" "$OUT"
rm -f -- "$OUT"