diff options
author | Slava Pestov <sp@daterainc.com> | 2014-09-10 21:12:52 -0700 |
---|---|---|
committer | Nicholas Swenson <nks@daterainc.com> | 2014-09-15 14:12:41 -0700 |
commit | ed32fb8c6c8ec0e7b8cf1995f7e82de96b6bfa40 (patch) | |
tree | 20b85d07a6d92aa9c5e9a1365f56938f97b3aaf0 | |
parent | c85acbd038dace22c15c8cc1df8fa8be63867dab (diff) |
ktest: replace FS global with setup_fs parameter
- test_stress now runs XFS workload after ext4 if priority > 0
- xfs test is now redundant
- rename ext4 test to blkdev
- bcachefs tests now use setup_bcachefs / stop_bcachefs
Change-Id: Ie05ac8d6af225d69d68521d34b17d39c7804a157
-rw-r--r-- | tests/bcache/bcache-test-libs.sh | 24 | ||||
-rwxr-xr-x | tests/bcache/bcache_backingdev_reboot_fs.ktest | 4 | ||||
-rwxr-xr-x | tests/bcache/bcache_init_errors.ktest | 2 | ||||
-rwxr-xr-x | tests/bcache/bcache_reboot_fs.ktest | 4 | ||||
-rwxr-xr-x | tests/bcache/bcache_xfs.ktest | 25 | ||||
-rwxr-xr-x | tests/bcache/bcachefs-dbench.ktest | 4 | ||||
-rwxr-xr-x | tests/blkdev.ktest (renamed from tests/ext4.ktest) | 2 | ||||
-rw-r--r-- | tests/test-libs.sh | 92 | ||||
-rwxr-xr-x | tests/xfs.ktest | 21 |
9 files changed, 64 insertions, 114 deletions
diff --git a/tests/bcache/bcache-test-libs.sh b/tests/bcache/bcache-test-libs.sh index 3668b10..3c3c134 100644 --- a/tests/bcache/bcache-test-libs.sh +++ b/tests/bcache/bcache-test-libs.sh @@ -251,3 +251,27 @@ cached_dev_settings() #echo 1 > $dir/bypass_torture_test done } + +setup_bcachefs() +{ + uuid=$(ls -d /sys/fs/bcache/*-*-* | sed -e 's/.*\///') + mkdir -p /mnt/bcachefs + mount -t bcachefs $uuid /mnt/bcachefs + + # for fs workloads to know mount point + DEVICES=bcachefs +} + +stop_bcachefs() +{ + umount /mnt/bcachefs +} + +test_bcachefs_stress() +{ + setup_bcachefs + test_dbench + test_bonnie + #test_fsx + stop_bcachefs +} diff --git a/tests/bcache/bcache_backingdev_reboot_fs.ktest b/tests/bcache/bcache_backingdev_reboot_fs.ktest index 6cb23b5..50c3d66 100755 --- a/tests/bcache/bcache_backingdev_reboot_fs.ktest +++ b/tests/bcache/bcache_backingdev_reboot_fs.ktest @@ -19,10 +19,10 @@ main() if [ $NR_REBOOTS = 0 ]; then setup_bcache - setup_fs + setup_fs ext4 else existing_bcache - existing_fs + existing_fs ext4 fi [ $NR_REBOOTS = $nr_iterations ] && exit 0 diff --git a/tests/bcache/bcache_init_errors.ktest b/tests/bcache/bcache_init_errors.ktest index 45e3f0e..bf5b6c9 100755 --- a/tests/bcache/bcache_init_errors.ktest +++ b/tests/bcache/bcache_init_errors.ktest @@ -18,7 +18,7 @@ main() if [ $NR_REBOOTS = 0 ]; then setup_bcache - setup_fs + setup_fs ext4 test_antagonist diff --git a/tests/bcache/bcache_reboot_fs.ktest b/tests/bcache/bcache_reboot_fs.ktest index 149ea10..05a947a 100755 --- a/tests/bcache/bcache_reboot_fs.ktest +++ b/tests/bcache/bcache_reboot_fs.ktest @@ -19,10 +19,10 @@ main() if [ $NR_REBOOTS = 0 ]; then setup_bcache - setup_fs + setup_fs ext4 else existing_bcache - existing_fs + existing_fs ext4 fi [ $NR_REBOOTS = $nr_iterations ] && exit 0 diff --git a/tests/bcache/bcache_xfs.ktest b/tests/bcache/bcache_xfs.ktest deleted file mode 100755 index 4bfa49b..0000000 --- a/tests/bcache/bcache_xfs.ktest +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -require-lib bcache-test-libs.sh -require-kernel-config XFS_FS - -config-cache 512M -config-backing 2G,2G -config-bucket-size 64k -config-block-size 4k -config-writeback -config-mem 512M - -config-timeout $(stress_timeout) - -main() -{ - FS=xfs - - setup_tracing 64 'bcache:*' - - setup_bcache - test_antagonist - test_stress - stop_bcache -} diff --git a/tests/bcache/bcachefs-dbench.ktest b/tests/bcache/bcachefs-dbench.ktest index 820a221..dd406b6 100755 --- a/tests/bcache/bcachefs-dbench.ktest +++ b/tests/bcache/bcachefs-dbench.ktest @@ -12,8 +12,6 @@ config-timeout $(($nr_iterations * 60)) main() { - FS=bcachefs - setup_tracing 64 'bcache:*' if [ $NR_REBOOTS = 0 ]; then @@ -22,9 +20,9 @@ main() existing_bcache fi + setup_bcachefs test_antagonist - setup_fs [ "$NR_REBOOTS" != "$nr_iterations" ] && (sleep 10; do_reboot) & diff --git a/tests/ext4.ktest b/tests/blkdev.ktest index fb9b4d5..59bb0e2 100755 --- a/tests/ext4.ktest +++ b/tests/blkdev.ktest @@ -9,8 +9,6 @@ config-timeout $(stress_timeout) main() { - FS=ext4 - #echo "file inode.c +p" > /sys/kernel/debug/dynamic_debug/control #echo "file dirent.c +p" > /sys/kernel/debug/dynamic_debug/control #echo "file fs.c +p" > /sys/kernel/debug/dynamic_debug/control diff --git a/tests/test-libs.sh b/tests/test-libs.sh index 663eb73..5b45281 100644 --- a/tests/test-libs.sh +++ b/tests/test-libs.sh @@ -86,77 +86,45 @@ dump_trace() } # -# Mount file systems on all bcache block devices. -# The FS variable should be set to one of the following: -# - none -- no file system setup, test doesn't need one -# - ext4 -- ext4 file system on bcache device -# - xfs -- xfs file system on bcache device -# - bcachefs -- bcachefs on cache set +# Mount file systems on all block devices. # existing_fs() { - case $FS in + case $1 in ext4) - for dev in $DEVICES; do - mkdir -p /mnt/$dev - mount $dev /mnt/$dev -t ext4 -o errors=panic - done + opts="errors=panic" ;; xfs) - for dev in $DEVICES; do - mkdir -p /mnt/$dev - mount $dev /mnt/$dev -t xfs -o wsync - done - ;; - bcachefs) - # Hack -- when using bcachefs we don't have a backing - # device or a flash only volume, but we have to invent - # a name for the device for use as the mount point. - if [ "$DEVICES" != "" ]; then - echo "Don't use a backing device or flash-only" - echo "volume with bcachefs" - exit 1 - fi - - dev=/dev/bcache0 - DEVICES=$dev - uuid=$(ls -d /sys/fs/bcache/*-*-* | sed -e 's/.*\///') - echo "Mounting bcachefs on $uuid" - mkdir -p /mnt/$dev - mount -t bcachefs $uuid /mnt/$dev -o errors=panic + opts="wsync" ;; *) - echo "Unsupported file system type: $FS" - exit 1 + opts="" ;; esac + for dev in $DEVICES; do + mkdir -p /mnt/$dev + mount $dev /mnt/$dev -t $1 -o $opts + done } # -# Set up file systems on all bcache block devices and mount them. +# Set up file systems on all block devices and mount them. # -FS=ext4 - -setup_fs() { - case $FS in - ext4) - for dev in $DEVICES; do - mkfs.ext4 $dev - done - ;; - xfs) - for dev in $DEVICES; do - mkfs.xfs $dev - done - ;; - bcachefs) - ;; - *) - echo "Unsupported file system type: $FS" - exit 1 - ;; - esac - existing_fs +setup_fs() +{ + for dev in $DEVICES; do + case $1 in + xfs) + opts="-f" + ;; + *) + opts="" + ;; + esac + + mkfs.$1 $opts $dev + done + existing_fs $1 } stop_fs() @@ -385,12 +353,20 @@ test_stress() test_fio test_discard - setup_fs + setup_fs ext4 test_dbench test_bonnie test_fsx stop_fs test_discard + + if [ $ktest_priority -gt 0 ]; then + setup_fs xfs + test_dbench + test_bonnie + stop_fs + test_discard + fi } stress_timeout() diff --git a/tests/xfs.ktest b/tests/xfs.ktest deleted file mode 100755 index daf35fd..0000000 --- a/tests/xfs.ktest +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -require-lib ./test-libs.sh -require-kernel-config XFS_FS - -config-scratch-devs 2G -config-mem 512M - -config-timeout $(stress_timeout) - -main() -{ - FS=xfs - - #echo "file inode.c +p" > /sys/kernel/debug/dynamic_debug/control - #echo "file dirent.c +p" > /sys/kernel/debug/dynamic_debug/control - #echo "file fs.c +p" > /sys/kernel/debug/dynamic_debug/control - - setup_blkdev - test_stress -} |