github.com/pingcap/br@v5.3.0-alpha.0.20220125034240-ec59c7b6ce30+incompatible/tests/run_compatible.sh (about) 1 #!/bin/bash 2 # 3 # Copyright 2020 PingCAP, Inc. 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 16 # This test is used to test compatible for BR restore. 17 # It will download backup data from internal file server. 18 # And make sure these backup data can restore through newly BR tools to newly cluster. 19 20 set -eu 21 22 source ${BASH_SOURCE[0]%/*}/../compatibility/get_last_tags.sh 23 getLatestTags 24 echo "start test on $TAGS" 25 26 EXPECTED_KVS=1000 27 PD_ADDR="pd0:2379" 28 GCS_HOST="gcs" 29 GCS_PORT="20818" 30 TEST_DIR=/tmp/backup_restore_compatibility_test 31 mkdir -p "$TEST_DIR" 32 rm -f "$TEST_DIR"/*.log &> /dev/null 33 34 for script in tests/docker_compatible_*/${1}.sh; do 35 echo "*===== Running test $script... =====*" 36 TEST_DIR="$TEST_DIR" \ 37 PD_ADDR="$PD_ADDR" \ 38 GCS_HOST="$GCS_HOST" \ 39 GCS_PORT="$GCS_PORT" \ 40 TAGS="$TAGS" \ 41 EXPECTED_KVS="$EXPECTED_KVS" \ 42 PATH="tests/_utils:bin:$PATH" \ 43 TEST_NAME="$(basename "$(dirname "$script")")" \ 44 BR_LOG_TO_TERM=1 \ 45 bash "$script" 46 done