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

Save zt node log files on abort
This commit is contained in:
Joseph Henry 2023-08-10 11:08:52 -07:00 committed by GitHub
commit d91f80464d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,7 +174,8 @@ 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
collect_zt_log_files
exit 0
fi
echo -e "\nJoining networks"
@ -311,11 +312,10 @@ main() {
time_test_end=$(date +%s)
################################################################################
# Rename ZeroTier stdout/stderr logs #
# Copy ZeroTier stdout/stderr logs #
################################################################################
mv node_1.log "$TEST_FILEPATH_PREFIX-node-log-$node1_id.txt"
mv node_2.log "$TEST_FILEPATH_PREFIX-node-log-$node2_id.txt"
collect_zt_log_files
################################################################################
# Generate report #
@ -471,6 +471,11 @@ collect_zt_dump_files() {
$ZT2 dump
mv zerotier_dump.txt "$TEST_FILEPATH_PREFIX-node-dump-$node2_id.txt"
}
}
collect_zt_log_files() {
cp node_1.log "$TEST_FILEPATH_PREFIX-node-log-$node1_id.txt"
cp node_2.log "$TEST_FILEPATH_PREFIX-node-log-$node2_id.txt"
}
main "$@"