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
c17a0e13
Commit
c17a0e13
authored
Jan 09, 2018
by
antirez
Browse files
Test: MIGRATE AUTH test added.
Related to #2507.
parent
3ce1c28d
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/dump.tcl
View file @
c17a0e13
...
...
@@ -308,4 +308,28 @@ start_server {tags {"dump"}} {
}
}
test
{
MIGRATE AUTH: correct and wrong password cases
}
{
set first
[
srv 0 client
]
r del list
r lpush list a b c d
start_server
{
tags
{
"repl"
}}
{
set second
[
srv 0 client
]
set second_host
[
srv 0 host
]
set second_port
[
srv 0 port
]
$second config set requirepass foobar
$second auth foobar
assert
{[
$first
exists list
]
== 1
}
assert
{[
$second
exists list
]
== 0
}
set ret
[
r -1 migrate $second_host $second_port list 9 5000 AUTH foobar
]
assert
{
$ret
eq
{
OK
}}
assert
{[
$second
exists list
]
== 1
}
assert
{[
$second
lrange list 0 -1
]
eq
{
d c b a
}}
r -1 lpush list a b c d
$second config set requirepass foobar2
catch
{
r -1 migrate $second_host $second_port list 9 5000 AUTH foobar
}
err
assert_match
{
*invalid password*
}
$err
}
}
}
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