Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
94f79794
Commit
94f79794
authored
Sep 05, 2014
by
antirez
Browse files
Test AOF format error detection.
parent
537f3053
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/integration/aof.tcl
View file @
94f79794
...
...
@@ -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
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment