Skip to content

Commit

Permalink
try fix
Browse files Browse the repository at this point in the history
Signed-off-by: xhe <[email protected]>
  • Loading branch information
xhebox committed Aug 14, 2024
1 parent b20d9bc commit e5d17c7
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions tests/tiup-cluster/script/scale_tiproxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ function scale_tiproxy() {
test_tls=$2
native_ssh=$3

client=""
common_args="--wait-timeout=240"
if [ $native_ssh == true ]; then
client="--ssh=system"
common_args="$common_args --ssh=system"
fi

name="test_scale_tiproxy_$RANDOM"
Expand All @@ -24,22 +24,22 @@ function scale_tiproxy() {
check_cert_file="ls /home/tidb/deploy/tidb-4000/tls/tiproxy-session.crt /home/tidb/deploy/tidb-4000/tls/tiproxy-session.key"
check_cert_config="grep -q session-token-signing-key /home/tidb/deploy/tidb-4000/conf/tidb.toml"

tiup-cluster $client --yes deploy $name $version $topo -i ~/.ssh/id_rsa
tiup-cluster $common_args --yes deploy $name $version $topo -i ~/.ssh/id_rsa

# the session certs exist
tiup-cluster $client exec $name -N n1 --command "$check_cert_file"
tiup-cluster $common_args exec $name -N n1 --command "$check_cert_file"
# the configurations are updated
tiup-cluster $client exec $name -N n1 --command "$check_cert_config"
tiup-cluster $common_args exec $name -N n1 --command "$check_cert_config"

tiup-cluster $client list | grep "$name"
tiup-cluster $common_args list | grep "$name"

tiup-cluster $client --yes start $name
tiup-cluster $common_args --yes start $name

tiup-cluster $client _test $name writable
tiup-cluster $common_args _test $name writable

tiup-cluster $client display $name
tiup-cluster $common_args display $name

tiup-cluster $client --yes reload $name --skip-restart
tiup-cluster $common_args --yes reload $name --skip-restart

if [ $test_tls = true ]; then
total_sub_one=18
Expand All @@ -51,42 +51,42 @@ function scale_tiproxy() {

# disable tiproxy
echo "start scale in tiproxy"
tiup-cluster $client --yes scale-in $name -N n1:6000
tiup-cluster $common_args --yes scale-in $name -N n1:6000
wait_instance_num_reach $name $total $native_ssh

# scale in tidb and scale out again
echo "start scale in tidb"
tiup-cluster $client --yes scale-in $name -N n2:4000
tiup-cluster $common_args --yes scale-in $name -N n2:4000
wait_instance_num_reach $name $total_sub_one $native_ssh
echo "start scale out tidb"
topo=./topo/full_scale_in_tidb_2nd.yaml
tiup-cluster $client --yes scale-out $name $topo
tiup-cluster $common_args --yes scale-out $name $topo
# the session certs don't exist on the new tidb
! tiup-cluster $client exec $name -N n2 --command "$check_cert_file"
! tiup-cluster $common_args exec $name -N n2 --command "$check_cert_file"
# the configurations are not updated on the new tidb
! tiup-cluster $client exec $name -N n2 --command "$check_cert_config"
! tiup-cluster $common_args exec $name -N n2 --command "$check_cert_config"

# enable tiproxy again
echo "start scale out tiproxy"
topo=./topo/full_scale_in_tiproxy.yaml
tiup-cluster $client --yes scale-out $name $topo
tiup-cluster $common_args --yes scale-out $name $topo
# the session certs exist on the new tidb
tiup-cluster $client exec $name -N n2 --command "$check_cert_file"
tiup-cluster $common_args exec $name -N n2 --command "$check_cert_file"
# the configurations are updated on the new tidb
tiup-cluster $client exec $name -N n2 --command "$check_cert_config"
tiup-cluster $common_args exec $name -N n2 --command "$check_cert_config"

# scale in tidb and scale out again
echo "start scale in tidb"
tiup-cluster $client --yes scale-in $name -N n2:4000
tiup-cluster $common_args --yes scale-in $name -N n2:4000
wait_instance_num_reach $name $total $native_ssh
echo "start scale out tidb"
topo=./topo/full_scale_in_tidb_2nd.yaml
tiup-cluster $client --yes scale-out $name $topo
tiup-cluster $common_args --yes scale-out $name $topo
# the session certs exist on the new tidb
tiup-cluster $client exec $name -N n2 --command "$check_cert_file"
tiup-cluster $common_args exec $name -N n2 --command "$check_cert_file"
# the configurations are updated on the new tidb
tiup-cluster $client exec $name -N n2 --command "$check_cert_config"
tiup-cluster $common_args exec $name -N n2 --command "$check_cert_config"

tiup-cluster $client _test $name writable
tiup-cluster $client --yes destroy $name
tiup-cluster $common_args _test $name writable
tiup-cluster $common_args --yes destroy $name
}

0 comments on commit e5d17c7

Please sign in to comment.