]> granicus.if.org Git - strace/blob - tests/unix-yy.test
Use printnum_int64 instead of print_loff_t
[strace] / tests / unix-yy.test
1 #!/bin/sh
2
3 # Check decoding of address information (inode[->peer][,path])
4 # associated with unix domain socket descriptors.
5
6 . "${srcdir=.}/init.sh"
7
8 # strace -yy is implemented using /proc/self/fd
9 [ -d /proc/self/fd/ ] ||
10         framework_skip_ '/proc/self/fd/ is not available'
11
12 check_prog sed
13
14 run_prog ./netlink_unix_diag
15 addr=unix-yy-local-stream
16 run_prog ./net-accept-connect $addr
17 run_strace_merge -yy -eclose,network $args
18
19 child="$(sed -rn '/SIGCHLD/ s/^.*, si_pid=([1-9][0-9]*), .*/\1/p' "$LOG")"
20 [ -n "$child" ] ||
21         dump_log_and_fail_with 'failed to find pid of child process'
22
23 rm -f "$LOG"-*
24 sed -rn "/^$child"' /!d; / socket\(/,$ s/^[0-9]+ +[^ ]+ (.+)/\1/p' "$LOG" > "$LOG"-connect &&
25 sed -rn "/^$child"' /d; /SIGCHLD/d; / socket\(/,$ s/^[0-9]+ +[^ ]+ (.+)/\1/p' "$LOG" > "$LOG"-accept ||
26         dump_log_and_fail_with 'failed to separate logs'
27
28 match_awk "$LOG-connect" "$srcdir"/unix-yy-connect.awk "$STRACE $args connect output mismatch" -v addr=$addr
29 match_awk "$LOG-accept" "$srcdir"/unix-yy-accept.awk "$STRACE $args accept output mismatch" -v addr=$addr
30
31 exit 0