}
proc kill_server config {
+ # nothing to kill when running against external server
+ if {$::external} return
+
# nevermind if its already dead
if {![is_alive $config]} { return }
set pid [dict get $config pid]
}
proc start_server {options {code undefined}} {
+ # If we are runnign against an external server, we just push the
+ # host/port pair in the stack the first time
+ if {$::external} {
+ if {[llength $::servers] == 0} {
+ set srv {}
+ dict set srv "host" $::host
+ dict set srv "port" $::port
+ set client [redis $::host $::port]
+ dict set srv "client" $client
+ $client select 9
+
+ # append the server to the stack
+ lappend ::servers $srv
+ }
+ uplevel 1 $code
+ return
+ }
+
# setup defaults
set baseconfig "default.conf"
set overrides {}
set ::valgrind 0
set ::denytags {}
set ::allowtags {}
+set ::external 0; # If "1" this means, we are running against external instance
proc execute_tests name {
source "tests/$name.tcl"
}
}
incr j
+ } elseif {$opt eq {--host}} {
+ set ::external 1
+ set ::host $arg
+ incr j
+ } elseif {$opt eq {--port}} {
+ set ::port $arg
+ incr j
} else {
puts "Wrong argument: $opt"
exit 1