]> granicus.if.org Git - zfs/commitdiff
ZTS: Fix import_cache_device_replaced
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sun, 19 Aug 2018 04:16:12 +0000 (21:16 -0700)
committerGitHub <noreply@github.com>
Sun, 19 Aug 2018 04:16:12 +0000 (21:16 -0700)
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

tests/runfiles/linux.run
tests/test-runner/bin/zts-report.py
tests/zfs-tests/tests/functional/cli_root/zpool_import/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_added.ksh [moved from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_added.ksh with 100% similarity]
tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_removed.ksh [moved from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_removed.ksh with 100% similarity]
tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_replaced.ksh [moved from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_replaced.ksh with 94% similarity]
tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_mirror_attached.ksh [moved from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_mirror_attached.ksh with 100% similarity]
tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_mirror_detached.ksh [moved from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_mirror_detached.ksh with 100% similarity]
tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_shared_device.ksh [moved from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_shared_device.ksh with 100% similarity]
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg

index 5e0dd0832e25aafda523e0947b35fc1060a71571..10c1200a4a2b7bafacd188aec036552cd0b28051 100644 (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',
index acb20048e6b60a7ae38b878302d0792a6683b5b6..6c0a2262d2604c3d0d50a9355ee84b1553c47283 100755 (executable)
@@ -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'],
index 585f10a0b534d9eea145130c18b2b41bebd576ff..6f0f5d0b867a20e4b22976f9679507a4d974a1f9 100644 (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 \
similarity index 94%
rename from tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cache_device_replaced.ksh
rename to tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_device_replaced.ksh
index 3ad22433d6d17a7a6b86215ae40d2077ac490cc2..f42c85b9837aafd87429a59d1ed4db0281f85cac 100755 (executable)
@@ -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
index 20f43cefa0f9a57566826c3a63f863ec72e088ef..ecdf0ee534668fbb4b59d1806f87891eb42145d5 100644 (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))