]> granicus.if.org Git - strace/commitdiff
tests: prepare for parallel-tests support
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 18 Jun 2013 13:35:29 +0000 (13:35 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 18 Jun 2013 16:58:02 +0000 (16:58 +0000)
* tests/Makefile.am (CLEANFILES): Calculate dynamically from TESTS.
* tests/init.sh (LOG): New variable.
* tests/detach-stopped: Use it.
* tests/net: Likewise.
* tests/qual_syscall: Likewise.
* tests/stat: Likewise.
* tests/strace-f: Likewise.

tests/Makefile.am
tests/init.sh
tests/net
tests/qual_syscall
tests/stat
tests/strace-f

index a7f584d362fc966b67cd97ce324f2be5cd2bc65c..c72fc9dae91f5471b8f249920083660e9160e8d8 100644 (file)
@@ -8,4 +8,4 @@ TESTS = ptrace_setoptions strace-f qual_syscall stat net
 
 EXTRA_DIST = init.sh $(TESTS)
 
-CLEANFILES = check.log
+CLEANFILES = $(TESTS:=.tmp)
index db7f1025952416d996053318de4d91fb331d584f..c6297c11c5da824e3370008a3ad2d78c13d07974 100644 (file)
@@ -2,6 +2,9 @@
 
 ME_="${0##*/}"
 
+LOG="$ME_.tmp"
+rm -f "$LOG"
+
 warn_() { printf >&2 '%s\n' "$*"; }
 fail_() { warn_ "$ME_: failed test: $*"; exit 1; }
 skip_() { warn_ "$ME_: skipped test: $*"; exit 77; }
index 64bcc772e91ad2be52bde83be50430f139921a09..044808e875ad76e9e37250c02cdaa06caa137204 100755 (executable)
--- a/tests/net
+++ b/tests/net
@@ -9,29 +9,29 @@ check_timeout
 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"
        }
 }
index f382f1abb2c7bcac95a63b4950e2430939471e9f..9d75fcae2ef80e2535303c5f4ffbe60b3eac5638 100755 (executable)
@@ -9,19 +9,19 @@ check_timeout
 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
index e0fc37997be1f7cde738983534af54e85443875e..013243b656795340a5fe75dd8d497c5b3c4353e4 100755 (executable)
@@ -13,24 +13,24 @@ check_prog rm
 
 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
 
index 0f76afc1ea4c2f4f042cdf50c90c3feab9dee52d..20fd943748c092eea151803d2446fb63dc2ad3e8 100755 (executable)
@@ -9,5 +9,5 @@ check_timeout
 time=/usr/bin/time
 check_prog $time
 
-$TIMEOUT $STRACE -f $time /bin/ls > check.log 2>&1 ||
-       { cat check.log; fail_ 'strace -f does not work'; }
+$TIMEOUT $STRACE -f $time /bin/ls > $LOG 2>&1 ||
+       { cat $LOG; fail_ 'strace -f does not work'; }