]> granicus.if.org Git - strace/commitdiff
strace-ff.test: check that -ff does not create unexpected output files
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 9 May 2016 23:15:52 +0000 (23:15 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 9 May 2016 23:21:30 +0000 (23:21 +0000)
* tests/strace-ff.expected: New file.
* tests/Makefile.am (EXTRA_DIST): Add it.
* tests/strace-ff.test: Use it.  Check that no other output files
have been created.

tests/Makefile.am
tests/strace-ff.expected [new file with mode: 0644]
tests/strace-ff.test

index 6f4815b91305ca1e5d2b14efd74f3692f8005bf9..74012afbf96ee9bf5592362427ef9077a879c5ca 100644 (file)
@@ -658,6 +658,7 @@ EXTRA_DIST = init.sh run.sh match.awk \
             statfs.expected \
             statx.sh \
             strace-T.expected \
+            strace-ff.expected \
             strace-r.expected \
             struct_flock.c \
             sun_path.expected \
diff --git a/tests/strace-ff.expected b/tests/strace-ff.expected
new file mode 100644 (file)
index 0000000..627a1b4
--- /dev/null
@@ -0,0 +1,2 @@
+exit_group(0) = ?
++++ exited with 0 +++
index 6078c7269c8ae07cb0263aef0476a58cc4a9245d..d1e06344ef2c763282c90c8bd09366d0a0e81ab2 100755 (executable)
@@ -4,11 +4,18 @@
 
 . "${srcdir=.}/init.sh"
 
+rm -f "$LOG".*
+
 ./set_ptracer_any ./sleep 1 > /dev/null &
 PID=$!
 run_strace -a14 -eexit_group -ff -p $PID
-printf "exit_group(0) = ?\n+++ exited with 0 +++\n" > "$LOG"
 
-match_diff "$LOG" "$LOG.$PID"
+# check that output matches
+match_diff "$LOG.$PID"
 
-rm -f "$LOG".*
+# check that no other output files have been created
+set -- "$LOG".*
+[ "$LOG.$PID" = "$*" ] ||
+       fail_ "too many output files: $*"
+
+rm -f "$LOG.$PID"