summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-09-05 10:27:11 +0200
committerantirez <antirez@gmail.com>2014-09-08 10:56:52 +0200
commit7b2e5ff9f9d5a7c5fa93bc22c53fce74f768ad83 (patch)
tree4e0494e485ed75e3b4a20aeb533c731def666974
parent0ab04287aa85735e52312cb8973ec37e1a867169 (diff)
downloadredis-7b2e5ff9f9d5a7c5fa93bc22c53fce74f768ad83.tar.gz
Test AOF format error detection.
-rw-r--r--tests/integration/aof.tcl25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/integration/aof.tcl b/tests/integration/aof.tcl
index cbffc812e..43fe89f98 100644
--- a/tests/integration/aof.tcl
+++ b/tests/integration/aof.tcl
@@ -23,6 +23,31 @@ proc start_server_aof {overrides code} {
}
tags {"aof"} {
+ ## Test that the server exits when the AOF contains a format error
+ create_aof {
+ append_to_aof [formatCommand set foo hello]
+ append_to_aof "!!!"
+ append_to_aof [formatCommand set foo hello]
+ }
+
+ start_server_aof [list dir $server_path] {
+ test "Bad format: Server should have logged an error" {
+ set pattern "*Bad file format reading the append only file*"
+ set retry 10
+ while {$retry} {
+ set result [exec tail -n1 < [dict get $srv stdout]]
+ if {[string match $pattern $result]} {
+ break
+ }
+ incr retry -1
+ after 1000
+ }
+ if {$retry == 0} {
+ error "assertion:expected error not found on config file"
+ }
+ }
+ }
+
## Test the server doesn't start when the AOF contains an unfinished MULTI
create_aof {
append_to_aof [formatCommand set foo hello]