strace/tests/bpf-success-v.test
Eugene Syromyatnikov ee96027445 tests: add union bpf_attr.query.prog_ids field decoding checks
* tests/bpf-success-v.c: New file.
* tests/bpf-success.c: Likewise.
* tests/bpf-success-v.test: New test.
* tests/bpf-success.test: Likewise.
* tests/.gitignore: Add bpf-success and bpf-success-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add bpf-success.test and bpf-success-v.test.
* tests/bpf.c [INJECT_RETVAL] (sys_bpf): Check that retuned value
is equivalent to the injected one; append "(INJECTED)" string to errstr.
(prog_load_ids, prog_load_ids_ptr): New variables.
(init_BPF_PROG_QUERY_attr4, print_BPF_PROG_QUERY_attr4,
init_BPF_PROG_QUERY_attr5, print_BPF_PROG_QUERY_attr5): New functions.
(BPF_PROG_QUERY_checks): Drop "const" qualifier, add new checks.
2018-05-28 17:34:50 +00:00

7 lines
158 B
Bash
Executable File

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