diff --git a/tests/README.md b/tests/README.md index 9f307a8a6..0bce0932d 100644 --- a/tests/README.md +++ b/tests/README.md @@ -5,12 +5,12 @@ programs. ## Preparations -1. The following 6 executables must be copied or linked into these locations: +1. The following 5 executables must be copied or linked into these locations: * `bin/tidb-server` - * `bin/tikv-server` - * `bin/pd-server` + * `bin/tikv-server` + * `bin/pd-server` * `bin/pd-ctl` - * `bin/go-ycsb` + * `bin/go-ycsb` The versions must be ≥2.1.0 as usual. diff --git a/tests/br_view/run.sh b/tests/br_view/run.sh new file mode 100644 index 000000000..48e79b154 --- /dev/null +++ b/tests/br_view/run.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Copyright 2020 PingCAP, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eu +DB="$TEST_NAME" + +run_sql "create schema $DB;" +run_sql "create view $DB.test_backup_view as select 133;" + +echo "backup start..." +run_br backup db --db "$DB" -s "local://$TEST_DIR/$DB" --pd $PD_ADDR + +run_sql "drop schema $DB;" + +echo "restore start..." +run_br restore db --db $DB -s "local://$TEST_DIR/$DB" --pd $PD_ADDR + +restored=$(run_sql "select * from $DB.test_backup_view;" | awk '/133/{print $2}') +[ $restored = '133' ] + +run_sql "drop schema $DB;"