5 # This file and its contents are supplied under the terms of the
6 # Common Development and Distribution License ("CDDL"), version 1.0.
7 # You may only use this file in accordance with the terms of version
10 # A full copy of the text of the CDDL should have accompanied this
11 # source. A copy of the CDDL is also available via the Internet at
12 # http://www.illumos.org/license/CDDL.
18 # Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
22 # When multihost=off ensure that leaf vdev uberblocks are not updated.
25 # 1. Set multihost=off (disables mmp)
26 # 2. Set TXG_TIMEOUT to large value
28 # 4. Find the current "best" uberblock
29 # 5. Sleep for enough time for uberblocks to change
30 # 6. Find the current "best" uberblock
31 # 7. If the uberblock changed, fail
33 # 9. Sleep for enough time for uberblocks to change
34 # 10. Find the current "best" uberblock
35 # 11. If uberblocks didn't change, fail
38 . $STF_SUITE/include/libtest.shlib
39 . $STF_SUITE/tests/functional/mmp/mmp.cfg
40 . $STF_SUITE/tests/functional/mmp/mmp.kshlib
42 verify_runnable "both"
46 default_cleanup_noexit
47 log_must set_tunable64 TXG_TIMEOUT $TXG_TIMEOUT_DEFAULT
48 log_must set_tunable64 MULTIHOST_INTERVAL $MMP_INTERVAL_DEFAULT
49 log_must rm -f $PREV_UBER $CURR_UBER
50 log_must mmp_clear_hostid
53 log_assert "mmp thread won't write uberblocks with multihost=off"
56 log_must set_tunable64 MULTIHOST_INTERVAL $MMP_INTERVAL_MIN
57 log_must set_tunable64 TXG_TIMEOUT $TXG_TIMEOUT_LONG
58 log_must mmp_set_hostid $HOSTID1
60 default_setup_noexit $DISK
61 log_must zpool set multihost=off $TESTPOOL
63 log_must zdb -u $TESTPOOL > $PREV_UBER
65 log_must zdb -u $TESTPOOL > $CURR_UBER
67 if ! diff "$CURR_UBER" "$PREV_UBER"; then
68 log_fail "mmp thread has updated an uberblock"
71 log_must zpool set multihost=on $TESTPOOL
73 log_must zdb -u $TESTPOOL > $CURR_UBER
75 if diff "$CURR_UBER" "$PREV_UBER"; then
76 log_fail "mmp failed to update uberblocks"
79 log_pass "mmp thread won't write uberblocks with multihost=off passed"