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

     1  #! /usr/bin/env expect -f
     2  
     3  source [file join [file dirname $argv0] common.tcl]
     4  
     5  start_test "Ensure demo commands are not available in the sql shell"
     6  
     7  # Set up the initial cluster.
     8  start_server $argv
     9  
    10  # Spawn a sql shell.
    11  spawn $argv sql
    12  set client_spawn_id $spawn_id
    13  eexpect root@
    14  
    15  # Ensure the demo command does not work.
    16  send "\\demo shutdown 2\n"
    17  eexpect "\\demo can only be run with cockroach demo"
    18  
    19  # Exit the shell.
    20  interrupt
    21  eexpect eof
    22  
    23  # Have good manners and clean up.
    24  stop_server $argv
    25  
    26  end_test