Unverified Commit f80f3f49 authored by Yossi Gottlieb's avatar Yossi Gottlieb Committed by GitHub
Browse files

Tests: fix redis-cli with remote hosts. (#7693)

parent e61adc0d
...@@ -3,7 +3,7 @@ source tests/support/cli.tcl ...@@ -3,7 +3,7 @@ source tests/support/cli.tcl
start_server {tags {"cli"}} { start_server {tags {"cli"}} {
proc open_cli {{opts "-n 9"} {infile ""}} { proc open_cli {{opts "-n 9"} {infile ""}} {
set ::env(TERM) dumb set ::env(TERM) dumb
set cmdline [rediscli [srv port] $opts] set cmdline [rediscli [srv host] [srv port] $opts]
if {$infile ne ""} { if {$infile ne ""} {
set cmdline "$cmdline < $infile" set cmdline "$cmdline < $infile"
set mode "r" set mode "r"
...@@ -65,7 +65,7 @@ start_server {tags {"cli"}} { ...@@ -65,7 +65,7 @@ start_server {tags {"cli"}} {
} }
proc _run_cli {opts args} { 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 { foreach {key value} $opts {
if {$key eq "pipe"} { if {$key eq "pipe"} {
set cmd "sh -c \"$value | $cmd\"" set cmd "sh -c \"$value | $cmd\""
......
...@@ -11,8 +11,8 @@ proc rediscli_tls_config {testsdir} { ...@@ -11,8 +11,8 @@ proc rediscli_tls_config {testsdir} {
} }
} }
proc rediscli {port {opts {}}} { proc rediscli {host port {opts {}}} {
set cmd [list src/redis-cli -p $port] set cmd [list src/redis-cli -h $host -p $port]
lappend cmd {*}[rediscli_tls_config "tests"] lappend cmd {*}[rediscli_tls_config "tests"]
lappend cmd {*}$opts lappend cmd {*}$opts
return $cmd return $cmd
......
...@@ -33,7 +33,7 @@ start_server {} { ...@@ -33,7 +33,7 @@ start_server {} {
} }
test {WAIT should not acknowledge 1 additional copy if slave is blocked} { 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 & exec {*}$cmd > /dev/null 2> /dev/null &
after 1000 ;# Give redis-cli the time to execute the command. after 1000 ;# Give redis-cli the time to execute the command.
$master set foo 0 $master set foo 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment