3 # Check -e fault= syntax.
5 # Copyright (c) 2016-2018 Dmitry V. Levin <ldv@altlinux.org>
8 # SPDX-License-Identifier: GPL-2.0-or-later
10 . "${srcdir=.}/init.sh"
19 dump_log_and_fail_with \
20 "strace -e fault=$* failed to handle an argument error properly"
23 for arg in chdir:42 \!chdir:42 \
26 chdir:invalid:when=8 \
28 chdir:error=:when=10 \
29 chdir:error=invalid_error_name \
30 chdir:error=invalid_error_name:when=11 \
32 chdir:error=-1:when=12 \
34 chdir:error=-2:when=13 \
36 chdir:error=3+:when=14 \
38 chdir:error=4096:when=15 \
39 chdir:when=7:error=invalid_error_name \
41 chdir:when=:error=19 \
43 chdir:when=0:error=20 \
45 chdir:when=-1:error=21 \
47 chdir:when=-2+:error=22 \
49 chdir:when=-3+0:error=23 \
51 chdir:when=4-:error=24 \
53 chdir:when=5+-:error=25 \
55 chdir:when=6++:error=26 \
57 chdir:when=7+0:error=27 \
59 chdir:when=8+-1:error=28 \
61 chdir:when=9+1+:error=29 \
63 chdir:when=65536:error=30 \
65 chdir:when=1+65536:error=31 \
68 chdir:error=1:error=2 \
69 chdir:syscall=invalid \
74 chdir:syscall=gettid:syscall=gettid \
76 $STRACE -e fault="$arg" true 2> "$LOG" &&
78 LC_ALL=C grep -F 'invalid fault argument' < "$LOG" > /dev/null ||