check_prog grep
check_prog rm
-rm -f check.log.*
+rm -f $LOG.*
$TIMEOUT ./net-accept-connect ||
fail_ 'net-accept-connect failed'
-args='-tt -ff -o check.log -enetwork ./net-accept-connect'
+args="-tt -ff -o $LOG -enetwork ./net-accept-connect"
$TIMEOUT $STRACE $args ||
fail_ "strace $args failed"
-"$srcdir"/../strace-log-merge check.log > check.log || {
- cat check.log
+"$srcdir"/../strace-log-merge $LOG > $LOG || {
+ cat $LOG
fail_ 'strace-log-merge failed'
}
-rm -f check.log.*
+rm -f $LOG.*
grep_log()
{
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$@" check.log > /dev/null || {
- cat check.log
+ LC_ALL=C grep -E -x "$prefix$syscall$@" $LOG > /dev/null || {
+ cat $LOG
fail_ "strace -enetwork failed to trace \"$syscall\" properly"
}
}
check_prog ls
check_prog grep
-$TIMEOUT $STRACE -e execve ls > /dev/null 2> check.log &&
-grep '^execve(' check.log > /dev/null ||
- { cat check.log; fail_ 'strace -e execve does not work'; }
+$TIMEOUT $STRACE -e execve ls > /dev/null 2> $LOG &&
+grep '^execve(' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -e execve does not work'; }
-grep -v '^execve(' check.log |
+grep -v '^execve(' $LOG |
LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null &&
- { cat check.log; fail_ 'strace -e execve does not work properly'; }
+ { cat $LOG; fail_ 'strace -e execve does not work properly'; }
-$TIMEOUT $STRACE -e trace=process ls > /dev/null 2> check.log &&
-grep '^execve(' check.log > /dev/null ||
- { cat check.log; fail_ 'strace -e trace=process does not work'; }
+$TIMEOUT $STRACE -e trace=process ls > /dev/null 2> $LOG &&
+grep '^execve(' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -e trace=process does not work'; }
-grep '^open' check.log > /dev/null &&
- { cat check.log; fail_ 'strace -e trace=process does not work properly'; }
+grep '^open' $LOG > /dev/null &&
+ { cat $LOG; fail_ 'strace -e trace=process does not work properly'; }
exit 0
umask 022
truncate_cmd='dd seek=46118400000 obs=1 count=0 if=/dev/null of=sample'
-$truncate_cmd > check.log 2>&1 ||
- { cat check.log; framework_skip_ 'failed to create a large sparse file'; }
+$truncate_cmd > $LOG 2>&1 ||
+ { cat $LOG; framework_skip_ 'failed to create a large sparse file'; }
rm -f sample
-$TIMEOUT $STRACE -edesc $truncate_cmd 2>&1 > /dev/null 2> check.log &&
-LC_ALL=C grep -E -x 'ftruncate(64)?\(1, 46118400000\) += 0' check.log > /dev/null ||
- { cat check.log; fail_ 'strace -edesc failed to trace ftruncate/ftruncate64 properly'; }
+$TIMEOUT $STRACE -edesc $truncate_cmd 2>&1 > /dev/null 2> $LOG &&
+LC_ALL=C grep -E -x 'ftruncate(64)?\(1, 46118400000\) += 0' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -edesc failed to trace ftruncate/ftruncate64 properly'; }
-LC_ALL=C grep -E -x 'lseek\(1, 46118400000, SEEK_CUR\) += 46118400000|_llseek\(1, 46118400000, \[46118400000\], SEEK_CUR\) += 0' check.log > /dev/null ||
- { cat check.log; fail_ 'strace -edesc failed to trace lseek/_llseek properly'; }
+LC_ALL=C grep -E -x 'lseek\(1, 46118400000, SEEK_CUR\) += 46118400000|_llseek\(1, 46118400000, \[46118400000\], SEEK_CUR\) += 0' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -edesc failed to trace lseek/_llseek properly'; }
-$TIMEOUT $STRACE -efile find -L sample > /dev/null 2> check.log &&
-LC_ALL=C grep -E -x 'stat(64)?\("sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}\) += 0|(new)?fstatat(64)?\(AT_FDCWD, "sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}, 0\) += 0' check.log > /dev/null ||
- { cat check.log; fail_ 'strace -efile failed to trace stat/stat64 properly'; }
+$TIMEOUT $STRACE -efile find -L sample > /dev/null 2> $LOG &&
+LC_ALL=C grep -E -x 'stat(64)?\("sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}\) += 0|(new)?fstatat(64)?\(AT_FDCWD, "sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}, 0\) += 0' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -efile failed to trace stat/stat64 properly'; }
-$TIMEOUT $STRACE -efile find sample > /dev/null 2> check.log &&
-LC_ALL=C grep -E -x 'lstat(64)?\("sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}\) += 0|(new)?fstatat(64)?\(AT_FDCWD, "sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}, AT_SYMLINK_NOFOLLOW\) += 0' check.log > /dev/null ||
- { cat check.log; fail_ 'strace -efile failed to trace fstatat/fstatat64 properly'; }
+$TIMEOUT $STRACE -efile find sample > /dev/null 2> $LOG &&
+LC_ALL=C grep -E -x 'lstat(64)?\("sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}\) += 0|(new)?fstatat(64)?\(AT_FDCWD, "sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}, AT_SYMLINK_NOFOLLOW\) += 0' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -efile failed to trace fstatat/fstatat64 properly'; }
rm -f sample