github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/dm/tests/dmctl_basic/check_list/start_task.sh (about) 1 #!/bin/bash 2 3 function start_task_wrong_arg() { 4 run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ 5 "start-task" \ 6 "start-task \[-s source ...\] \[--remove-meta\] <config-file> \[flags\]" 1 7 } 8 9 function start_task_wrong_config_file() { 10 run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ 11 "start-task not_exists_config_file" \ 12 "error in get file content" 1 13 } 14 15 function start_task_wrong_start_time_format() { 16 task_conf=$1 17 run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ 18 "start-task $task_conf --start-time '20060102 150405'" \ 19 "error while parse start-time" 1 20 } 21 22 function start_task_not_pass_with_message() { 23 task_conf=$1 24 error_message=$2 25 run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ 26 "start-task $task_conf" \ 27 "$2" 1 28 } 29 30 function start_task_empty_config() { 31 cp $1 /tmp/empty-cfg.yaml 32 sed -i "/threads/d" /tmp/empty-cfg.yaml 33 sed -i "/pool-size/d" /tmp/empty-cfg.yaml 34 sed -i "/worker-count/d" /tmp/empty-cfg.yaml 35 run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ 36 "start-task /tmp/empty-cfg.yaml" \ 37 "\"result\": true" 2 38 run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ 39 "config task empty-unit-task" \ 40 "threads: 4" 1 \ 41 "pool-size: 16" 1 \ 42 "worker-count: 16" 1 43 run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ 44 "stop-task $1" \ 45 "\"result\": true" 2 46 } 47 48 function start_task_wrong_no_source_meta() { 49 task_conf=$1 50 run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ 51 "start-task $task_conf" \ 52 "must specify \`binlog-name\` without GTID enabled for the source or specify \`binlog-gtid\` with GTID enabled for the source" 1 53 } 54 55 function start_task_no_source_meta_but_start_time() { 56 task_conf=$1 57 run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ 58 "start-task $task_conf --start-time '2006-01-02 15:04:05'" \ 59 "\"result\": true" 3 60 run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \ 61 "query-status test_incremental_no_source_meta" \ 62 "\"result\": true" 3 63 }