]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Initialise return code file
authorMartin Schwenke <mschwenke@ddn.com>
Fri, 5 Jul 2024 01:47:56 +0000 (11:47 +1000)
committerMartin Schwenke <martins@samba.org>
Tue, 20 Aug 2024 22:50:34 +0000 (22:50 +0000)
The output file is initialised, so doesn't need to be created on
success.  Treat the return code file the same way.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh

index fa9e2e0febef6c06f14456f7b255463644275136..163ef5f59caa4a2952094183f1c8cc89bf16ec89 100644 (file)
@@ -298,6 +298,7 @@ rpc_set_service_failure_response()
        _out="${CTDB_TEST_TMP_DIR}/rpc_failure_output"
        : >"$_out"
        _rc_file="${CTDB_TEST_TMP_DIR}/rpc_result"
+       echo 0 >"$_rc_file"
 
        (
                # Subshell to restrict scope variables...
@@ -333,7 +334,6 @@ rpc_set_service_failure_response()
 
                if [ "$_numfails" -eq -1 ]; then
                        _unhealthy=false
-                       echo 0 >"$_rc_file"
                        rpc_failure \
                                "WARNING: statistics changed but" \
                                "$_rpc_service" \
@@ -350,7 +350,6 @@ rpc_set_service_failure_response()
                                >"$_out"
                else
                        _unhealthy=false
-                       echo 0 >"$_rc_file"
                fi
 
                if [ $restart_every -gt 0 ] &&