Test: cluster/base, check that we can write/read from cluster.

This commit is contained in:
antirez 2014-05-02 16:37:12 +02:00
parent 3bc119c155
commit 1c130c6b03
2 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,7 @@
cd tests/cluster
source cluster.tcl
source ../instances.tcl
source ../../support/cluster.tcl ; # Redis Cluster client.
set ::instances_count 20 ; # How many instances we use at max.

View File

@ -94,3 +94,15 @@ test "Nodes should report cluster_state is ok now" {
}
}
}
test "It is possible to write and read from the cluster" {
set port [get_instance_attrib redis 0 port]
set cluster [redis_cluster 127.0.0.1:$port]
for {set j 0} {$j < 100} {incr j} {
$cluster set key.$j $j
}
for {set j 0} {$j < 100} {incr j} {
assert {[$cluster get key.$j] eq $j}
}
$cluster close
}