ZTS: Fix import_cache_device_replaced

Allow the 'zpool replace' to run slowly without overwhelming the vdev
queues by setting zfs_scan_vdev_limit=128k.  This limits the number of
concurrent slow IOs which need to be handled.  The net effect is the
test case runs approximately 3x faster putting it well under the 10
minute per-test time limit.

Rename import_cache* test cases to imprt_cachefile*.  Originally
these were renamed due to a maximum tar name limit, this limit was
removed by commit 1dfde3d9b.

Replaced instances of /var/tmp in zpool_import.cfg with $TEST_BASE_DIR.

Reviewed-by: bunder2015 <omfgbunder@gmail.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7765 
Closes #7802
This commit is contained in:
Brian Behlendorf 2018-08-18 21:16:12 -07:00 committed by GitHub
parent a9d6270acb
commit 089b16f48d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 24 additions and 19 deletions

View File

@ -363,12 +363,12 @@ tests = ['zpool_import_001_pos', 'zpool_import_002_pos',
'zpool_import_rename_001_pos', 'zpool_import_all_001_pos',
'zpool_import_encrypted', 'zpool_import_encrypted_load',
'zpool_import_errata3',
'import_cache_device_added',
'import_cache_device_removed',
'import_cache_device_replaced',
'import_cache_mirror_attached',
'import_cache_mirror_detached',
'import_cache_shared_device',
'import_cachefile_device_added',
'import_cachefile_device_removed',
'import_cachefile_device_replaced',
'import_cachefile_mirror_attached',
'import_cachefile_mirror_detached',
'import_cachefile_shared_device',
'import_devices_missing',
'import_paths_changed',
'import_rewind_config_changed',

View File

@ -231,7 +231,6 @@ maybe = {
['FAIL', rewind_reason],
'cli_root/zpool_import/import_rewind_config_changed':
['FAIL', rewind_reason],
'cli_root/zpool_import/import_cache_device_replaced': ['FAIL', '7765'],
'cli_root/zpool_import/zpool_import_missing_003_pos': ['SKIP', '6839'],
'cli_root/zpool_remove/setup': ['SKIP', disk_reason],
'cli_root/zpool_upgrade/zpool_upgrade_004_pos': ['FAIL', '6141'],

View File

@ -4,12 +4,12 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_impo
dist_pkgdata_SCRIPTS = \
setup.ksh \
cleanup.ksh \
import_cache_device_added.ksh \
import_cache_device_removed.ksh \
import_cache_device_replaced.ksh \
import_cache_mirror_attached.ksh \
import_cache_mirror_detached.ksh \
import_cache_shared_device.ksh \
import_cachefile_device_added.ksh \
import_cachefile_device_removed.ksh \
import_cachefile_device_replaced.ksh \
import_cachefile_mirror_attached.ksh \
import_cachefile_mirror_detached.ksh \
import_cachefile_shared_device.ksh \
import_devices_missing.ksh \
import_paths_changed.ksh \
import_rewind_config_changed.ksh \

View File

@ -60,6 +60,7 @@ function custom_cleanup
log_must set_zfs_txg_timeout $ZFS_TXG_TIMEOUT
zinject -c all
log_must set_tunable64 zfs_scan_vdev_limit $ZFS_SCAN_VDEV_LIMIT_DEFAULT
cleanup
}
@ -87,9 +88,10 @@ function test_replacing_vdevs
log_must zpool export $TESTPOOL1
log_must cp $CPATHBKP $CPATH
log_must zpool import -c $CPATH -o cachefile=$CPATH $TESTPOOL1
log_must set_tunable64 zfs_scan_vdev_limit $ZFS_SCAN_VDEV_LIMIT_SLOW
typeset device
for device in $zinjectdevices ; do
log_must zinject -d $device -D 200:1 $TESTPOOL1 > /dev/null
log_must zinject -d $device -D 50:1 $TESTPOOL1 > /dev/null
done
log_must zpool replace $TESTPOOL1 $replacevdev $replaceby
@ -102,6 +104,7 @@ function test_replacing_vdevs
# Confirm pool is still replacing
log_must pool_is_replacing $TESTPOOL1
log_must zinject -c all > /dev/null
log_must set_tunable64 zfs_scan_vdev_limit $ZFS_SCAN_VDEV_LIMIT_DEFAULT
log_must zpool export $TESTPOOL1
( $earlyremove ) && log_must rm $replacevdev

View File

@ -117,11 +117,11 @@ export DEVICE_FILE=disk
export DEVICE_ARCHIVE=archive_import-test
export MYTESTFILE=$STF_SUITE/include/libtest.shlib
export CPATH=/var/tmp/cachefile.$$
export CPATHBKP=/var/tmp/cachefile.$$.bkp
export CPATHBKP2=/var/tmp/cachefile.$$.bkp2
export MD5FILE=/var/tmp/md5sums.$$
export MD5FILE2=/var/tmp/md5sums.$$.2
export CPATH=$TEST_BASE_DIR/cachefile.$$
export CPATHBKP=$TEST_BASE_DIR/cachefile.$$.bkp
export CPATHBKP2=$TEST_BASE_DIR/cachefile.$$.bkp2
export MD5FILE=$TEST_BASE_DIR/md5sums.$$
export MD5FILE2=$TEST_BASE_DIR/md5sums.$$.2
typeset -i num=0
while (( num < $GROUP_NUM )); do
@ -137,3 +137,6 @@ export VDEV3=$DEVICE_DIR/${DEVICE_FILE}3
export VDEV4=$DEVICE_DIR/${DEVICE_FILE}4
export ALTER_ROOT=/alter_import-test
export ZFS_SCAN_VDEV_LIMIT_SLOW=$((128*1024))
export ZFS_SCAN_VDEV_LIMIT_DEFAULT=$((4*1024*1024))