mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Tests: fix redis-cli with remote hosts. (#7693)
This commit is contained in:
parent
e61adc0d89
commit
f80f3f492a
@ -3,7 +3,7 @@ source tests/support/cli.tcl
|
||||
start_server {tags {"cli"}} {
|
||||
proc open_cli {{opts "-n 9"} {infile ""}} {
|
||||
set ::env(TERM) dumb
|
||||
set cmdline [rediscli [srv port] $opts]
|
||||
set cmdline [rediscli [srv host] [srv port] $opts]
|
||||
if {$infile ne ""} {
|
||||
set cmdline "$cmdline < $infile"
|
||||
set mode "r"
|
||||
@ -65,7 +65,7 @@ start_server {tags {"cli"}} {
|
||||
}
|
||||
|
||||
proc _run_cli {opts args} {
|
||||
set cmd [rediscli [srv port] [list -n 9 {*}$args]]
|
||||
set cmd [rediscli [srv host] [srv port] [list -n 9 {*}$args]]
|
||||
foreach {key value} $opts {
|
||||
if {$key eq "pipe"} {
|
||||
set cmd "sh -c \"$value | $cmd\""
|
||||
|
@ -11,8 +11,8 @@ proc rediscli_tls_config {testsdir} {
|
||||
}
|
||||
}
|
||||
|
||||
proc rediscli {port {opts {}}} {
|
||||
set cmd [list src/redis-cli -p $port]
|
||||
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
|
||||
|
@ -33,7 +33,7 @@ start_server {} {
|
||||
}
|
||||
|
||||
test {WAIT should not acknowledge 1 additional copy if slave is blocked} {
|
||||
set cmd [rediscli $slave_port "-h $slave_host debug sleep 5"]
|
||||
set cmd [rediscli $slave_host $slave_port "debug sleep 5"]
|
||||
exec {*}$cmd > /dev/null 2> /dev/null &
|
||||
after 1000 ;# Give redis-cli the time to execute the command.
|
||||
$master set foo 0
|
||||
|
Loading…
Reference in New Issue
Block a user