diff options
author | chenyang8094 <chenyang8094@users.noreply.github.com> | 2022-01-10 15:09:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-10 09:09:39 +0200 |
commit | bd46a2abf48ca08809e52fb1ea0ca924803cba3e (patch) | |
tree | 8ecc30033f3d58f540e2c7594045fe760298af51 /tests/integration/aof-multi-part.tcl | |
parent | a1ae260e8addad04e1a73348c8f7bfeab398c2a9 (diff) | |
download | redis-bd46a2abf48ca08809e52fb1ea0ca924803cba3e.tar.gz |
Support whitespace characters in appendfilename, and ban them in appenddirname (#10049)
1. Ban whitespace characters in `appenddirname`
2. Handle the case where `appendfilename` contains spaces (for backwards compatibility)
Diffstat (limited to 'tests/integration/aof-multi-part.tcl')
-rw-r--r-- | tests/integration/aof-multi-part.tcl | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/tests/integration/aof-multi-part.tcl b/tests/integration/aof-multi-part.tcl index 0ff09ea04..b5b2f3ff9 100644 --- a/tests/integration/aof-multi-part.tcl +++ b/tests/integration/aof-multi-part.tcl @@ -186,7 +186,7 @@ tags {"external:skip"} { fail "AOF loading didn't fail" } - assert_equal 1 [count_message_lines $server_path/stdout "Mismatched manifest key"] + assert_equal 2 [count_message_lines $server_path/stdout "The AOF manifest file is invalid format"] } clean_aof_persistence $aof_dirpath @@ -213,7 +213,7 @@ tags {"external:skip"} { fail "AOF loading didn't fail" } - assert_equal 2 [count_message_lines $server_path/stdout "The AOF manifest file is invalid format"] + assert_equal 3 [count_message_lines $server_path/stdout "The AOF manifest file is invalid format"] } clean_aof_persistence $aof_dirpath @@ -267,7 +267,7 @@ tags {"external:skip"} { fail "AOF loading didn't fail" } - assert_equal 3 [count_message_lines $server_path/stdout "The AOF manifest file is invalid format"] + assert_equal 4 [count_message_lines $server_path/stdout "The AOF manifest file is invalid format"] } clean_aof_persistence $aof_dirpath @@ -675,6 +675,29 @@ tags {"external:skip"} { } } + test {Multi Part AOF can handle appendfilename contains spaces} { + start_server [list overrides [list appendonly yes appendfilename "\" file seq .aof \""]] { + set dir [get_redis_dir] + set aof_manifest_name [format "%s/%s/%s%s" $dir "appendonlydir" " file seq .aof " $::manifest_suffix] + set redis [redis [srv host] [srv port] 0 $::tls] + + assert_equal OK [$redis set k1 v1] + + $redis bgrewriteaof + waitForBgrewriteaof $redis + + assert_aof_manifest_content $aof_manifest_name { + {file " file seq .aof .1.base.rdb" seq 1 type b} + {file " file seq .aof .2.incr.aof" seq 2 type i} + } + + set d1 [$redis debug digest] + $redis debug loadaof + set d2 [$redis debug digest] + assert {$d1 eq $d2} + } + } + # Test Part 2 # # To test whether the AOFRW behaves as expected during the redis run. |