Skip to content

Commit

Permalink
test(cluster,dm): test public key should be deleted from remote
Browse files Browse the repository at this point in the history
  • Loading branch information
9547 committed Nov 16, 2020
1 parent 907643d commit 4d3b121
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/tiup-cluster/script/cmd_subtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@ function cmd_subtest() {

! tiup-cluster $client _test $name data

cp "~/.tiup/storage/cluster/$name/ssh/id_rsa" "/tmp/$name.id_rsa"
tiup-cluster $client --yes destroy $name

# after destroy the cluster, the public key should be deleted
! ssh -i "/tmp/$name.id_rsa" tidb@$ipprefix.101 "ls"
unlink "/tmp/$name.id_rsa"
}
2 changes: 2 additions & 0 deletions tests/tiup-cluster/script/scale_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ function scale_core() {
! tiup-cluster $client exec $name -N $ipprefix.102 --command "ls /home/tidb/deploy/monitor-9100/deploy/monitor-9100"
! tiup-cluster $client exec $name -N $ipprefix.102 --command "ps aux | grep node_exporter | grep -qv grep"
! tiup-cluster $client exec $name -N $ipprefix.102 --command "ps aux | grep blackbox_exporter | grep -qv grep"
# public key should be deleted
! ssh -i "~/.tiup/storage/cluster/$name/ssh/id_rsa" tidb@$ipprefix.102 "ls"

echo "start scale out tidb"
topo=./topo/full_scale_in_tidb.yaml
Expand Down
7 changes: 6 additions & 1 deletion tests/tiup-dm/test_cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ total_sub_one=12
echo "start scale in dm-master"
tiup-dm --yes scale-in $name -N $ipprefix.101:8261
wait_instance_num_reach $name $total_sub_one false
echo "start scale out dm-master"

echo "start scale out dm-master"
topo_master=./topo/full_scale_in_dm-master.yaml
sed "s/__IPPREFIX__/$ipprefix/g" $topo_master.tpl > $topo_master
tiup-dm --yes scale-out $name $topo_master
Expand All @@ -72,4 +72,9 @@ yes | tiup-dm scale-out $name $topo_worker
# test create a task and can replicate data
./script/task/run.sh

cp "~/.tiup/storage/dm/clusters/$name/ssh/id_rsa" "/tmp/$name.id_rsa"
tiup-dm --yes destroy $name

# after destroy the cluster, the public key should be deleted
! ssh -i "/tmp/$name.id_rsa" tidb@$ipprefix.102 "ls"
unlink "/tmp/$name.id_rsa"

0 comments on commit 4d3b121

Please sign in to comment.