Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoguang Sun <[email protected]>
  • Loading branch information
sunxiaoguang authored and ti-chi-bot committed Dec 11, 2024
1 parent ace8f21 commit 3bdbb64
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
49 changes: 49 additions & 0 deletions dm/tests/tls/conf/dm-task-3.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions dm/tests/tls/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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" \
Expand All @@ -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
Expand Down

0 comments on commit 3bdbb64

Please sign in to comment.