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
1206bdf1
Commit
1206bdf1
authored
Jun 23, 2014
by
antirez
Browse files
Basic tests for the ROLE command.
parent
fb2f637c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/integration/replication.tcl
View file @
1206bdf1
...
@@ -74,6 +74,23 @@ start_server {tags {"repl"}} {
...
@@ -74,6 +74,23 @@ start_server {tags {"repl"}} {
if
{
$::valgrind
}
{
after 2000
}
if
{
$::valgrind
}
{
after 2000
}
list
[
r -1 dbsize
]
[
r 0 dbsize
]
list
[
r -1 dbsize
]
[
r 0 dbsize
]
}
{
0 0
}
}
{
0 0
}
test
{
ROLE in master reports master with a slave
}
{
set res
[
r -1 role
]
lassign $res role offset slaves
assert
{
$role
eq
{
master
}}
assert
{
$offset
> 0
}
assert
{[
llength $slaves
]
== 1
}
lassign
[
lindex $slaves 0
]
master_host master_port slave_offset
assert
{
$slave
_offset < $offset
}
}
test
{
ROLE in slave reports slave in connected state
}
{
set res
[
r role
]
lassign $res role master_host master_port slave_state slave_offset
assert
{
$role
eq
{
slave
}}
assert
{
$slave
_state eq
{
connected
}}
}
}
}
}
}
...
...
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