mirror of
				https://git.proxmox.com/git/mirror_zfs
				synced 2025-11-04 14:26:57 +00:00 
			
		
		
		
	ZTS: Re-enable MMP tests
Commit7fab6361inadvertently disabled the MMP test cases by creating and not removing an /etc/hostid file in the new zpool_split_props test case. When the file exists the ZTS skips the entire MMP test group rather than modify what may be a system which is already configured. Update the test case to remove the file. Additionally, because the MMP tests were disabled a regression slipped in as part of commit9eb7b46ed0. Fix it. Reviewed-by: Tim Chase <tim@chase2k.com> Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #7514
This commit is contained in:
		
							parent
							
								
									a82a4a15be
								
							
						
					
					
						commit
						c02c1becce
					
				@ -3180,6 +3180,7 @@ spa_ld_get_props(spa_t *spa)
 | 
				
			|||||||
		spa_prop_find(spa, ZPOOL_PROP_DELEGATION, &spa->spa_delegation);
 | 
							spa_prop_find(spa, ZPOOL_PROP_DELEGATION, &spa->spa_delegation);
 | 
				
			||||||
		spa_prop_find(spa, ZPOOL_PROP_FAILUREMODE, &spa->spa_failmode);
 | 
							spa_prop_find(spa, ZPOOL_PROP_FAILUREMODE, &spa->spa_failmode);
 | 
				
			||||||
		spa_prop_find(spa, ZPOOL_PROP_AUTOEXPAND, &spa->spa_autoexpand);
 | 
							spa_prop_find(spa, ZPOOL_PROP_AUTOEXPAND, &spa->spa_autoexpand);
 | 
				
			||||||
 | 
							spa_prop_find(spa, ZPOOL_PROP_MULTIHOST, &spa->spa_multihost);
 | 
				
			||||||
		spa_prop_find(spa, ZPOOL_PROP_DEDUPDITTO,
 | 
							spa_prop_find(spa, ZPOOL_PROP_DEDUPDITTO,
 | 
				
			||||||
		    &spa->spa_dedup_ditto);
 | 
							    &spa->spa_dedup_ditto);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -15,6 +15,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
. $STF_SUITE/include/libtest.shlib
 | 
					. $STF_SUITE/include/libtest.shlib
 | 
				
			||||||
 | 
					. $STF_SUITE/tests/functional/mmp/mmp.kshlib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# DESCRIPTION:
 | 
					# DESCRIPTION:
 | 
				
			||||||
@ -33,6 +34,7 @@ function cleanup
 | 
				
			|||||||
	destroy_pool $TESTPOOL
 | 
						destroy_pool $TESTPOOL
 | 
				
			||||||
	destroy_pool $TESTPOOL2
 | 
						destroy_pool $TESTPOOL2
 | 
				
			||||||
	rm -f $DEVICE1 $DEVICE2
 | 
						rm -f $DEVICE1 $DEVICE2
 | 
				
			||||||
 | 
						log_must mmp_clear_hostid
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setup_mirror
 | 
					function setup_mirror
 | 
				
			||||||
@ -45,6 +47,10 @@ function setup_mirror
 | 
				
			|||||||
log_assert "'zpool split' can set new property values on the new pool"
 | 
					log_assert "'zpool split' can set new property values on the new pool"
 | 
				
			||||||
log_onexit cleanup
 | 
					log_onexit cleanup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -e $HOSTID_FILE ]; then
 | 
				
			||||||
 | 
						log_unsupported "System has existing $HOSTID_FILE file"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typeset good_props=('comment=text' 'ashift=12' 'multihost=on'
 | 
					typeset good_props=('comment=text' 'ashift=12' 'multihost=on'
 | 
				
			||||||
    'listsnapshots=on' 'autoexpand=on' 'autoreplace=on' 'dedupditto=1234'
 | 
					    'listsnapshots=on' 'autoexpand=on' 'autoreplace=on' 'dedupditto=1234'
 | 
				
			||||||
    'delegation=off' 'failmode=continue')
 | 
					    'delegation=off' 'failmode=continue')
 | 
				
			||||||
@ -57,7 +63,7 @@ DEVICE1="$TEST_BASE_DIR/device-1"
 | 
				
			|||||||
DEVICE2="$TEST_BASE_DIR/device-2"
 | 
					DEVICE2="$TEST_BASE_DIR/device-2"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Needed to set multihost=on
 | 
					# Needed to set multihost=on
 | 
				
			||||||
zgenhostid
 | 
					log_must mmp_set_hostid $HOSTID1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Verify we can set a combination of valid property values on the new pool
 | 
					# Verify we can set a combination of valid property values on the new pool
 | 
				
			||||||
for prop in "${good_props[@]}"
 | 
					for prop in "${good_props[@]}"
 | 
				
			||||||
@ -68,7 +74,10 @@ do
 | 
				
			|||||||
	log_must zpool split -o $prop $TESTPOOL $TESTPOOL2
 | 
						log_must zpool split -o $prop $TESTPOOL $TESTPOOL2
 | 
				
			||||||
	log_must zpool import -N -d $TEST_BASE_DIR $TESTPOOL2
 | 
						log_must zpool import -N -d $TEST_BASE_DIR $TESTPOOL2
 | 
				
			||||||
	log_must test "$(get_pool_prop $propname $TESTPOOL2)" == "$propval"
 | 
						log_must test "$(get_pool_prop $propname $TESTPOOL2)" == "$propval"
 | 
				
			||||||
	cleanup
 | 
					
 | 
				
			||||||
 | 
						destroy_pool $TESTPOOL
 | 
				
			||||||
 | 
						destroy_pool $TESTPOOL2
 | 
				
			||||||
 | 
						rm -f $DEVICE1 $DEVICE2
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Verify we cannot set invalid property values
 | 
					# Verify we cannot set invalid property values
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user