3 # Check decoding of ip:port pairs associated with socket descriptors
5 . "${srcdir=.}/init.sh"
7 # strace -yy is implemented using /proc/self/fd
8 [ -d /proc/self/fd/ ] ||
9 framework_skip_ '/proc/self/fd/ is not available'
13 run_prog ./netlink_inet_diag
14 run_prog ./inet-accept-connect-send-recv
15 run_strace_merge -yy -eclose,network $args
17 child="$(sed -rn '/SIGCHLD/ s/^.*, si_pid=([1-9][0-9]*), .*/\1/p' "$LOG")"
19 dump_log_and_fail_with 'failed to find pid of child process'
22 sed -rn "/^$child"' /!d; / socket\(/,$ s/^[0-9]+ +[^ ]+ (.+)/\1/p' "$LOG" > "$LOG"-connect &&
23 sed -rn "/^$child"' /d; /SIGCHLD/d; / socket\(/,$ s/^[0-9]+ +[^ ]+ (.+)/\1/p' "$LOG" > "$LOG"-accept ||
24 dump_log_and_fail_with 'failed to separate logs'
26 match_awk "$LOG-connect" "$srcdir"/net-yy-connect.awk "$STRACE $args connect output mismatch"
27 match_awk "$LOG-accept" "$srcdir"/net-yy-accept.awk "$STRACE $args accept output mismatch"