From 3bdbb6423c504bf629a349cee79ea50ac20f019b Mon Sep 17 00:00:00 2001 From: Xiaoguang Sun Date: Sat, 7 Dec 2024 17:30:16 +0800 Subject: [PATCH] Add test case Signed-off-by: Xiaoguang Sun --- dm/tests/tls/conf/dm-task-3.yaml | 49 ++++++++++++++++++++++++++++++++ dm/tests/tls/run.sh | 8 ++++++ 2 files changed, 57 insertions(+) create mode 100644 dm/tests/tls/conf/dm-task-3.yaml diff --git a/dm/tests/tls/conf/dm-task-3.yaml b/dm/tests/tls/conf/dm-task-3.yaml new file mode 100644 index 00000000000..e172a098040 --- /dev/null +++ b/dm/tests/tls/conf/dm-task-3.yaml @@ -0,0 +1,49 @@ +--- +name: test3 +task-mode: all +shard-mode: "pessimistic" +meta-schema: "dm_meta" + +target-database: + host: "127.0.0.1" + port: 4400 + user: "root" + password: "" + security: + ssl-ca: "dir-placeholer/task-ca.pem" + ssl-cert: "dir-placeholer/dm.pem" + ssl-key: "dir-placeholer/dm.key" + +mysql-instances: + - source-id: "mysql-replica-01" + black-white-list: "instance" + route-rules: ["route-rule-1"] + mydumper-config-name: "global" + loader-config-name: "global" + syncer-config-name: "global" + +black-white-list: + instance: + do-dbs: ["tls"] + +routes: + route-rule-1: + schema-pattern: "tls" + target-schema: "tls3" + +mydumpers: + global: + threads: 4 + chunk-filesize: 0 + skip-tz-utc: true + extra-args: "--statement-size=100" + +loaders: + global: + pool-size: 16 + dir: "./dumped_data" + +syncers: + global: + worker-count: 16 + batch: 100 diff --git a/dm/tests/tls/run.sh b/dm/tests/tls/run.sh index 3fc76387f38..4c7b80be23d 100644 --- a/dm/tests/tls/run.sh +++ b/dm/tests/tls/run.sh @@ -103,6 +103,7 @@ function test_worker_handle_multi_tls_tasks() { cp $cur/conf/dm-worker2.toml $WORK_DIR/ cp $cur/conf/dm-task.yaml $WORK_DIR/ cp $cur/conf/dm-task-2.yaml $WORK_DIR/ + cp $cur/conf/dm-task-3.yaml $WORK_DIR/ sed -i "s%dir-placeholer%$cur\/conf%g" $WORK_DIR/dm-master1.toml sed -i "s%dir-placeholer%$cur\/conf%g" $WORK_DIR/dm-master2.toml @@ -111,6 +112,7 @@ function test_worker_handle_multi_tls_tasks() { sed -i "s%dir-placeholer%$cur\/conf%g" $WORK_DIR/dm-worker2.toml sed -i "s%dir-placeholer%$cur\/conf%g" $WORK_DIR/dm-task.yaml sed -i "s%dir-placeholer%$cur\/conf%g" $WORK_DIR/dm-task-2.yaml + sed -i "s%dir-placeholer%$cur\/conf%g" $WORK_DIR/dm-task-3.yaml run_dm_master $WORK_DIR/master1 $MASTER_PORT1 $WORK_DIR/dm-master1.toml run_dm_master $WORK_DIR/master2 $MASTER_PORT2 $WORK_DIR/dm-master2.toml @@ -133,6 +135,8 @@ function test_worker_handle_multi_tls_tasks() { "start-task $WORK_DIR/dm-task.yaml --remove-meta=true" run_dm_ctl_with_tls_and_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" $cur/conf/ca.pem $cur/conf/dm.pem $cur/conf/dm.key \ "start-task $WORK_DIR/dm-task-2.yaml --remove-meta=true" + run_dm_ctl_with_tls_and_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" $cur/conf/ca.pem $cur/conf/dm.pem $cur/conf/dm.key \ + "start-task $WORK_DIR/dm-task-3.yaml --remove-meta=true" run_dm_ctl_with_tls_and_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" $cur/conf/ca.pem $cur/conf/dm.pem $cur/conf/dm.key \ "query-status test" \ @@ -142,6 +146,10 @@ function test_worker_handle_multi_tls_tasks() { "query-status test2" \ "\"result\": true" 2 \ "\"unit\": \"Sync\"" 1 + run_dm_ctl_with_tls_and_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" $cur/conf/ca.pem $cur/conf/dm.pem $cur/conf/dm.key \ + "query-status test3" \ + "\"result\": true" 2 \ + "\"unit\": \"Sync\"" 1 echo "check data" check_sync_diff $WORK_DIR $cur/conf/diff_config.toml