vitess.io/vitess@v0.16.2/test/client_test.sh (about) 1 #!/bin/bash 2 3 # Copyright 2019 The Vitess Authors. 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 17 # This runs client tests. It used to be part of local_example, 18 # but has been moved to its own test. It hijacks the public examples scripts 19 20 source build.env 21 22 set -xe 23 cd "$VTROOT/examples/common/scripts" 24 25 CELL=test ./etcd-up.sh 26 CELL=test ./vtctld-up.sh 27 28 for i in 100 101 102; do 29 CELL=test TABLET_UID=$i ./mysqlctl-up.sh 30 CELL=test KEYSPACE=test_keyspace TABLET_UID=$i ./vttablet-up.sh 31 done 32 33 vtctlclient --server localhost:15999 InitShardPrimary -- --force test_keyspace/0 test-100 34 35 vtctlclient --server localhost:15999 ApplySchema -- --sql-file ../../local/create_test_table.sql test_keyspace 36 vtctlclient --server localhost:15999 RebuildVSchemaGraph 37 38 CELL=test ./vtgate-up.sh 39 40 echo "Run Go client script..." 41 go run $VTROOT/test/client/client.go --server=localhost:15991 42 43 echo "Run Java client script..." 44 $VTROOT/test/client_java.sh 45 46 echo "Run JDBC client script..." 47 $VTROOT/test/client_jdbc.sh 48 49 # Clean up 50 51 ./vtgate-down.sh 52 53 for i in 100 101 102; do 54 CELL=test TABLET_UID=$i ./vttablet-down.sh 55 CELL=test TABLET_UID=$i ./mysqlctl-down.sh 56 done 57 58 ./vtctld-down.sh 59 CELL=test ./etcd-down.sh 60