strace/tests/caps.awk
Dmitry V. Levin 226bf1c21b tests: factor out common awk code
Factor out awk code used in several tests to match.awk.

* tests/match.awk: New file.
* tests/Makefile.am (EXTRA_DIST): Add it.
* tests/caps.awk: Use it.
* tests/getdents.awk: Likewise.
* tests/getrandom.awk: Likewise.
* tests/select.awk: Likewise.
* tests/sigaction.awk: Likewise.
* tests/init.sh (match_awk): Use gawk not awk.  Define AWKPATH.
* tests/getdents.test: Likewise.
2015-03-18 22:41:17 +00:00

13 lines
469 B
Awk

BEGIN {
cap = "(0|CAP_[A-Z_]+(\\|CAP_[A-Z_]+)*|CAP_[A-Z_]+(\\|CAP_[A-Z_]+){37}\\|0xffffffc0)"
r[1] = "^capget\\(\\{_LINUX_CAPABILITY_VERSION_3, 0\\}, \\{" cap ", " cap ", " cap "\\}\\) = 0$"
capset_data = "{CAP_DAC_OVERRIDE|CAP_WAKE_ALARM, CAP_DAC_READ_SEARCH|CAP_BLOCK_SUSPEND, 0}"
s[2] = "capset({_LINUX_CAPABILITY_VERSION_3, 0}, " capset_data ") = -1 EPERM (Operation not permitted)"
s[3] = "+++ exited with 0 +++"
lines = 3
fail = 0
}
@include "match.awk"