diff --git a/docker/ctc_cntl_single_meta.sh b/docker/ctc_cntl_single_meta.sh new file mode 100755 index 0000000000000000000000000000000000000000..ade5aa822bda3f9cb6640b4542ae95d7b22b206e --- /dev/null +++ b/docker/ctc_cntl_single_meta.sh @@ -0,0 +1,167 @@ +#!/bin/bash +set -e +# Function to perform initialization +init() { + cd /home/regress/cantian-connector-mysql/mysql-source || exit 1 + patch --ignore-whitespace -p1 >/dev/null 2>&1 & +} + +# Function to perform run4mtr +run4mtr() { + local do_test_list=${1:-enableCases.list} + cd /home/regress/CantianKernel/Cantian-DATABASE-CENTOS-64bit || exit 1 + python3 install.py -U cantiandba:cantiandba -R /home/cantiandba/install -D /home/cantiandba/data -l /home/cantiandba/logs/install.log -Z _LOG_LEVEL=255 -g withoutroot -d -M cantiand -c -Z _SYS_PASSWORD=Huawei@123 + + cd /usr/local/mysql/mysql-test || exit 1 + chmod 777 ./mysql-test-run-meta.pl + ./mysql-test-run-meta.pl --mysqld=--default-storage-engine=CTC --mysqld=--check_proxy_users=ON --do-test-list="$do_test_list" --noreorder --nowarnings +} + +# Function to perform sync +sync() { + cp -arf /home/regress/cantian-connector-mysql/mysql-test /home/regress/cantian-connector-mysql/mysql-source + cp -arf /home/regress/cantian-connector-mysql/storage /home/regress/cantian-connector-mysql/mysql-source +} + +# Function to perform sync-inverse +sync-inverse() { + cd /home/regress/cantian-connector-mysql/mysql-source || exit 1 + cp -arf storage/tianchi /home/regress/cantian-connector-mysql/storage + cp -arf mysql-test/suite/tianchi /home/regress/cantian-connector-mysql/mysql-test/suite +} + +# Parse options +opts=$(getopt -o o:m:d:h --long option:,module:,do-test-list:,help -- "$@") + +if [ $? -ne 0 ]; then + usage + exit 1 +fi + +# 将解析结果重新赋值给参数 +eval set -- "$opts" +while true; do + case "$1" in + --option) + IFS=',' read -r -a options <<<"$2" + shift 2 + ;; + --module) + module="$2" + shift 2 + ;; + --do-test-list) + do_test_list="$2" + shift 2 + ;; + --help) + usage + exit 0 + ;; + --) + shift + break + ;; + *) + echo "Invalid option: $1" + usage + exit 1 + ;; + esac +done + +# Execute options in order +for option in "${options[@]}"; do + case $option in + init) + init + ;; + cleanup) + cleanup + ;; + build) + build "${module:-all}" + ;; + run4debug) + run4debug + ;; + run4mtr) + run4mtr "${do_test_list:-enableCases.list}" + ;; + sync-inverse) + sync-inverse + ;; + sync) + sync + ;; + *) + echo "Invalid option: -$option" >&2 + exit 1 + ;; + esac +done