mirror of
https://github.com/fluencelabs/redis
synced 2025-07-31 08:22:01 +00:00
Redis Cluster test framework skeleton.
This commit is contained in:
16
tests/cluster/tests/00-base.tcl
Normal file
16
tests/cluster/tests/00-base.tcl
Normal file
@@ -0,0 +1,16 @@
|
||||
# Check the basic monitoring and failover capabilities.
|
||||
|
||||
source "../tests/includes/init-tests.tcl"
|
||||
|
||||
if {$::simulate_error} {
|
||||
test "This test will fail" {
|
||||
fail "Simulated error"
|
||||
}
|
||||
}
|
||||
|
||||
test "Cluster nodes are reachable." {
|
||||
foreach_redis_id id {
|
||||
# Every node should just know itself.
|
||||
assert {[R $id ping] eq {PONG}}
|
||||
}
|
||||
}
|
13
tests/cluster/tests/includes/init-tests.tcl
Normal file
13
tests/cluster/tests/includes/init-tests.tcl
Normal file
@@ -0,0 +1,13 @@
|
||||
# Initialization tests -- most units will start including this.
|
||||
|
||||
test "(init) Restart killed instances" {
|
||||
foreach type {redis} {
|
||||
foreach_${type}_id id {
|
||||
if {[get_instance_attrib $type $id pid] == -1} {
|
||||
puts -nonewline "$type/$id "
|
||||
flush stdout
|
||||
restart_instance $type $id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user