summaryrefslogtreecommitdiff
path: root/tests/sentinel/tests/03-runtime-reconf.tcl
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-02-04 17:39:51 +0800
committerGitHub <noreply@github.com>2022-02-04 11:39:51 +0200
commitd7fcb3c5a16dce188728b0c2ab3a2a0df9bb5e2a (patch)
treec8f06b54ca27da94c9adf9d3d287f5f16559be6f /tests/sentinel/tests/03-runtime-reconf.tcl
parentd2fde2f6557a0c2f2963a0a0fb626510af62f545 (diff)
downloadredis-d7fcb3c5a16dce188728b0c2ab3a2a0df9bb5e2a.tar.gz
Fix SENTINEL SET config rewrite test (#10232)
Change the sentinel config file to a directory in SENTINEL SET test. So it will now fail on the `rename` in `rewriteConfigOverwriteFile`. The test used to set the sentinel config file permissions to `000` to simulate failure. But it fails on centos7 / freebsd / alpine. (introduced in #10151) Other changes: 1. More error messages after the config rewrite failure. 2. Modify arg name `force_all` in `rewriteConfig` to `force_write`. (was rename in #9304) 3. Fix a typo in debug quicklist-packed-threshold, then -> than. (#9357)
Diffstat (limited to 'tests/sentinel/tests/03-runtime-reconf.tcl')
-rw-r--r--tests/sentinel/tests/03-runtime-reconf.tcl13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/sentinel/tests/03-runtime-reconf.tcl b/tests/sentinel/tests/03-runtime-reconf.tcl
index 5d6e6b1a5..3e930646a 100644
--- a/tests/sentinel/tests/03-runtime-reconf.tcl
+++ b/tests/sentinel/tests/03-runtime-reconf.tcl
@@ -51,10 +51,15 @@ test "Sentinel Set with other error situations" {
set update_quorum [expr $origin_quorum+1]
set sentinel_id 0
set configfilename [file join "sentinel_$sentinel_id" "sentinel.conf"]
- exec chmod 000 $configfilename
+ set configfilename_bak [file join "sentinel_$sentinel_id" "sentinel.conf.bak"]
+
+ file rename $configfilename $configfilename_bak
+ file mkdir $configfilename
catch {[S 0 SENTINEL SET mymaster quorum $update_quorum]} err
- exec chmod 644 $configfilename
- assert_equal "ERR Failed to save config file" $err
-}
+ file delete $configfilename
+ file rename $configfilename_bak $configfilename
+
+ assert_match "ERR Failed to save config file*" $err
+}