Skip to content

Commit

Permalink
br: enable checksum in test (#58489)
Browse files Browse the repository at this point in the history
close #57472
  • Loading branch information
Tristan1900 authored Dec 24, 2024
1 parent 384f858 commit b079b5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions br/tests/br_file_corruption/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ done

export GO_FAILPOINTS="github.com/pingcap/tidb/br/pkg/restore/snap_client/full-restore-validate-checksum=return(true)"
restore_fail=0
run_br --pd $PD_ADDR restore full -s "local://$TEST_DIR/$DB" --checksum=true || restore_fail=1
run_br --pd $PD_ADDR restore full -s "local://$TEST_DIR/$DB" || restore_fail=1
export GO_FAILPOINTS=""
if [ $restore_fail -ne 1 ]; then
echo 'expect restore to fail on checksum mismatch but succeed'
Expand All @@ -79,5 +79,5 @@ fi
run_sql "DROP DATABASE IF EXISTS $DB;"

# sanity check restore can succeed
run_br --pd $PD_ADDR restore full -s "local://$TEST_DIR/$DB" --checksum=true
run_br --pd $PD_ADDR restore full -s "local://$TEST_DIR/$DB"
echo 'file corruption tests passed'
7 changes: 5 additions & 2 deletions br/tests/run_br
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
set -eux

main() {
# Call the original run.sh script
"$UTILS_DIR/run_br" "$@" $ENCRYPTION_ARGS
# Add checksum argument
CHECKSUM_ARGS="--checksum=true"

# Call the original run.sh script with checksum args first so it can be overridden
"$UTILS_DIR/run_br" $CHECKSUM_ARGS "$@" $ENCRYPTION_ARGS

# Check if encryption validation is enabled
if [ "${ENABLE_ENCRYPTION_CHECK:-false}" != "true" ]; then
Expand Down

0 comments on commit b079b5f

Please sign in to comment.