Skip to content

Commit

Permalink
fix(tests): when set -e the error raised first then pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvisa committed Nov 24, 2020
1 parent 5c2f7cd commit 4e5f4e9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/tiup-cluster/script/cmd_subtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ function cmd_subtest() {
tiup-cluster $client --yes destroy $name

# after destroy the cluster, the public key should be deleted
ssh -o "StrictHostKeyChecking=no" -o "PasswordAuthentication=no" -i "/tmp/$name.id_rsa" tidb@$ipprefix.102 "ls" 2>&1 | grep "Permission denied"
! ssh -o "StrictHostKeyChecking=no" -o "PasswordAuthentication=no" -i "/tmp/$name.id_rsa" tidb@$ipprefix.101 "ls"
unlink "/tmp/$name.id_rsa"
}
2 changes: 1 addition & 1 deletion tests/tiup-cluster/script/scale_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function scale_core() {
! 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"
# after all components on the node were scale-ined, the SSH public is automatically deleted
ssh -o "StrictHostKeyChecking=no "-o "PasswordAuthentication=no" -i ~/.tiup/storage/cluster/$name/ssh/id_rsa tidb@$ipprefix.102 "ls" 2>&1 | grep "Permission denied"
! ssh -o "StrictHostKeyChecking=no "-o "PasswordAuthentication=no" -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
2 changes: 1 addition & 1 deletion tests/tiup-dm/test_cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ 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 -o "StrictHostKeyChecking=no" -o "PasswordAuthentication=no" -i "/tmp/$name.id_rsa" tidb@$ipprefix.102 "ls" 2>&1 | grep "Permission denied"
! ssh -o "StrictHostKeyChecking=no" -o "PasswordAuthentication=no" -i "/tmp/$name.id_rsa" tidb@$ipprefix.102 "ls"
unlink "/tmp/$name.id_rsa"

0 comments on commit 4e5f4e9

Please sign in to comment.