strace/tests/qual_inject-retval.test
Eugene Syromyatnikov 4a329a0677 tests: add basic checks for inject=SET:syscall= expression syntax
* tests/qual_fault-syscall.test: New test.
* tests/qual_inject-error-signal-syscall.test: Likewise.
* tests/qual_inject-retval-syscall.test: Likewise.
* tests/qual_inject-signal-syscall.test: Likewise.
* tests/Makefile.am (MISC_TESTS): Add them.
* tests/qual_fault-syntax.test: Add checks for inject=SET:syscall=
expression syntax.
* tests/qual_inject-syntax.test: Likewise.
* tests/qual_fault.test: Append $suffix to -e fault arguments, override
$NAME with $name_override if the latter is set.
* tests/qual_inject-error-signal.test: Append $suffix to -e inject
arguments, override $NAME with $name_override if the latter is set.
* tests/qual_inject-retval.test: Likewise.
* tests/qual_inject-signal.test: Likewise.
2018-06-13 15:05:09 +00:00

24 lines
397 B
Bash
Executable File

#!/bin/sh
# Check success injection.
. "${srcdir=.}/scno_tampering.sh"
: ${suffix=}
[ -z "${name_override-}" ] || NAME="$name_override"
check_injection()
{
local syscall rval
syscall=chdir
rval="$1"; shift
run_strace -a12 -e$syscall -einject="$syscall:retval=$rval$suffix" "$@" \
../qual_inject-retval "$rval" > "$EXP"
match_diff "$LOG" "$EXP"
}
check_injection 0
check_injection 42