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
jsvisa committed Nov 17, 2020
1 parent 9934af2 commit 8592330
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
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
11 changes: 8 additions & 3 deletions 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,8 +72,13 @@ yes | tiup-dm scale-out $name $topo_worker
# test create a task and can replicate data
./script/task/run.sh

tiup-dm --yes destroy $name

# test dm log dir
tiup-dm notfound-command 2>&1 | grep $HOME/.tiup/logs/tiup-dm-debug
TIUP_LOG_PATH=/tmp/a/b tiup-dm notfound-command 2>&1 | grep /tmp/a/b/tiup-dm-debug

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 8592330

Please sign in to comment.