summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-06-13 18:18:05 -0700
committerGuy Harris <gharris@sonic.net>2020-06-13 18:18:05 -0700
commitfc86a108aa2e8fc1abf5eb464fc3508bbbe84c72 (patch)
treec53cf9db2284f16c7004b94fbe25c8690d561b82 /tests
parent162307893b533ab20473f18a5eb877cd4cb025c9 (diff)
downloadtcpdump-fc86a108aa2e8fc1abf5eb464fc3508bbbe84c72.tar.gz
TESTrun: add and expand comments.
[skip ci]
Diffstat (limited to 'tests')
-rwxr-xr-xtests/TESTrun15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/TESTrun b/tests/TESTrun
index bdc6555a..a258fa33 100755
--- a/tests/TESTrun
+++ b/tests/TESTrun
@@ -94,6 +94,9 @@ sub runtest {
# we used to do this as a nice pipeline, but the problem is that $r fails to
# to be set properly if the tcpdump core dumps.
+ #
+ # Furthermore, on Windows, fc can't read the standard input, so we
+ # can't do it as a pipeline in any case.
$r = system "$TCPDUMP -# -n -r $input $options >tests/NEW/${outputbase} 2>${rawstderrlog}";
if($r == -1) {
# failed to start due to error.
@@ -102,7 +105,14 @@ sub runtest {
if($r != 0) {
$coredump = false;
$status = 0;
- # this means tcpdump failed.
+ #
+ # Something other than "tcpdump opened the file, read it, and
+ # dissected all the packets". What happened?
+ #
+ # We write out an exit status after whatever the subprocess
+ # wrote out, so it shows up when we diff the expected output
+ # with it.
+ #
open(OUTPUT, ">>"."tests/NEW/$outputbase") || die "fail to open $outputbase\n";
if( $r & 128 ) {
$coredump = $r & 127;
@@ -134,7 +144,8 @@ sub runtest {
$diffstat = WEXITSTATUS($r);
}
- # process the file, sanitize "reading from" line, and count lines
+ # process the standard error file, sanitize "reading from" line,
+ # and count lines
$linecount = 0;
open(ERRORRAW, "<" . $rawstderrlog);
open(ERROROUT, ">" . $stderrlog);