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
e244bee6
Commit
e244bee6
authored
Apr 29, 2014
by
antirez
Browse files
Cluster test: check that every node has a different ID.
parent
6b4e9558
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/cluster/tests/00-base.tcl
View file @
e244bee6
...
...
@@ -8,9 +8,23 @@ if {$::simulate_error} {
}
}
test
"Cluster nodes are reachable
.
"
{
test
"Cluster nodes are reachable"
{
foreach_redis_id id
{
# Every node should just know itself.
assert
{[
R $id ping
]
eq
{
PONG
}}
}
}
test
"Different nodes have different IDs"
{
set ids
{}
set numnodes 0
foreach_redis_id id
{
incr numnodes
# Every node should just know itself.
set nodeid
[
dict get
[
get_myself $id
]
id
]
assert
{
$nodeid
ne
{}}
lappend ids $nodeid
}
set numids
[
llength
[
lsort -unique $ids
]]
assert
{
$numids
== $numnodes
}
}
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