ctdb_service_reconfigure
fi
;;
- monitor)
- if ctdb_service_needs_reconfigure ; then
- ctdb_service_reconfigure
- # Given that the reconfigure might not have
- # resulted in the service being stable yet, we
- # replay the previous status since that's the best
- # information we have.
- ctdb_replay_monitor_status
- fi
- ;;
esac
else
# Somebody else is running an event we don't want to collide
. "${TEST_SCRIPTS_DIR}/unit.sh"
-define_test "takeip, monitor -> reconfigure"
+define_test "takeip, monitor -> no reconfigure"
setup_nfs
simple_test_event "takeip" $public_address
-# This currently assumes that ctdb scriptstatus will always return a
-# good status (when replaying). That should change and we will need
-# to split this into 2 tests.
-ok <<EOF
-Reconfiguring service "nfs"...
-Replaying previous status for this script due to reconfigure...
-EOF
+ok_null
simple_test_event "monitor"
. "${TEST_SCRIPTS_DIR}/unit.sh"
-define_test "takeip, monitor -> reconfigure, replay error"
+define_test "takeip, take reconfigure lock, monitor -> replay error"
setup_nfs
ctdb_fake_scriptstatus 1 "ERROR" "$err"
+eventscript_call ctdb_reconfigure_try_lock
+
required_result 1 <<EOF
-Reconfiguring service "nfs"...
Replaying previous status for this script due to reconfigure...
$err
EOF
. "${TEST_SCRIPTS_DIR}/unit.sh"
-define_test "takeip, monitor -> reconfigure, replay timedout"
+define_test "takeip, take reconfigure lock, monitor -> reconfigure, replay timedout"
setup_nfs
ctdb_fake_scriptstatus -62 "TIMEDOUT" "$err"
+eventscript_call ctdb_reconfigure_try_lock
+
required_result 1 <<EOF
-Reconfiguring service "nfs"...
Replaying previous status for this script due to reconfigure...
[Replay of TIMEDOUT scriptstatus - note incorrect return code.] $err
EOF
. "${TEST_SCRIPTS_DIR}/unit.sh"
-define_test "takeip, monitor -> reconfigure, replay disabled"
+define_test "takeip, take reconfigure lock, monitor -> reconfigure, replay disabled"
setup_nfs
ctdb_fake_scriptstatus -8 "DISABLED" "$err"
+eventscript_call ctdb_reconfigure_try_lock
+
ok <<EOF
-Reconfiguring service "nfs"...
Replaying previous status for this script due to reconfigure...
[Replay of DISABLED scriptstatus - note incorrect return code.] $err
EOF