strace/tests/quotactl-success.test
Zhibin Li 1b5b5b76b5 tests: check decoding of successful quotactl
* tests/quotactl-success.c: New file.
* tests/quotactl-success-v.c: Likewise.
* tests/quotactl-xfs-success.c: Likewise.
* tests/quotactl-xfs-success-v.c: Likewise.
* tests/quotactl-success.test: New test.
* tests/quotactl-success-v.test: Likewise.
* tests/quotactl-xfs-success.test: Likewise.
* tests/quotactl-xfs-success-v.test: Likewise.
* tests/.gitignore: Add quotactl-success, quotactl-success-v,
quotactl-xfs-success and quotactl-xfs-success-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add four new tests listed above.
* tests/quotactl.h: [INJECT_RETVAL] (check_quota): Use errstr instead of
sprintrc; check that returned value is equivalent to the injected one;
append "(INJECTED)" string to errstr.
* tests/quotactl.c: Changed condition rc != 0 to rc < 0 in callback
functions and value of opaque pointer addr_cb_arg in order to check
successful injection.
* tests/quotactl-xfs.c: Likewise.
2018-07-20 16:18:17 +00:00

7 lines
163 B
Bash
Executable File

#!/bin/sh -efu
. "${srcdir=.}/scno_tampering.sh"
run_strace -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-success > "$EXP"
match_diff "$LOG" "$EXP"