mirror of
http://github.com/valkey-io/valkey
synced 2024-11-23 11:51:01 +00:00
07b0d144ce
* Specifying an empty `bind ""` configuration prevents Redis from listening on any TCP port. Before this commit, such configuration was not accepted. * Using `CONFIG GET bind` will always return an explicit configuration value. Before this commit, if a bind address was not specified the returned value was empty (which was an anomaly). Another behavior change is that modifying the `bind` configuration to a non-default value will NO LONGER DISABLE protected-mode implicitly.
37 lines
1.1 KiB
Tcl
37 lines
1.1 KiB
Tcl
proc rediscli_tls_config {testsdir} {
|
|
set tlsdir [file join $testsdir tls]
|
|
set cert [file join $tlsdir client.crt]
|
|
set key [file join $tlsdir client.key]
|
|
set cacert [file join $tlsdir ca.crt]
|
|
|
|
if {$::tls} {
|
|
return [list --tls --cert $cert --key $key --cacert $cacert]
|
|
} else {
|
|
return {}
|
|
}
|
|
}
|
|
|
|
# Returns command line for executing redis-cli
|
|
proc rediscli {host port {opts {}}} {
|
|
set cmd [list src/redis-cli -h $host -p $port]
|
|
lappend cmd {*}[rediscli_tls_config "tests"]
|
|
lappend cmd {*}$opts
|
|
return $cmd
|
|
}
|
|
|
|
# Returns command line for executing redis-cli with a unix socket address
|
|
proc rediscli_unixsocket {unixsocket {opts {}}} {
|
|
return [list src/redis-cli -s $unixsocket {*}$opts]
|
|
}
|
|
|
|
# Run redis-cli with specified args on the server of specified level.
|
|
# Returns output broken down into individual lines.
|
|
proc rediscli_exec {level args} {
|
|
set cmd [rediscli_unixsocket [srv $level unixsocket] $args]
|
|
set fd [open "|$cmd" "r"]
|
|
set ret [lrange [split [read $fd] "\n"] 0 end-1]
|
|
close $fd
|
|
|
|
return $ret
|
|
}
|