github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/cli/interactive_tests/test_cluster_name.tcl (about) 1 #! /usr/bin/env expect -f 2 # 3 source [file join [file dirnam $argv0] common.tcl] 4 5 # Start a server with a --join flag so the init command is required 6 # (even though we have no intention of starting a second node). Note that unlike other 7 # expect-based tests, this one doesn't use a fifo for --pid_file 8 # because we don't want reads from that fifo to change the outcome. 9 system "$argv start --insecure --pid-file=server_pid -s=path=logs/db --listen-addr=localhost --background --join=localhost:26258 --cluster-name=foo >>logs/expect-cmd.log 2>&1" 10 11 start_test "Check that the server has informed us and the log file that it was ready before forking off in the background" 12 system "grep -q 'initial startup completed' logs/db/logs/cockroach.log" 13 system "grep -q 'will now attempt to join a running cluster, or wait' logs/db/logs/cockroach.log" 14 end_test 15 16 start_test "Check that init works with a cluster-name provided" 17 system "$argv init --insecure --host=localhost --cluster-name=foo" 18 end_test 19 20 start_test "Check that decommission works with a cluster-name provided" 21 send "$argv node decommission 1 --insecure --host=localhost --wait=none --cluster-name=foo\r" 22 end_test 23 24 start_test "Check that recommission works with cluster name verification disabled" 25 send "$argv node recommission 1 --insecure --host=localhost --disable-cluster-name-verification\r" 26 end_test 27 28 start_test "Check that debug commands work with a cluster name provided" 29 send "$argv debug gossip-values --insecure --host=localhost --cluster-name=foo\r" 30 end_test 31 32 start_test "Check that quit works with a cluster-name provided" 33 send "$argv quit --insecure --host=localhost --wait=none --cluster-name=foo\r" 34 end_test 35 36 stop_server $argv