github.com/matrixorigin/matrixone@v1.2.0/optools/compose_bvt/entrypoint.sh (about)

     1  #!/bin/bash
     2  
     3  set -euo pipefail
     4  
     5  SECONDS=0
     6  
     7  # mv log to mount path
     8  function packLog() {
     9      mv /mo-tester/report /test/
    10  
    11      duration=$SECONDS
    12      echo "$(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
    13  }
    14  
    15  function run_bvt() {
    16      trap packLog EXIT
    17      # wait for ready
    18      i=0
    19      while [ $(mysql -h cn0 -P 6001 -u dump -p111 --execute 'create database if not exists compose_test;use compose_test; create table if not exists compose_test_table(col1 int auto_increment primary key);show tables;' 2>&1 | tee /dev/stderr | grep 'compose_test_table' | wc -l) -lt 1 ]; do
    20        echo "wait mo init finished...$i"
    21        if [ $i -ge 300 ]; then
    22          echo "wait for $i seconds, mo init not finish, so exit 1"
    23          docker ps
    24          exit 1;
    25        fi
    26        i=$(($i+1))
    27        sleep 1
    28      done
    29      cd /mo-tester && ./run.sh -n -g -p /matrixone/test/distributed/cases/ -s /matrixone/test/distributed/resources/ -e optimistic 2>&1
    30  }
    31  
    32  run_bvt