Skip to content

Commit b3dd434

Browse files
committed
e2e: Capture shutdown logs
Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
1 parent 6304ccd commit b3dd434

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

e2e/run_all_tests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@ pushd ${E2E}
77
suite_failed=0
88

99
for f in ./tests/*.bats; do
10+
# Dump logs to a file to catch shutdown errors
11+
tmp_logs="$(mktemp -d)"
12+
./bin/kubectl logs -n kube-system ds/multi-networkpolicy-ds-amd64 --since=30s -f --all-pods > "${tmp_logs}/daemon-set.logs" &
13+
1014
bats $f
1115
retval=$?
1216
if [ $retval -ne 0 ]; then
1317
suite_failed=1
1418
./bin/kind export logs ./artifacts/`basename $f`.test/kind-logs
19+
cp "${tmp_logs}/daemon-set.logs" ./artifacts/`basename $f`.test/daemon-set.logs
1520
fi
21+
22+
rm -rf "$tmp_logs"
1623
done
1724

1825
exit $suite_failed

0 commit comments

Comments
 (0)