Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
f80f3f49
Unverified
Commit
f80f3f49
authored
Aug 23, 2020
by
Yossi Gottlieb
Committed by
GitHub
Aug 23, 2020
Browse files
Tests: fix redis-cli with remote hosts. (#7693)
parent
e61adc0d
Changes
3
Hide whitespace changes
Inline
Side-by-side
tests/integration/redis-cli.tcl
View file @
f80f3f49
...
@@ -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
\"
"
...
...
tests/support/cli.tcl
View file @
f80f3f49
...
@@ -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
...
...
tests/unit/wait.tcl
View file @
f80f3f49
...
@@ -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
_
hos
t debug sleep 5"
]
set cmd
[
rediscli $slave_
host
$slave_
por
t
"
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment