summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2018-08-18 21:16:12 -0700
committerGitHub <[email protected]>2018-08-18 21:16:12 -0700
commit089b16f48da2255b2c47cbab9dfbac3dcfe43ae8 (patch)
treebddec333a666e30898e816cfb9b049bd7b2e57da
parenta9d6270acb7f529cb446c46b429a52631777452f (diff)
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 <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #7765 Closes #7802
-rw-r--r--tests/runfiles/linux.run12
-rwxr-xr-xtests/test-runner/bin/zts-report.py1
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_import/Makefile.am12
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_added.ksh (renamed from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_added.ksh)0
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_removed.ksh (renamed from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_removed.ksh)0
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_replaced.ksh (renamed from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_replaced.ksh)5
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_mirror_attached.ksh (renamed from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_mirror_attached.ksh)0
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_mirror_detached.ksh (renamed from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_mirror_detached.ksh)0
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_shared_device.ksh (renamed from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_shared_device.ksh)0
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg13
10 files changed, 24 insertions, 19 deletions
diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run
index 5e0dd0832..10c1200a4 100644
--- a/tests/runfiles/linux.run
+++ b/tests/runfiles/linux.run
@@ -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',
diff --git a/tests/test-runner/bin/zts-report.py b/tests/test-runner/bin/zts-report.py
index acb20048e..6c0a2262d 100755
--- a/tests/test-runner/bin/zts-report.py
+++ b/tests/test-runner/bin/zts-report.py
@@ -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'],
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/Makefile.am b/tests/zfs-tests/tests/functional/cli_root/zpool_import/Makefile.am
index 585f10a0b..6f0f5d0b8 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/Makefile.am
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/Makefile.am
@@ -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 \
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_added.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_added.ksh
index ab72042a2..ab72042a2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_added.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_added.ksh
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_removed.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_removed.ksh
index 3fe386123..3fe386123 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_removed.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_removed.ksh
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_replaced.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_replaced.ksh
index 3ad22433d..f42c85b98 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_replaced.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_replaced.ksh
@@ -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
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_mirror_attached.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_mirror_attached.ksh
index b90e24c2c..b90e24c2c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_mirror_attached.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_mirror_attached.ksh
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_mirror_detached.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_mirror_detached.ksh
index ba695418f..ba695418f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_mirror_detached.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_mirror_detached.ksh
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_shared_device.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_shared_device.ksh
index 750857419..750857419 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_shared_device.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_shared_device.ksh
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg
index 20f43cefa..ecdf0ee53 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg
@@ -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))