github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/cli/interactive_tests/test_high_verbosity.tcl (about)

     1  #! /usr/bin/env expect -f
     2  
     3  source [file join [file dirname $argv0] common.tcl]
     4  
     5  system "mkfifo url_fifo || true; $argv start-single-node --insecure --vmodule=*=3 --pid-file=server_pid --listening-url-file=url_fifo -s=path=logs/db & cat url_fifo > server_url"
     6  
     7  spawn /bin/bash
     8  send "PS1=':''/# '\r"
     9  eexpect ":/# "
    10  
    11  start_test "Check that queries using tables can complete without error."
    12  send "echo 'create database d; create table d.t(x int); insert into d.t values(1); select x from d.t;' | $argv sql\r"
    13  eexpect "1 row"
    14  eexpect ":/# "
    15  send "echo 'select x\[1\] from (select array\[1,2,3\]) as t(x);' | $argv sql\r"
    16  eexpect "1 row"
    17  eexpect ":/# "
    18  end_test
    19  
    20  start_test "Check that the node is alive."
    21  send "$argv node status\r"
    22  eexpect ":/# "
    23  send "echo \$?\r"
    24  eexpect "\r\n0\r\n"
    25  eexpect ":/# "
    26  end_test
    27  
    28  stop_server $argv