summaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-02-20 11:11:51 -0500
committerGitHub <[email protected]>2020-02-20 08:11:51 -0800
commit325a551232cb714cebf167d327d512a64256bcd0 (patch)
tree5ae0ea3a3bbaeb30849ae159282304f81cb78076 /tests/zfs-tests
parent65635c34034933f5adaf3a6e470a06e12a9435ae (diff)
ZTS: Fix faulty slog_replay_fs_001 test
This test is supposed to verify zil operations. For TX_WRITE, writes must be synchronous in order to be entered in the zil. Linux seems to be doing sync writes even when they are not asked for, but on FreeBSD the test does not do what is intended. Use dd oflag=sync for the parts of this test that are supposed to result in TX_WRITE zil entries. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10022
Diffstat (limited to 'tests/zfs-tests')
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh34
1 files changed, 21 insertions, 13 deletions
diff --git a/tests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh b/tests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh
index 182033777..0b78a099f 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh
@@ -108,12 +108,15 @@ log_must rmdir /$TESTPOOL/$TESTFS/dir_to_delete
# Create a simple validation payload
log_must mkdir -p $TESTDIR
-log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/payload bs=1k count=8
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/payload \
+ oflag=sync bs=1k count=8
typeset checksum=$(sha256digest /$TESTPOOL/$TESTFS/payload)
# TX_WRITE (small file with ordering)
-log_must mkfile 1k /$TESTPOOL/$TESTFS/small_file
-log_must mkfile 512b /$TESTPOOL/$TESTFS/small_file
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/small_file \
+ oflag=sync bs=1k count=1
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/small_file \
+ oflag=sync bs=512 count=1
# TX_CREATE, TX_MKDIR, TX_REMOVE, TX_RMDIR
log_must cp -R /usr/share/dict /$TESTPOOL/$TESTFS
@@ -135,18 +138,23 @@ log_must truncate -s 0 /$TESTPOOL/$TESTFS/truncated_file
# TX_WRITE (large file)
log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/large \
- bs=128k count=64 oflag=sync
+ oflag=sync bs=128k count=64
# Write zeros, which compress to holes, in the middle of a file
-log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.1 bs=128k count=8
-log_must dd if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.1 bs=128k count=2
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.1 \
+ oflag=sync bs=128k count=8
+log_must dd if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.1 \
+ oflag=sync bs=128k count=2
-log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.2 bs=128k count=8
-log_must dd if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.2 bs=128k count=2 seek=2
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.2 \
+ oflag=sync bs=128k count=8
+log_must dd if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.2 \
+ oflag=sync bs=128k count=2 seek=2
-log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.3 bs=128k count=8
-log_must dd if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.3 bs=128k count=2 \
- seek=2 conv=notrunc
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/holes.3 \
+ oflag=sync bs=128k count=8
+log_must dd if=/dev/zero of=/$TESTPOOL/$TESTFS/holes.3 \
+ oflag=sync bs=128k count=2 seek=2 conv=notrunc
# TX_MKXATTR
log_must mkdir /$TESTPOOL/$TESTFS/xattr.dir
@@ -161,8 +169,8 @@ log_must rm_xattr tmpattr /$TESTPOOL/$TESTFS/xattr.file
# TX_WRITE, TX_LINK, TX_REMOVE
# Make sure TX_REMOVE won't affect TX_WRITE if file is not destroyed
-log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/link_and_unlink bs=128k \
- count=8
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/link_and_unlink \
+ oflag=sync bs=128k count=8
log_must ln /$TESTPOOL/$TESTFS/link_and_unlink \
/$TESTPOOL/$TESTFS/link_and_unlink.link
log_must rm /$TESTPOOL/$TESTFS/link_and_unlink.link