diff options
Diffstat (limited to 'tests/zfs-tests')
5 files changed, 10 insertions, 6 deletions
diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg index 57b1bd315..32749028c 100644 --- a/tests/zfs-tests/include/commands.cfg +++ b/tests/zfs-tests/include/commands.cfg @@ -141,6 +141,7 @@ export ZFS_FILES='zdb arcstat.py dbufstat.py zed + zgenhostid zstreamdump' export ZFSTEST_FILES='chg_usr_exec diff --git a/tests/zfs-tests/tests/functional/mmp/mmp.kshlib b/tests/zfs-tests/tests/functional/mmp/mmp.kshlib index a81779b0c..ffe26dfde 100644 --- a/tests/zfs-tests/tests/functional/mmp/mmp.kshlib +++ b/tests/zfs-tests/tests/functional/mmp/mmp.kshlib @@ -79,12 +79,7 @@ function mmp_set_hostid { typeset hostid=$1 - a=${hostid:6:2} - b=${hostid:4:2} - c=${hostid:2:2} - d=${hostid:0:2} - - printf "\\x$a\\x$b\\x$c\\x$d" >$HOSTID_FILE + zgenhostid $1 if [ $(hostid) != "$hostid" ]; then return 1 @@ -107,10 +102,12 @@ function mmp_pool_create # pool dir log_must mkdir -p $dir log_must truncate -s $MINVDEVSIZE $dir/vdev1 $dir/vdev2 + log_must mmp_clear_hostid log_must mmp_set_hostid $HOSTID1 log_must zpool create -f $pool mirror $dir/vdev1 $dir/vdev2 log_must zpool set multihost=on $pool log_must zpool export $pool + log_must mmp_clear_hostid log_must mmp_set_hostid $HOSTID2 log_note "Starting ztest in the background as hostid $HOSTID1" @@ -146,6 +143,7 @@ function mmp_pool_set_hostid # pool hostid typeset pool=$1 typeset hostid=$2 + log_must mmp_clear_hostid log_must mmp_set_hostid $hostid log_must zpool export $pool log_must zpool import $pool diff --git a/tests/zfs-tests/tests/functional/mmp/mmp_active_import.ksh b/tests/zfs-tests/tests/functional/mmp/mmp_active_import.ksh index 92eb9ce2d..e2e30c7ea 100755 --- a/tests/zfs-tests/tests/functional/mmp/mmp_active_import.ksh +++ b/tests/zfs-tests/tests/functional/mmp/mmp_active_import.ksh @@ -86,6 +86,7 @@ log_must mmp_set_hostid $HOSTID1 MMP_IMPORTED_MSG="The pool can be imported" log_must check_pool_import $MMP_POOL "-d $MMP_DIR" "action" $MMP_IMPORTED_MSG +log_must mmp_clear_hostid log_must mmp_set_hostid $HOSTID2 MMP_IMPORTED_MSG="The pool was last accessed by another system." log_must check_pool_import $MMP_POOL "-d $MMP_DIR" "status" $MMP_IMPORTED_MSG diff --git a/tests/zfs-tests/tests/functional/mmp/mmp_exported_import.ksh b/tests/zfs-tests/tests/functional/mmp/mmp_exported_import.ksh index d65ca5b3d..6d34f7e77 100755 --- a/tests/zfs-tests/tests/functional/mmp/mmp_exported_import.ksh +++ b/tests/zfs-tests/tests/functional/mmp/mmp_exported_import.ksh @@ -62,6 +62,7 @@ done for opt in "" "-f"; do log_must mmp_pool_set_hostid $TESTPOOL $HOSTID1 log_must zpool export $TESTPOOL + log_must mmp_clear_hostid log_must mmp_set_hostid $HOSTID2 log_must import_no_activity_check $TESTPOOL $opt done @@ -87,6 +88,7 @@ done for opt in "" "-f"; do log_must mmp_pool_set_hostid $TESTPOOL $HOSTID1 log_must zpool export $TESTPOOL + log_must mmp_clear_hostid log_must mmp_set_hostid $HOSTID2 log_must import_no_activity_check $TESTPOOL $opt done diff --git a/tests/zfs-tests/tests/functional/mmp/mmp_inactive_import.ksh b/tests/zfs-tests/tests/functional/mmp/mmp_inactive_import.ksh index c944b6b28..71f3af5c5 100755 --- a/tests/zfs-tests/tests/functional/mmp/mmp_inactive_import.ksh +++ b/tests/zfs-tests/tests/functional/mmp/mmp_inactive_import.ksh @@ -60,6 +60,7 @@ done # 3. Verify multihost=off and hostids differ (no activity check) log_must zpool export -F $TESTPOOL +log_must mmp_clear_hostid log_must mmp_set_hostid $HOSTID2 log_mustnot import_no_activity_check $TESTPOOL "" log_must import_no_activity_check $TESTPOOL "-f" @@ -81,6 +82,7 @@ done # 6. Verify multihost=on and hostids differ (activity check) log_must zpool export -F $TESTPOOL +log_must mmp_clear_hostid log_must mmp_set_hostid $HOSTID2 log_mustnot import_activity_check $TESTPOOL "" log_must import_activity_check $TESTPOOL "-f" |