summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/rdb.tcl35
1 files changed, 24 insertions, 11 deletions
diff --git a/tests/integration/rdb.tcl b/tests/integration/rdb.tcl
index fdc9e42d4..71876a6ed 100644
--- a/tests/integration/rdb.tcl
+++ b/tests/integration/rdb.tcl
@@ -53,13 +53,24 @@ proc start_server_and_kill_it {overrides code} {
# Make the RDB file unreadable
file attributes [file join $server_path dump.rdb] -permissions 0222
+# Detect root account (it is able to read the file even with 002 perm)
+set isroot 0
+catch {
+ open [file join $server_path dump.rdb]
+ set isroot 1
+}
+
# Now make sure the server aborted with an error
-start_server_and_kill_it [list "dir" $server_path] {
- wait_for_condition 50 100 {
- [string match {*Fatal error loading*} \
- [exec tail -n1 < [dict get $srv stdout]]]
- } else {
- fail "Server started even if RDB was unreadable!"
+if {!$isroot} {
+ start_server_and_kill_it [list "dir" $server_path] {
+ test {Server should not start if RDB file can't be open} {
+ wait_for_condition 50 100 {
+ [string match {*Fatal error loading*} \
+ [exec tail -n1 < [dict get $srv stdout]]]
+ } else {
+ fail "Server started even if RDB was unreadable!"
+ }
+ }
}
}
@@ -76,10 +87,12 @@ close $fd
# Now make sure the server aborted with an error
start_server_and_kill_it [list "dir" $server_path] {
- wait_for_condition 50 100 {
- [string match {*RDB checksum*} \
- [exec tail -n1 < [dict get $srv stdout]]]
- } else {
- fail "Server started even if RDB was corrupted!"
+ test {Server should not start if RDB is corrupted} {
+ wait_for_condition 50 100 {
+ [string match {*RDB checksum*} \
+ [exec tail -n1 < [dict get $srv stdout]]]
+ } else {
+ fail "Server started even if RDB was corrupted!"
+ }
}
}