Skip to content

Commit

Permalink
add LOCALLOG_AUTO_DELETE env
Browse files Browse the repository at this point in the history
  • Loading branch information
sonyafenge committed Aug 11, 2022
1 parent 625d38f commit 8c85e04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion hack/test-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ CLIENTIMAGE_AUTO_DELETE=${CLIENTIMAGE_AUTO_DELETE:-true}
SIMIMAGE_AUTO_DELETE=${SIMIMAGE_AUTO_DELETE:-true}

#log collection parameter
DIR_ROOT=${DIR_ROOT:-"~"}
DIR_ROOT=${DIR_ROOT:-"$HOME"}
SIM_LOG_DIR=${SIM_LOG_DIR:-"${DIR_ROOT}/logs"}
SERVER_LOG_DIR=${SERVER_LOG_DIR:-"${DIR_ROOT}/logs"}
CLIENT_LOG_DIR=${CLIENT_LOG_DIR:-"${DIR_ROOT}/logs"}
DES_LOG_DIR=${DES_LOG_DIR:-"${DIR_ROOT}/grs/logs/${SERVER_NUM}se${SIM_NUM}si${CLIENT_NUM}cl"}
DES_LOG_INSTANCE=${DES_LOG_INSTANCE:-"sonyadev4"}
DES_LOG_INSTANCE_ZONE=${DES_LOG_INSTANCE_ZONE:-"us-central1-a"}
LOCAL_LOG_ONLY=${LOCAL_LOG_ONLY:-false}


#rune2e parameter
Expand Down
2 changes: 1 addition & 1 deletion hack/test-loganalysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,4 @@ for name in $( ls | grep server);do

done

echo "Please check generated csv report under ./csv/${csv_name}"
echo "Please check generated csv report under ${DESTINATION}/csv/${csv_name}"
13 changes: 9 additions & 4 deletions hack/test-logcollect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,15 @@ if [ ${SIM_NUM} -gt 0 ]; then
fi

"${GRS_ROOT}/hack/test-loganalysis.sh"
echo "Copying logs to destination instance."
copy-logs "${DES_LOG_INSTANCE}" "${DES_LOG_INSTANCE_ZONE}" "${DESTINATION}" "${DES_LOG_DIR}"
echo "Removing local copy from ${DESTINATION}"
sudo rm -r "${DESTINATION}"
if [ "${LOCAL_LOG_ONLY}" == "true" ]; then
echo "All logs copied to local dev machine:${DESTINATION}"
else
echo "Copying logs to destination instance."
copy-logs "${DES_LOG_INSTANCE}" "${DES_LOG_INSTANCE_ZONE}" "${DESTINATION}" "${DES_LOG_DIR}"
echo "All logs copied to ${DES_LOG_INSTANCE}:${DESTINATION}"
echo "Removing local copy from ${DESTINATION}"
sudo rm -r "${DESTINATION}"
fi



0 comments on commit 8c85e04

Please sign in to comment.