]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/shell: redirect output of test script to file too
authorThomas Haller <thaller@redhat.com>
Thu, 7 Sep 2023 22:07:19 +0000 (00:07 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 8 Sep 2023 09:50:41 +0000 (11:50 +0200)
It's useful to keep around for later. Redirect to the temporary
directory.

Note that the file content may be colorized too. `less -R` helps with
that.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/run-tests.sh

index e4efbb2de5405dd6f89dbcd52da91ce14a73f492..4c1ab29b853600e4d694e6609e2d0223dadd8491 100755 (executable)
@@ -382,6 +382,8 @@ NFT_TEST_TMPDIR="$(mktemp --tmpdir="$_TMPDIR" -d "nft-test.$(date '+%Y%m%d-%H%M%
        msg_error "Failure to create temp directory in \"$_TMPDIR\""
 chmod 755 "$NFT_TEST_TMPDIR"
 
+exec &> >(tee "$NFT_TEST_TMPDIR/test.log")
+
 NFT_REAL="${NFT_REAL-$NFT}"
 
 msg_info "conf: NFT=$(printf '%q' "$NFT")"