Quote "$MMP_IMPORT_MSG" when it is passed as an argument, as it is a
multi-word string. Some tests were passing when they should not have,
because the grep was only testing for the first word.
Correct the message expected when no hostid is set and the test attempts
to enable multihost. It did not match the actual output in that
situation.
Disable ztest_reguid() when ztest is invoked with the -M option. If
ztest performs a reguid, a concurrent import attempt may fail with the
error "one or more devices is currently unavailable" if the guid sum is
calculated on the original device guids but compared against the guid
sum ztest wrote based on the new device guids.
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #6666
uint64_t orig, load;
int error;
uint64_t orig, load;
int error;
+ if (ztest_opts.zo_mmp_test)
+ return;
+
orig = spa_guid(spa);
load = spa_load_guid(spa);
orig = spa_guid(spa);
load = spa_load_guid(spa);
# 3. Verify 'zpool import [-f] $MMP_POOL' cannot import the pool.
MMP_IMPORTED_MSG="Cannot import '$MMP_POOL': pool is imported"
# 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"
- 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'.
done
# 4. Kill ztest to make pool eligible for import. Poll with 'zpool status'.
# - hostid=different - previously imported on a different system
#
log_must mmp_clear_hostid
# - 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 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 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."
# 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"
# 7. Verify 'zpool import -f $MMP_POOL' can now import the pool.
log_must import_activity_check $MMP_POOL "-f -d $MMP_DIR"
log_must mmp_clear_hostid
for opt in "" "-f"; do
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
log_mustnot import_no_activity_check $TESTPOOL $opt
done
# 7. Verify multihost=on and hostid zero fails (no activity check)
log_must zpool export -F $TESTPOOL
log_must mmp_clear_hostid
# 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"
log_mustnot import_no_activity_check $TESTPOOL "-f"
log_pass "multihost=on|off inactive pool activity checks passed"