* tests/stat.test: dd obs= is not portable, use bs= instead.
* tests/stat32-v.test: Likewise.
* tests/stat64-v.test: Likewise.
* tests/net.test: Use $* instead of $@ in the quoted string.
* tests/net-fd.test: Likewise.
* tests/statfs.test: Quote { and } in regexps.
* tests/caps.awk: Likewise.
* tests/getdents.awk: Likewise.
* tests/net-yy-accept.awk: Likewise.
* tests/net-yy-connect.awk: Likewise.
* tests/sigaction.awk: Likewise.
* tests/unix-yy-accept.awk: Likewise.
* tests/unix-yy-connect.awk: Likewise.
fail = 0
lines = 3
cap = "(0|CAP_[A-Z_]+(\\|CAP_[A-Z_]+)*)"
- capget = "^capget\\({_LINUX_CAPABILITY_VERSION_3, 0}, {" cap ", " cap ", " cap "}\\) = 0$"
+ capget = "^capget\\(\\{_LINUX_CAPABILITY_VERSION_3, 0\\}, \\{" cap ", " cap ", " cap "\\}\\) = 0$"
}
NR == 1 {if (match($0, capget)) next}
d_name2 = "d_name=\"\\.\\.\""
d_type = "d_type=DT_DIR"
- d1_1 = "{" d_ino ", " d_off ", " d_reclen ", " d_name1 ", " d_type "}"
- d1_2 = "{" d_ino ", " d_off ", " d_reclen ", " d_name2 ", " d_type "}"
- d2_1 = "{" d_ino ", " d_off ", " d_reclen ", " d_type ", " d_name1 "}"
- d2_2 = "{" d_ino ", " d_off ", " d_reclen ", " d_type ", " d_name2 "}"
+ d1_1 = "\\{" d_ino ", " d_off ", " d_reclen ", " d_name1 ", " d_type "\\}"
+ d1_2 = "\\{" d_ino ", " d_off ", " d_reclen ", " d_name2 ", " d_type "\\}"
+ d2_1 = "\\{" d_ino ", " d_off ", " d_reclen ", " d_type ", " d_name1 "\\}"
+ d2_2 = "\\{" d_ino ", " d_off ", " d_reclen ", " d_type ", " d_name2 "\\}"
- getdents = "^getdents\\(" i ", {(" d1_1 " " d1_2 "|" d1_2 " " d1_1 ")}, " len "\\) += " len "$"
- getdents64 = "^getdents64\\(" i ", {(" d2_1 " " d2_2 "|" d2_2 " " d2_1 ")}, " len "\\) += " len "$"
+ getdents = "^getdents\\(" i ", \\{(" d1_1 " " d1_2 "|" d1_2 " " d1_1 ")\\}, " len "\\) += " len "$"
+ getdents64 = "^getdents64\\(" i ", \\{(" d2_1 " " d2_2 "|" d2_2 " " d2_1 ")\\}, " len "\\) += " len "$"
}
NR == 1 {if (match($0, getdents) || match($0, getdents64)) next}
local syscall="$1"; shift
local prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +'
- LC_ALL=C grep -E -x "$prefix$syscall$@" $LOG > /dev/null || {
+ LC_ALL=C grep -E -x "$prefix$syscall$*" $LOG > /dev/null || {
cat $LOG
fail_ "strace -enetwork failed to trace \"$syscall\" properly"
}
r_i = "[1-9][0-9]*"
r_port = "[1-9][0-9][0-9][0-9]+"
r_localhost = "127\\.0\\.0\\.1"
- r_bind = "^bind\\(0<TCP:\\[(" r_i ")\\]>, {sa_family=AF_INET, sin_port=htons\\(0\\), sin_addr=inet_addr\\(\"" r_localhost "\"\\)}, " r_i "\\) += 0$"
- r_getsockname = "^getsockname\\(0<TCP:\\[" r_localhost ":(" r_port ")\\]>, {sa_family=AF_INET, sin_port=htons\\((" r_port ")\\), sin_addr=inet_addr\\(\"" r_localhost "\"\\)}, \\[" r_i "\\]\\) += 0$"
+ r_bind = "^bind\\(0<TCP:\\[(" r_i ")\\]>, \\{sa_family=AF_INET, sin_port=htons\\(0\\), sin_addr=inet_addr\\(\"" r_localhost "\"\\)\\}, " r_i "\\) += 0$"
+ r_getsockname = "^getsockname\\(0<TCP:\\[" r_localhost ":(" r_port ")\\]>, \\{sa_family=AF_INET, sin_port=htons\\((" r_port ")\\), sin_addr=inet_addr\\(\"" r_localhost "\"\\)\\}, \\[" r_i "\\]\\) += 0$"
}
NR == 1 && /^socket\(PF_INET, SOCK_STREAM, IPPROTO_IP\) += 0$/ {next}
NR == 4 {
if (match($0, r_getsockname, a) && a[1] == a[2]) {
port_l = a[1]
- r_accept = "^accept\\(0<TCP:\\[" r_localhost ":" port_l "\\]>, {sa_family=AF_INET, sin_port=htons\\((" r_port ")\\), sin_addr=inet_addr\\(\"" r_localhost "\"\\)}, \\[" r_i "\\]\\) += 1<TCP:\\[" r_localhost ":" port_l "->" r_localhost ":(" r_port ")\\]>$"
+ r_accept = "^accept\\(0<TCP:\\[" r_localhost ":" port_l "\\]>, \\{sa_family=AF_INET, sin_port=htons\\((" r_port ")\\), sin_addr=inet_addr\\(\"" r_localhost "\"\\)\\}, \\[" r_i "\\]\\) += 1<TCP:\\[" r_localhost ":" port_l "->" r_localhost ":(" r_port ")\\]>$"
r_close0 = "^close\\(0<TCP:\\[" r_localhost ":" port_l "\\]>) += 0$"
next
}
r_i = "[1-9][0-9]*"
r_port = "[1-9][0-9][0-9][0-9]+"
r_localhost = "127\\.0\\.0\\.1"
- r_connect = "^connect\\(0<TCP:\\[" r_i "\\]>, {sa_family=AF_INET, sin_port=htons\\((" r_port ")\\), sin_addr=inet_addr\\(\"" r_localhost "\"\\)}, " r_i ") += 0$"
+ r_connect = "^connect\\(0<TCP:\\[" r_i "\\]>, \\{sa_family=AF_INET, sin_port=htons\\((" r_port ")\\), sin_addr=inet_addr\\(\"" r_localhost "\"\\)\\}, " r_i ") += 0$"
}
NR == 1 && /^socket\(PF_INET, SOCK_STREAM, IPPROTO_IP\) += 0$/ {next}
local syscall="$1"; shift
local prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +'
- LC_ALL=C grep -E -x "$prefix$syscall$@" $LOG > /dev/null || {
+ LC_ALL=C grep -E -x "$prefix$syscall$*" $LOG > /dev/null || {
cat $LOG
fail_ "strace -enetwork failed to trace \"$syscall\" properly"
}
}
# Test 1.
-NR == 1 && /^rt_sigaction\(SIGUSR2, {SIG_IGN, \[HUP INT\], SA_RESTORER\|SA_RESTART, 0x[0-9a-f]+}, {SIG_DFL, \[\], 0}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next}
-NR == 1 && /^rt_sigaction\(SIGUSR2, {SIG_IGN, \[HUP INT\], SA_RESTART}, {SIG_DFL, \[\], 0}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next}
-NR == 1 && /^rt_sigaction\(SIGUSR2, {SIG_IGN, \[HUP INT\], SA_RESTART}, {SIG_DFL, \[\], 0}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next}
+NR == 1 && /^rt_sigaction\(SIGUSR2, \{SIG_IGN, \[HUP INT\], SA_RESTORER\|SA_RESTART, 0x[0-9a-f]+\}, \{SIG_DFL, \[\], 0\}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next}
+NR == 1 && /^rt_sigaction\(SIGUSR2, \{SIG_IGN, \[HUP INT\], SA_RESTART\}, \{SIG_DFL, \[\], 0\}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next}
+NR == 1 && /^rt_sigaction\(SIGUSR2, \{SIG_IGN, \[HUP INT\], SA_RESTART\}, \{SIG_DFL, \[\], 0\}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next}
# Test 2.
-NR == 2 && /^rt_sigaction\(SIGUSR2, {0x[0-9a-f]+, \[QUIT TERM\], SA_RESTORER\|SA_SIGINFO, 0x[0-9a-f]+}, {SIG_IGN, \[HUP INT\], SA_RESTORER\|SA_RESTART, 0x[0-9a-f]+}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next}
-NR == 2 && /^rt_sigaction\(SIGUSR2, {0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO}, {SIG_IGN, \[HUP INT\], SA_RESTART}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next}
-NR == 2 && /^rt_sigaction\(SIGUSR2, {0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO}, {SIG_IGN, \[HUP INT\], SA_RESTART}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next}
+NR == 2 && /^rt_sigaction\(SIGUSR2, \{0x[0-9a-f]+, \[QUIT TERM\], SA_RESTORER\|SA_SIGINFO, 0x[0-9a-f]+\}, \{SIG_IGN, \[HUP INT\], SA_RESTORER\|SA_RESTART, 0x[0-9a-f]+\}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next}
+NR == 2 && /^rt_sigaction\(SIGUSR2, \{0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO\}, \{SIG_IGN, \[HUP INT\], SA_RESTART\}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next}
+NR == 2 && /^rt_sigaction\(SIGUSR2, \{0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO\}, \{SIG_IGN, \[HUP INT\], SA_RESTART\}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next}
# Test 3.
-NR == 3 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, \[\], SA_RESTORER, 0x[0-9a-f]+}, {0x[0-9a-f]+, \[QUIT TERM\], SA_RESTORER\|SA_SIGINFO, 0x[0-9a-f]+}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next}
-NR == 3 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, \[\], 0}, {0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next}
-NR == 3 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, \[\], 0}, {0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next}
+NR == 3 && /^rt_sigaction\(SIGUSR2, \{SIG_DFL, \[\], SA_RESTORER, 0x[0-9a-f]+\}, \{0x[0-9a-f]+, \[QUIT TERM\], SA_RESTORER\|SA_SIGINFO, 0x[0-9a-f]+\}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next}
+NR == 3 && /^rt_sigaction\(SIGUSR2, \{SIG_DFL, \[\], 0\}, \{0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO\}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next}
+NR == 3 && /^rt_sigaction\(SIGUSR2, \{SIG_DFL, \[\], 0\}, \{0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO\}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next}
# Test 4.
-NR == 4 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, ~\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\], SA_RESTORER, 0x[0-9a-f]+}, {SIG_DFL, \[\], SA_RESTORER, 0x[0-9a-f]+}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next}
-NR == 4 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, ~\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\], 0}, {SIG_DFL, \[\], 0}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next}
-NR == 4 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, ~\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\], 0}, {SIG_DFL, \[\], 0}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next}
+NR == 4 && /^rt_sigaction\(SIGUSR2, \{SIG_DFL, ~\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\], SA_RESTORER, 0x[0-9a-f]+\}, \{SIG_DFL, \[\], SA_RESTORER, 0x[0-9a-f]+\}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next}
+NR == 4 && /^rt_sigaction\(SIGUSR2, \{SIG_DFL, ~\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\], 0\}, \{SIG_DFL, \[\], 0\}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next}
+NR == 4 && /^rt_sigaction\(SIGUSR2, \{SIG_DFL, ~\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\], 0\}, \{SIG_DFL, \[\], 0\}, 0x[0-9a-f]+, (4|8|16)\) = 0$/ {next}
# The last line.
NR == lines && /^\+\+\+ exited with 0 \+\+\+$/ {next}
rm -f $sample
umask 022
-truncate_cmd="dd seek=$size obs=1 count=0 if=/dev/null of=$sample"
+truncate_cmd="dd seek=$size bs=1 count=0 if=/dev/null of=$sample"
$truncate_cmd > "$OUT" 2>&1 || {
cat "$OUT"
framework_skip_ 'failed to create a large sparse file'
sample=stat32_sample
umask 022
-truncate_cmd="dd seek=$size obs=1 count=0 if=/dev/null of=$sample"
+truncate_cmd="dd seek=$size bs=1 count=0 if=/dev/null of=$sample"
$truncate_cmd > "$OUT" 2>&1 || {
cat "$OUT"
framework_skip_ 'failed to create a large sparse file'
sample=stat64_sample
umask 022
-truncate_cmd="dd seek=$size obs=1 count=0 if=/dev/null of=$sample"
+truncate_cmd="dd seek=$size bs=1 count=0 if=/dev/null of=$sample"
$truncate_cmd > "$OUT" 2>&1 || {
cat "$OUT"
framework_skip_ 'failed to create a large sparse file'
}
}
-grep_log 'statfs(64)?' '\("/proc/self/status"(, [1-9][0-9]*)?, {f_type="PROC_SUPER_MAGIC", f_bsize=[1-9][0-9]*, f_blocks=[0-9]+, f_bfree=[0-9]+, f_bavail=[0-9]+, f_files=[0-9]+, f_ffree=[0-9]+, f_fsid={[0-9]+, [0-9]+}, f_namelen=[1-9][0-9]*(, f_frsize=[0-9]+)?(, f_flags=[0-9]+)?}\) += 0'
+grep_log 'statfs(64)?' '\("/proc/self/status"(, [1-9][0-9]*)?, \{f_type="PROC_SUPER_MAGIC", f_bsize=[1-9][0-9]*, f_blocks=[0-9]+, f_bfree=[0-9]+, f_bavail=[0-9]+, f_files=[0-9]+, f_ffree=[0-9]+, f_fsid=\{[0-9]+, [0-9]+\}, f_namelen=[1-9][0-9]*(, f_frsize=[0-9]+)?(, f_flags=[0-9]+)?\}\) += 0'
exit 0
addrlen = length(addr) + 3
r_i = "[1-9][0-9]*"
- r_bind = "^bind\\(0<UNIX:\\[(" r_i ")\\]>, {sa_family=AF_(LOCAL|UNIX|FILE), sun_path=\"" addr "\"}, " addrlen "\\) += 0$"
+ r_bind = "^bind\\(0<UNIX:\\[(" r_i ")\\]>, \\{sa_family=AF_(LOCAL|UNIX|FILE), sun_path=\"" addr "\"\\}, " addrlen "\\) += 0$"
}
NR == 1 && /^socket\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 0$/ {next}
if (match($0, r_bind, a)) {
inode_listen = a[1]
r_listen = "^listen\\(0<UNIX:\\[" inode_listen ",\"" addr "\"\\]>, 5\\) += 0$"
- r_getsockname = "^getsockname\\(0<UNIX:\\[" inode_listen ",\"" addr "\"\\]>, {sa_family=AF_(LOCAL|UNIX|FILE), sun_path=\"" addr "\"}, \\[" addrlen "\\]\\) += 0$"
- r_accept = "^accept\\(0<UNIX:\\[" inode_listen ",\"" addr "\"\\]>, {sa_family=AF_(LOCAL|UNIX|FILE), NULL}, \\[2\\]\\) += 1<UNIX:\\[(" r_i ")->(" r_i "),\"" addr "\"\\]>"
+ r_getsockname = "^getsockname\\(0<UNIX:\\[" inode_listen ",\"" addr "\"\\]>, \\{sa_family=AF_(LOCAL|UNIX|FILE), sun_path=\"" addr "\"\\}, \\[" addrlen "\\]\\) += 0$"
+ r_accept = "^accept\\(0<UNIX:\\[" inode_listen ",\"" addr "\"\\]>, \\{sa_family=AF_(LOCAL|UNIX|FILE), NULL\\}, \\[2\\]\\) += 1<UNIX:\\[(" r_i ")->(" r_i "),\"" addr "\"\\]>"
next
}
}
r_i = "[1-9][0-9]*"
r_close_listen = "^close\\(0<UNIX:[" r_i ",\"" addr "\"]>\\) += 0$"
- r_connect = "^connect\\(1<UNIX:\\[(" r_i ")\\]>, {sa_family=AF_(LOCAL|UNIX|FILE), sun_path=\"" addr "\"}, " addrlen "\\) += 0$"
+ r_connect = "^connect\\(1<UNIX:\\[(" r_i ")\\]>, \\{sa_family=AF_(LOCAL|UNIX|FILE), sun_path=\"" addr "\"\\}, " addrlen "\\) += 0$"
}
NR == 1 && /^socket\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 1$/ {next}