github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/cli/interactive_tests/test_multiple_nodes.tcl (about) 1 #! /usr/bin/env expect -f 2 3 source [file join [file dirname $argv0] common.tcl] 4 5 start_server $argv 6 7 start_test "Check that it is possible to add nodes to a server started with start-single-node" 8 9 system "$argv start --insecure --port=26258 --max-sql-memory=128MB --http-port=8083 --pid-file=server_pid2 --background -s=path=logs/db2 --join=:26257 >>logs/expect-cmd.log 2>&1; 10 $argv sql -e 'select 1' --port=26258" 11 12 system "$argv start --insecure --port=26259 --max-sql-memory=128MB --http-port=8084 --pid-file=server_pid3 --background -s=path=logs/db3 --join=:26257 >>logs/expect-cmd.log 2>&1; 13 $argv sql -e 'select 1' --port=26259" 14 15 # Check the number of nodes 16 spawn $argv node ls 17 eexpect id 18 eexpect "3 rows" 19 eexpect eof 20 21 end_test 22 23 24 start_test "Check that a double decommission prints out a warning" 25 spawn $argv node decommission 2 --wait none 26 eexpect eof 27 28 spawn $argv node decommission 2 --wait none 29 eexpect "warning: node 2 is already decommissioning or decommissioned" 30 eexpect eof 31 end_test 32 33 start_test "Check that a double recommission prints out a warning" 34 spawn $argv node recommission 2 35 eexpect eof 36 37 spawn $argv node recommission 2 38 eexpect "warning: node 2 is not decommissioned" 39 eexpect eof 40 end_test 41 42 43 # Kill the cluster. We don't care about what happens next in this test, 44 # and this makes the test complete faster. 45 system "kill -KILL `cat server_pid` `cat server_pid2` `cat server_pid3`"