diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/moduleapi/cluster.tcl | 2 | ||||
-rw-r--r-- | tests/unit/moduleapi/propagate.tcl | 29 |
2 files changed, 28 insertions, 3 deletions
diff --git a/tests/unit/moduleapi/cluster.tcl b/tests/unit/moduleapi/cluster.tcl index 8851b0301..43356f77d 100644 --- a/tests/unit/moduleapi/cluster.tcl +++ b/tests/unit/moduleapi/cluster.tcl @@ -219,4 +219,4 @@ start_cluster 3 0 [list config_lines $modules] { assert_equal {PONG} [$node2 PING] assert_equal {PONG} [$node3 PING] } -}
\ No newline at end of file +} diff --git a/tests/unit/moduleapi/propagate.tcl b/tests/unit/moduleapi/propagate.tcl index 7bdc000ee..ce4aaae44 100644 --- a/tests/unit/moduleapi/propagate.tcl +++ b/tests/unit/moduleapi/propagate.tcl @@ -675,8 +675,10 @@ tags "modules" { } } + tags "modules aof" { - test {Modules RM_Replicate replicates MULTI/EXEC correctly} { + foreach aofload_type {debug_cmd startup} { + test "Modules RM_Replicate replicates MULTI/EXEC correctly: AOF-load type $aofload_type" { start_server [list overrides [list loadmodule "$testmodule"]] { # Enable the AOF r config set appendonly yes @@ -690,11 +692,34 @@ tags "modules aof" { r propagate-test.mixed r exec + assert_equal [r get counter-1] {} + assert_equal [r get counter-2] {} + assert_equal [r get using-call] 2 + assert_equal [r get after-call] 2 + assert_equal [r get notifications] 4 + # Load the AOF - r debug loadaof + if {$aofload_type == "debug_cmd"} { + r debug loadaof + } else { + r config rewrite + restart_server 0 true false + wait_done_loading r + } + + # This module behaves bad on purpose, it only calls + # RM_Replicate for counter-1 and counter-2 so values + # after AOF-load are different + assert_equal [r get counter-1] 4 + assert_equal [r get counter-2] 4 + assert_equal [r get using-call] 2 + assert_equal [r get after-call] 2 + # 4+4+2+2 commands from AOF (just above) + 4 "INCR notifications" from AOF + 4 notifications for these INCRs + assert_equal [r get notifications] 20 assert_equal {OK} [r module unload propagate-test] assert_equal [s 0 unexpected_error_replies] 0 } } + } } |