Merge pull request #2089 from zerotier/dev-validator-fix-dump-at-abort

Save ZT dump files on validator abort
This commit is contained in:
Joseph Henry 2023-08-10 10:55:41 -07:00 committed by GitHub
commit a7600c8072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,6 +173,7 @@ main() {
if [[ "$both_instances_online" != "true" ]]; then
echo "One or more instances of ZeroTier failed to come online. Aborting test."
collect_zt_dump_files
exit 1
fi
@ -283,16 +284,7 @@ main() {
# Collect ZeroTier dump files #
################################################################################
echo -e "\nCollecting ZeroTier dump files"
node1_id=$($ZT1 -j status | jq -r .address)
node2_id=$($ZT2 -j status | jq -r .address)
$ZT1 dump
mv zerotier_dump.txt "$TEST_FILEPATH_PREFIX-node-dump-$node1_id.txt"
$ZT2 dump
mv zerotier_dump.txt "$TEST_FILEPATH_PREFIX-node-dump-$node2_id.txt"
collect_zt_dump_files
################################################################################
# Let ZeroTier idle long enough for various timers #
@ -468,4 +460,17 @@ check_exit_on_invalid_identity() {
fi
}
collect_zt_dump_files() {
echo -e "\nCollecting ZeroTier dump files"
node1_id=$($ZT1 -j status | jq -r .address)
node2_id=$($ZT2 -j status | jq -r .address)
$ZT1 dump
mv zerotier_dump.txt "$TEST_FILEPATH_PREFIX-node-dump-$node1_id.txt"
$ZT2 dump
mv zerotier_dump.txt "$TEST_FILEPATH_PREFIX-node-dump-$node2_id.txt"
}
main "$@"