diff options
Diffstat (limited to 'tests/zfs-tests/tests/functional/mmp/mmp.kshlib')
-rw-r--r-- | tests/zfs-tests/tests/functional/mmp/mmp.kshlib | 10 |
1 files changed, 4 insertions, 6 deletions
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 |