diff options
author | antirez <antirez@gmail.com> | 2014-05-23 11:41:50 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-05-23 11:41:50 +0200 |
commit | aa5dfb3c2ca93c4238cd9b80d312dedd777a187e (patch) | |
tree | f3d468e65aa29be4833b3f571754c0f952b843c1 /tests/cluster/cluster.tcl | |
parent | a700bc74a8094c6bcb310aab7b4494d880c5de6c (diff) | |
download | redis-aa5dfb3c2ca93c4238cd9b80d312dedd777a187e.tar.gz |
Cluster test: move basic read/write test into a procedure.
Diffstat (limited to 'tests/cluster/cluster.tcl')
-rw-r--r-- | tests/cluster/cluster.tcl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/cluster/cluster.tcl b/tests/cluster/cluster.tcl index 46b4a6303..55f979f2f 100644 --- a/tests/cluster/cluster.tcl +++ b/tests/cluster/cluster.tcl @@ -106,3 +106,25 @@ proc create_cluster {masters slaves} { } assert_cluster_state ok } + +# Set the cluster node-timeout to all the reachalbe nodes. +proc set_cluster_node_timeout {to} { + foreach_redis_id id { + catch {R $id CONFIG SET cluster-node-timeout $to} + } +} + +# Check if the cluster is writable and readable. Use node "id" +# as a starting point to talk with the cluster. +proc cluster_write_test {id} { + set prefix [randstring 20 20 alpha] + set port [get_instance_attrib redis $id port] + set cluster [redis_cluster 127.0.0.1:$port] + for {set j 0} {$j < 100} {incr j} { + $cluster set key.$j $prefix.$j + } + for {set j 0} {$j < 100} {incr j} { + assert {[$cluster get key.$j] eq "$prefix.$j"} + } + $cluster close +} |