Skip to content

Commit f330b46

Browse files
authored
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 specify a random fill. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #17739
1 parent 4b764fb commit f330b46

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

tests/zfs-tests/include/libtest.shlib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ function fill_fs # destdir dirnum filenum bytes num_writes data
10851085
typeset -i filenum=${3:-50}
10861086
typeset -i bytes=${4:-8192}
10871087
typeset -i num_writes=${5:-10240}
1088-
typeset data=${6:-0}
1088+
typeset data=${6:-"R"}
10891089

10901090
mkdir -p $destdir/{1..$dirnum}
10911091
for f in $destdir/{1..$dirnum}/$TESTFILE{1..$filenum}; do

tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ log_must zpool set autoreplace=on $TESTPOOL
8686

8787
# Add some data to the pool
8888
log_must zfs create $TESTPOOL/fs
89-
log_must fill_fs /$TESTPOOL/fs 4 100 4096 512 Z
89+
log_must fill_fs /$TESTPOOL/fs 4 100 4096 512 R
9090
log_must zpool export $TESTPOOL
9191

9292
# Record the partition UUID for later comparison

tests/zfs-tests/tests/functional/fault/auto_replace_002_pos.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ log_must zpool set autoreplace=on $TESTPOOL
119119

120120
# Add some data to the pool
121121
log_must zfs create $TESTPOOL/fs
122-
log_must fill_fs /$TESTPOOL/fs 4 100 4096 512 Z
122+
log_must fill_fs /$TESTPOOL/fs 4 100 4096 512 R
123123
log_must zpool export $TESTPOOL
124124

125125
# Record the partition UUID for later comparison

tests/zfs-tests/tests/functional/fault/suspend_on_probe_errors.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ sync_pool $TESTPOOL
101101
log_must zfs create $TESTPOOL/fs
102102
MNTPOINT="$(get_prop mountpoint $TESTPOOL/fs)"
103103
SECONDS=0
104-
log_must fill_fs $MNTPOINT 1 200 4096 10 Z
104+
log_must fill_fs $MNTPOINT 1 200 4096 10 R
105105
log_note "fill_fs took $SECONDS seconds"
106106
sync_pool $TESTPOOL
107107

0 commit comments

Comments
 (0)