Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: enable tls test for DM #10414

Merged
merged 7 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dm/master/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ func genEmbedEtcdConfigWithLogger(logLevel string) *embed.Config {
cfg := embed.NewConfig()
// disable grpc gateway because https://github.com/etcd-io/etcd/issues/12713
// TODO: wait above issue fixed
// cfg.EnableGRPCGateway = true // enable gRPC gateway for the internal etcd.
cfg.EnableGRPCGateway = false // enable gRPC gateway for the internal etcd.

// use zap as the logger for embed etcd
// NOTE: `genEmbedEtcdConfig` can only be called after logger initialized.
Expand Down
33 changes: 17 additions & 16 deletions dm/tests/tls/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ function test_master_ha_when_enable_tidb_and_only_ca_source_tls() {
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"
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"

# https://github.com/pingcap/dm/issues/1458
# check the log is not repeatedly printed
check_log_not_contains $WORK_DIR/master1/log/dm-master.log "remote error: tls: bad certificate"
check_log_not_contains $WORK_DIR/master1/log/dm-master.log "client certificate authentication failed"

echo "use common name not in 'cert-allowed-cn' should not request success"
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

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

# https://github.com/pingcap/dm/issues/1458
# check the log is not repeatedly printed
check_log_contains $WORK_DIR/master1/log/dm-master.log "remote error: tls: bad certificate" 1

echo "============================== test_master_ha_when_enable_tidb_and_only_ca_source_tls success =================================="
}

Expand Down Expand Up @@ -384,17 +385,17 @@ function run() {
test_source_and_target_with_empty_tlsconfig
}

#cleanup_data tls
#cleanup_process
#
#run
#
## kill the tidb with tls
#pkill -hup tidb-server 2>/dev/null || true
#wait_process_exit tidb-server
#
#run_tidb_server 4000 $TIDB_PASSWORD
#
#cleanup_process
cleanup_data tls
cleanup_process

run

# kill the tidb with tls
pkill -hup tidb-server 2>/dev/null || true
wait_process_exit tidb-server

run_tidb_server 4000 $TIDB_PASSWORD

cleanup_process

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