3 # Check how network syscalls are traced.
5 . "${srcdir=.}/init.sh"
12 ./net-accept-connect ||
13 fail_ 'net-accept-connect failed'
15 args="-tt -ff -o $LOG -enetwork ./net-accept-connect"
17 fail_ "strace $args failed"
19 "$srcdir"/../strace-log-merge $LOG > $LOG || {
21 fail_ 'strace-log-merge failed'
28 local syscall="$1"; shift
29 local prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +'
31 LC_ALL=C grep -E -x "$prefix$syscall$@" $LOG > /dev/null || {
33 fail_ "strace -enetwork failed to trace \"$syscall\" properly"
37 grep_log socket '\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 0'
38 grep_log socket '\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 1'
39 grep_log bind '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0'
40 grep_log listen '\(0, 5\) += 0'
41 grep_log getsockname '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, \[15\]\) += 0'
42 grep_log accept '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), NULL\}, \[2\]\) += 1'
43 grep_log connect '\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0'