From 3c144a51959d7f2700d453ef634343b44d947ee8 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 12 Sep 2025 15:42:31 -0700 Subject: [PATCH] ZTS: default to random data in fill_fs Update the fill_fs helper function to request a random fill pattern when the "data" argument isn't specified. This ensures the default behavior is to perform a more realistic fill of incompressible blocks. Additionally, update a few test cases to request a random fill. Signed-off-by: Brian Behlendorf --- tests/zfs-tests/include/libtest.shlib | 2 +- tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh | 2 +- tests/zfs-tests/tests/functional/fault/auto_replace_002_pos.ksh | 2 +- .../tests/functional/fault/suspend_on_probe_errors.ksh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index 6b0f8b18c4b6..8b30b9b91641 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -1085,7 +1085,7 @@ function fill_fs # destdir dirnum filenum bytes num_writes data typeset -i filenum=${3:-50} typeset -i bytes=${4:-8192} typeset -i num_writes=${5:-10240} - typeset data=${6:-0} + typeset data=${6:-"R"} mkdir -p $destdir/{1..$dirnum} for f in $destdir/{1..$dirnum}/$TESTFILE{1..$filenum}; do diff --git a/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh b/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh index ef49a5d50f6c..45848bec1f5a 100755 --- a/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh @@ -86,7 +86,7 @@ log_must zpool set autoreplace=on $TESTPOOL # Add some data to the pool log_must zfs create $TESTPOOL/fs -log_must fill_fs /$TESTPOOL/fs 4 100 4096 512 Z +log_must fill_fs /$TESTPOOL/fs 4 100 4096 512 R log_must zpool export $TESTPOOL # Record the partition UUID for later comparison diff --git a/tests/zfs-tests/tests/functional/fault/auto_replace_002_pos.ksh b/tests/zfs-tests/tests/functional/fault/auto_replace_002_pos.ksh index a77957f32255..878b4e450340 100755 --- a/tests/zfs-tests/tests/functional/fault/auto_replace_002_pos.ksh +++ b/tests/zfs-tests/tests/functional/fault/auto_replace_002_pos.ksh @@ -119,7 +119,7 @@ log_must zpool set autoreplace=on $TESTPOOL # Add some data to the pool log_must zfs create $TESTPOOL/fs -log_must fill_fs /$TESTPOOL/fs 4 100 4096 512 Z +log_must fill_fs /$TESTPOOL/fs 4 100 4096 512 R log_must zpool export $TESTPOOL # Record the partition UUID for later comparison diff --git a/tests/zfs-tests/tests/functional/fault/suspend_on_probe_errors.ksh b/tests/zfs-tests/tests/functional/fault/suspend_on_probe_errors.ksh index 340994bb60c5..b5df1c7e37f8 100755 --- a/tests/zfs-tests/tests/functional/fault/suspend_on_probe_errors.ksh +++ b/tests/zfs-tests/tests/functional/fault/suspend_on_probe_errors.ksh @@ -101,7 +101,7 @@ sync_pool $TESTPOOL log_must zfs create $TESTPOOL/fs MNTPOINT="$(get_prop mountpoint $TESTPOOL/fs)" SECONDS=0 -log_must fill_fs $MNTPOINT 1 200 4096 10 Z +log_must fill_fs $MNTPOINT 1 200 4096 10 R log_note "fill_fs took $SECONDS seconds" sync_pool $TESTPOOL