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 # Verify import behavior for inactive, but not exported, pools
26 # 2. Verify multihost=off and hostids match (no activity check)
27 # 3. Verify multihost=off and hostids differ (no activity check)
28 # 4. Verify multihost=off and hostid allowed (no activity check)
29 # 5. Verify multihost=on and hostids match (no activity check)
30 # 6. Verify multihost=on and hostids differ (activity check)
31 # 7. Verify multihost=on and hostid zero fails (no activity check)
34 .
$STF_SUITE/include
/libtest.shlib
35 .
$STF_SUITE/tests
/functional
/mmp
/mmp.cfg
36 .
$STF_SUITE/tests
/functional
/mmp
/mmp.kshlib
38 verify_runnable
"both"
42 default_cleanup_noexit
43 log_must mmp_clear_hostid
46 log_assert
"multihost=on|off inactive pool activity checks"
50 log_must mmp_set_hostid
$HOSTID1
51 default_setup_noexit
$DISK
53 # 2. Verify multihost=off and hostids match (no activity check)
54 log_must zpool
set multihost
=off
$TESTPOOL
56 for opt
in "" "-f"; do
57 log_must zpool
export -F $TESTPOOL
58 log_must import_no_activity_check
$TESTPOOL $opt
61 # 3. Verify multihost=off and hostids differ (no activity check)
62 log_must zpool
export -F $TESTPOOL
63 log_must mmp_clear_hostid
64 log_must mmp_set_hostid
$HOSTID2
65 log_mustnot import_no_activity_check
$TESTPOOL ""
66 log_must import_no_activity_check
$TESTPOOL "-f"
68 # 4. Verify multihost=off and hostid zero allowed (no activity check)
69 log_must zpool
export -F $TESTPOOL
70 log_must mmp_clear_hostid
71 log_mustnot import_no_activity_check
$TESTPOOL ""
72 log_must import_no_activity_check
$TESTPOOL "-f"
74 # 5. Verify multihost=on and hostids match (no activity check)
75 log_must mmp_pool_set_hostid
$TESTPOOL $HOSTID1
76 log_must zpool
set multihost
=on
$TESTPOOL
78 for opt
in "" "-f"; do
79 log_must zpool
export -F $TESTPOOL
80 log_must import_no_activity_check
$TESTPOOL $opt
83 # 6. Verify multihost=on and hostids differ (activity check)
84 log_must zpool
export -F $TESTPOOL
85 log_must mmp_clear_hostid
86 log_must mmp_set_hostid
$HOSTID2
87 log_mustnot import_activity_check
$TESTPOOL ""
88 log_must import_activity_check
$TESTPOOL "-f"
90 # 7. Verify multihost=on and hostid zero fails (no activity check)
91 log_must zpool
export -F $TESTPOOL
92 log_must mmp_clear_hostid
93 MMP_IMPORTED_MSG
="Set the system hostid"
94 log_must check_pool_import
$TESTPOOL "-f" "action" $MMP_IMPORTED_MSG
95 log_mustnot import_no_activity_check
$TESTPOOL "-f"
97 log_pass
"multihost=on|off inactive pool activity checks passed"