From 7db6129f62264e9237e481e6effb17820cd44315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Mon, 7 Aug 2023 11:26:58 +0200 Subject: [PATCH] Capture all fstrm_capture output The fstrm_capture.out file is overwritten when the fstrm_capture utility is restarted during the "dnstap" system test. Use a separate output file for each fstrm_capture instance to ensure all output produced by that tool during the "dnstap" system test is preserved for forensic purposes. (cherry picked from commit bd2941fc72dc622ba28506e73c6c700099e3fb73) --- bin/tests/system/dnstap/clean.sh | 2 +- bin/tests/system/dnstap/tests.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/system/dnstap/clean.sh b/bin/tests/system/dnstap/clean.sh index 0a0081fd94..b9e476f661 100644 --- a/bin/tests/system/dnstap/clean.sh +++ b/bin/tests/system/dnstap/clean.sh @@ -18,7 +18,7 @@ rm -f */named.run.prev rm -f */named.stats rm -f dig.out* rm -f dnstap.* -rm -f fstrm_capture.out +rm -f fstrm_capture.out.* rm -f ns*/dnstap.out rm -f ns*/dnstap.out.save rm -f ns*/dnstap.out.save.? diff --git a/bin/tests/system/dnstap/tests.sh b/bin/tests/system/dnstap/tests.sh index a4ba30264c..70ff83f8ef 100644 --- a/bin/tests/system/dnstap/tests.sh +++ b/bin/tests/system/dnstap/tests.sh @@ -79,7 +79,7 @@ mv ns2/dnstap.out ns2/dnstap.out.save if [ -n "$FSTRM_CAPTURE" ] ; then $FSTRM_CAPTURE -t protobuf:dnstap.Dnstap -u ns4/dnstap.out \ - -w dnstap.out > fstrm_capture.out 2>&1 & + -w dnstap.out > fstrm_capture.out.1 2>&1 & fstrm_capture_pid=$! fi @@ -674,7 +674,7 @@ EOF mv dnstap.out dnstap.out.save $FSTRM_CAPTURE -t protobuf:dnstap.Dnstap -u ns4/dnstap.out \ - -w dnstap.out > fstrm_capture.out 2>&1 & + -w dnstap.out > fstrm_capture.out.2 2>&1 & fstrm_capture_pid=$! sleep 1 $RNDCCMD -s 10.53.0.4 dnstap -reopen | sed 's/^/ns4 /' | cat_i