github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/cli/interactive_tests/test_url_login.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 the client can start when no username is specified." 8 # This is run as an acceptance test to ensure that the code path 9 # that generates the interactive prompt presented to the user is 10 # also exercised by the test. 11 spawn $argv sql --url "postgresql://localhost:26257?sslmode=disable" 12 eexpect @localhost 13 send_eof 14 eexpect eof 15 16 end_test 17 18 stop_server $argv 19 20 start_test "Check that the unix socket can be used simply." 21 22 # Start a server with a socket listener. 23 set mywd [pwd] 24 25 system "$argv start-single-node --insecure --pid-file=server_pid --socket-dir=. --background -s=path=logs/db >>logs/expect-cmd.log 2>&1; 26 $argv sql --insecure -e 'select 1'" 27 28 spawn $argv sql --url "postgresql://?host=$mywd&port=26257" 29 eexpect "Enter password" 30 send "insecure\r" 31 eexpect root@ 32 send_eof 33 eexpect eof 34 35 stop_server $argv 36 37 end_test