From d7fcb3c5a16dce188728b0c2ab3a2a0df9bb5e2a Mon Sep 17 00:00:00 2001 From: Binbin Date: Fri, 4 Feb 2022 17:39:51 +0800 Subject: 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) --- tests/sentinel/tests/03-runtime-reconf.tcl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests/sentinel/tests/03-runtime-reconf.tcl') 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 +} -- cgit v1.2.1