Skip to content

Commit

Permalink
fix show techsupport date issue (sonic-net#3437)
Browse files Browse the repository at this point in the history
What I did
Show techsupport is designed to collect logs and core files since given date.
I find that some core files are missing when given date is relative, for example "5 minutes ago".
Microsoft ADO: 28737486

How I did it
Create the reference file at the start of the script, and don't update it in find_files.

How to verify it
Run end to end test: show_techsupport/test_auto_techsupport.py
  • Loading branch information
ganglyu authored Jul 23, 2024
1 parent d1ca905 commit f196622
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,6 @@ save_file() {
find_files() {
trap 'handle_error $? $LINENO' ERR
local -r directory=$1
$TOUCH --date="${SINCE_DATE}" "${REFERENCE_FILE}"
local -r find_command="find -L $directory -type f -newer ${REFERENCE_FILE}"

echo $($find_command)
Expand Down Expand Up @@ -1914,6 +1913,8 @@ main() {
${CMD_PREFIX}renice +5 -p $$ >> /dev/null
${CMD_PREFIX}ionice -c 2 -n 5 -p $$ >> /dev/null

# Created file as a reference to compare modification time
$TOUCH --date="${SINCE_DATE}" "${REFERENCE_FILE}"
$MKDIR $V -p $TARDIR

# Start with this script so its obvious what code is responsible
Expand Down

0 comments on commit f196622

Please sign in to comment.