Skip to content

Commit 368d20f

Browse files
authored
test: enable tls test for DM (#10414)
close #10413
1 parent a4fe012 commit 368d20f

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

dm/master/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ func genEmbedEtcdConfigWithLogger(logLevel string) *embed.Config {
450450
cfg := embed.NewConfig()
451451
// disable grpc gateway because https://github.com/etcd-io/etcd/issues/12713
452452
// TODO: wait above issue fixed
453-
// cfg.EnableGRPCGateway = true // enable gRPC gateway for the internal etcd.
453+
cfg.EnableGRPCGateway = false // enable gRPC gateway for the internal etcd.
454454

455455
// use zap as the logger for embed etcd
456456
// NOTE: `genEmbedEtcdConfig` can only be called after logger initialized.

dm/tests/tls/run.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,11 @@ function test_master_ha_when_enable_tidb_and_only_ca_source_tls() {
292292
check_rpc_alive $cur/../bin/check_master_online_http 127.0.0.1:$MASTER_PORT1 "$cur/conf/ca.pem" "$cur/conf/dm.pem" "$cur/conf/dm.key"
293293
check_rpc_alive $cur/../bin/check_master_http_apis 127.0.0.1:$MASTER_PORT1 "$cur/conf/ca.pem" "$cur/conf/dm.pem" "$cur/conf/dm.key"
294294

295+
# https://github.com/pingcap/dm/issues/1458
296+
# check the log is not repeatedly printed
297+
check_log_not_contains $WORK_DIR/master1/log/dm-master.log "remote error: tls: bad certificate"
298+
check_log_not_contains $WORK_DIR/master1/log/dm-master.log "client certificate authentication failed"
299+
295300
echo "use common name not in 'cert-allowed-cn' should not request success"
296301
check_rpc_alive $cur/../bin/check_master_online_http 127.0.0.1:$MASTER_PORT1 "$cur/conf/ca.pem" "$cur/conf/other.pem" "$cur/conf/other.key" && exit 1 || true
297302

@@ -307,10 +312,6 @@ function test_master_ha_when_enable_tidb_and_only_ca_source_tls() {
307312
echo "check data"
308313
check_sync_diff $WORK_DIR $cur/conf/diff_config.toml
309314

310-
# https://github.com/pingcap/dm/issues/1458
311-
# check the log is not repeatedly printed
312-
check_log_contains $WORK_DIR/master1/log/dm-master.log "remote error: tls: bad certificate" 1
313-
314315
echo "============================== test_master_ha_when_enable_tidb_and_only_ca_source_tls success =================================="
315316
}
316317

@@ -384,17 +385,17 @@ function run() {
384385
test_source_and_target_with_empty_tlsconfig
385386
}
386387

387-
#cleanup_data tls
388-
#cleanup_process
389-
#
390-
#run
391-
#
392-
## kill the tidb with tls
393-
#pkill -hup tidb-server 2>/dev/null || true
394-
#wait_process_exit tidb-server
395-
#
396-
#run_tidb_server 4000 $TIDB_PASSWORD
397-
#
398-
#cleanup_process
388+
cleanup_data tls
389+
cleanup_process
390+
391+
run
392+
393+
# kill the tidb with tls
394+
pkill -hup tidb-server 2>/dev/null || true
395+
wait_process_exit tidb-server
396+
397+
run_tidb_server 4000 $TIDB_PASSWORD
398+
399+
cleanup_process
399400

400401
echo "[$(date)] <<<<<< test case $TEST_NAME success! >>>>>>"

0 commit comments

Comments
 (0)