aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/runfiles/linux.run3
-rw-r--r--tests/zfs-tests/tests/functional/slog/Makefile.am1
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_015_neg.ksh73
3 files changed, 76 insertions, 1 deletions
diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run
index c4650ab41..ad35e92be 100644
--- a/tests/runfiles/linux.run
+++ b/tests/runfiles/linux.run
@@ -656,7 +656,8 @@ tags = ['functional', 'scrub_mirror']
tests = ['slog_001_pos', 'slog_002_pos', 'slog_003_pos', 'slog_004_pos',
'slog_005_pos', 'slog_006_pos', 'slog_007_pos', 'slog_008_neg',
'slog_009_neg', 'slog_010_neg', 'slog_011_neg', 'slog_012_neg',
- 'slog_013_pos', 'slog_014_pos', 'slog_replay_fs', 'slog_replay_volume']
+ 'slog_013_pos', 'slog_014_pos', 'slog_015_neg', 'slog_replay_fs',
+ 'slog_replay_volume']
tags = ['functional', 'slog']
[tests/functional/snapshot]
diff --git a/tests/zfs-tests/tests/functional/slog/Makefile.am b/tests/zfs-tests/tests/functional/slog/Makefile.am
index f446facfe..157e66707 100644
--- a/tests/zfs-tests/tests/functional/slog/Makefile.am
+++ b/tests/zfs-tests/tests/functional/slog/Makefile.am
@@ -18,5 +18,6 @@ dist_pkgdata_SCRIPTS = \
slog_012_neg.ksh \
slog_013_pos.ksh \
slog_014_pos.ksh \
+ slog_015_neg.ksh \
slog_replay_fs.ksh \
slog_replay_volume.ksh
diff --git a/tests/zfs-tests/tests/functional/slog/slog_015_neg.ksh b/tests/zfs-tests/tests/functional/slog/slog_015_neg.ksh
new file mode 100755
index 000000000..37821888e
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/slog/slog_015_neg.ksh
@@ -0,0 +1,73 @@
+#!/bin/ksh -p
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2017 by Delphix. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/slog/slog.kshlib
+
+#
+# DESCRIPTION:
+# Concurrent sync writes with log offline/online works.
+#
+# STRATEGY:
+# 1. Configure "zfs_commit_timeout_pct"
+# 2. Create pool with a log device.
+# 3. Concurrently do the following:
+# 3.1. Perform 8K sync writes
+# 3.2. Perform log offline/online commands
+# 4. Loop to test with growing "zfs_commit_timout_pct" values.
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ #
+ # Wait for any of the writes and/or zpool commands that were
+ # kicked off in the background to complete. On failure, we may
+ # enter this function without previously waiting for them.
+ #
+ wait
+
+ set_tunable64 zfs_commit_timeout_pct $ORIG_TIMEOUT
+
+ poolexists $TESTPOOL && zpool destroy -f $TESTPOOL
+}
+
+ORIG_TIMEOUT=$(get_tunable zfs_commit_timeout_pct | tail -1 | awk '{print $NF}')
+log_onexit cleanup
+
+for PCT in 0 1 2 4 8 16 32 64 128 256 512 1024; do
+ log_must set_tunable64 zfs_commit_timeout_pct $PCT
+
+ log_must zpool create $TESTPOOL $VDEV log $SDEV
+
+ for i in {1..10}; do
+ log_must fio --rw write --sync 1 --directory "/$TESTPOOL" \
+ --bs 8K --size 8K --name slog-test
+ done &
+
+ for i in {1..10}; do
+ log_must zpool offline $TESTPOOL $SDEV
+ log_must verify_slog_device $TESTPOOL $SDEV 'OFFLINE'
+ log_must zpool online $TESTPOOL $SDEV
+ log_must verify_slog_device $TESTPOOL $SDEV 'ONLINE'
+ done &
+
+ wait
+
+ log_must zpool destroy -f $TESTPOOL
+done
+
+log_pass "Concurrent writes with slog offline/online works."