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 # Ensure that MMP updates uberblocks at the expected intervals.
25 # 1. Set zfs_txg_timeout to large value
27 # 3. Clear multihost history
28 # 4. Sleep, then collect count of uberblocks written
29 # 5. If number of changes seen is less than min threshold, then fail
30 # 6. If number of changes seen is more than max threshold, then fail
33 .
$STF_SUITE/include
/libtest.shlib
34 .
$STF_SUITE/tests
/functional
/mmp
/mmp.cfg
35 .
$STF_SUITE/tests
/functional
/mmp
/mmp.kshlib
37 verify_runnable
"both"
40 EXPECTED
=$
(($
(echo $DISKS |
wc -w) * 10))
41 FUDGE
=$
((EXPECTED
* 20 / 100))
42 MIN
=$
((EXPECTED
- FUDGE
))
43 MAX
=$
((EXPECTED
+ FUDGE
))
47 default_cleanup_noexit
48 set_tunable64 zfs_txg_timeout
$TXG_TIMEOUT_DEFAULT
49 log_must mmp_clear_hostid
52 log_assert
"Ensure MMP uberblocks update at the correct interval"
55 log_must set_tunable64 zfs_txg_timeout
$TXG_TIMEOUT_LONG
56 log_must mmp_set_hostid
$HOSTID1
58 default_setup_noexit
"$DISKS"
59 log_must zpool
set multihost
=on
$TESTPOOL
61 UBER_CHANGES
=$
(count_uberblocks
$TESTPOOL 10)
63 log_note
"Uberblock changed $UBER_CHANGES times"
65 if [ $UBER_CHANGES -lt $MIN ]; then
66 log_fail
"Fewer uberblock writes occured than expected ($EXPECTED)"
69 if [ $UBER_CHANGES -gt $MAX ]; then
70 log_fail
"More uberblock writes occured than expected ($EXPECTED)"
73 log_pass
"Ensure MMP uberblocks update at the correct interval passed"