github.com/pingcap/ticdc@v0.0.0-20220526033649-485a10ef2652/tests/availability/run.sh (about)

     1  #!/bin/bash
     2  
     3  set -e
     4  
     5  CUR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
     6  source $CUR/../_utils/test_prepare
     7  source $CUR/owner.sh
     8  source $CUR/capture.sh
     9  source $CUR/processor.sh
    10  WORK_DIR=$OUT_DIR/$TEST_NAME
    11  CDC_BINARY=cdc.test
    12  
    13  export DOWN_TIDB_HOST
    14  export DOWN_TIDB_PORT
    15  
    16  function prepare() {
    17      rm -rf $WORK_DIR && mkdir -p $WORK_DIR
    18  
    19      start_tidb_cluster --workdir $WORK_DIR
    20  
    21      cd $WORK_DIR
    22  
    23      # record tso before we create tables to skip the system table DDLs
    24      start_ts=$(run_cdc_cli tso query --pd=http://$UP_PD_HOST_1:$UP_PD_PORT_1)
    25  
    26      run_sql "CREATE table test.availability1(id int primary key, val int);"
    27      run_sql "CREATE table test.availability2(id int primary key, val int);"
    28      run_sql "CREATE table test.availability3(id int primary key, val int);"
    29  
    30      run_cdc_cli changefeed create --start-ts=$start_ts --sink-uri="mysql://normal:123456@127.0.0.1:3306/"
    31  }
    32  
    33  trap stop_tidb_cluster EXIT
    34  prepare $*
    35  test_owner_ha $*
    36  test_capture_ha $*
    37  test_processor_ha $*
    38  check_logs $WORK_DIR
    39  echo "[$(date)] <<<<<< run test case $TEST_NAME success! >>>>>>"