diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 8613d3d636..1a320b03a0 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -5665,6 +5665,9 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id) uint64_t orig, load; int error; + if (ztest_opts.zo_mmp_test) + return; + orig = spa_guid(spa); load = spa_load_guid(spa); 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 e2e30c7eab..0a487d5b14 100755 --- a/tests/zfs-tests/tests/functional/mmp/mmp_active_import.ksh +++ b/tests/zfs-tests/tests/functional/mmp/mmp_active_import.ksh @@ -60,10 +60,9 @@ log_must is_pool_imported $MMP_POOL "-d $MMP_DIR" # 3. Verify 'zpool import [-f] $MMP_POOL' cannot import the pool. MMP_IMPORTED_MSG="Cannot import '$MMP_POOL': pool is imported" -log_must try_pool_import $MMP_POOL "-d $MMP_DIR" $MMP_IMPORTED_MSG +log_must try_pool_import $MMP_POOL "-d $MMP_DIR" "$MMP_IMPORTED_MSG" for i in {1..10}; do - log_must pgrep ztest >/dev/null - log_must try_pool_import $MMP_POOL "-f -d $MMP_DIR" $MMP_IMPORTED_MSG + log_must try_pool_import $MMP_POOL "-f -d $MMP_DIR" "$MMP_IMPORTED_MSG" done # 4. Kill ztest to make pool eligible for import. Poll with 'zpool status'. @@ -79,21 +78,21 @@ log_must wait_pool_imported $MMP_POOL "-d $MMP_DIR" # - hostid=different - previously imported on a different system # log_must mmp_clear_hostid -MMP_IMPORTED_MSG="Set the system hostid" -log_must check_pool_import $MMP_POOL "-d $MMP_DIR" "action" $MMP_IMPORTED_MSG +MMP_IMPORTED_MSG="Set a unique system hostid" +log_must check_pool_import $MMP_POOL "-d $MMP_DIR" "action" "$MMP_IMPORTED_MSG" 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 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 +log_must check_pool_import $MMP_POOL "-d $MMP_DIR" "status" "$MMP_IMPORTED_MSG" # 6. Verify 'zpool import $MMP_POOL' fails with the expected message. MMP_IMPORTED_MSG="pool was previously in use from another system." -log_must try_pool_import $MMP_POOL "-d $MMP_DIR" $MMP_IMPORTED_MSG +log_must try_pool_import $MMP_POOL "-d $MMP_DIR" "$MMP_IMPORTED_MSG" # 7. Verify 'zpool import -f $MMP_POOL' can now import the pool. log_must import_activity_check $MMP_POOL "-f -d $MMP_DIR" 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 6d34f7e77d..3d67deb02c 100755 --- a/tests/zfs-tests/tests/functional/mmp/mmp_exported_import.ksh +++ b/tests/zfs-tests/tests/functional/mmp/mmp_exported_import.ksh @@ -98,8 +98,8 @@ log_must zpool export $TESTPOOL log_must mmp_clear_hostid for opt in "" "-f"; do - MMP_IMPORTED_MSG="Set the system hostid" - log_must check_pool_import $TESTPOOL "" "action" $MMP_IMPORTED_MSG + MMP_IMPORTED_MSG="Set a unique system hostid" + log_must check_pool_import $TESTPOOL "" "action" "$MMP_IMPORTED_MSG" log_mustnot 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 78ae5f614a..c5c66373e0 100755 --- a/tests/zfs-tests/tests/functional/mmp/mmp_inactive_import.ksh +++ b/tests/zfs-tests/tests/functional/mmp/mmp_inactive_import.ksh @@ -90,8 +90,8 @@ log_must import_activity_check $TESTPOOL "-f" # 7. Verify multihost=on and hostid zero fails (no activity check) log_must zpool export -F $TESTPOOL log_must mmp_clear_hostid -MMP_IMPORTED_MSG="Set the system hostid" -log_must check_pool_import $TESTPOOL "-f" "action" $MMP_IMPORTED_MSG +MMP_IMPORTED_MSG="Set a unique system hostid" +log_must check_pool_import $TESTPOOL "-f" "action" "$MMP_IMPORTED_MSG" log_mustnot import_no_activity_check $TESTPOOL "-f" log_pass "multihost=on|off inactive pool activity checks passed"