mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fstests: btrfs: Use compressible data
/dev/urandom is incompressible and, /dev/zero is highly compressible, so both are less effective in testing the compress code logic in btrfs. This patch introduces a text data generator cat /dev/urandom | od to populate the files where /dev/urandom is currently being used in the btrfs test cases. And updates the _populate_fs() with a new option -c, so to instruct to use the compressible data to populate the file(s). [eguan: add comments, fix indention] Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
+3
-6
@@ -81,12 +81,9 @@ run_test()
|
||||
local missing_dev_id=`$BTRFS_UTIL_PROG fi show $SCRATCH_MNT | grep $missing_dev | awk '{print $2}'`
|
||||
|
||||
# get some data on the filesystem so there's something to replace
|
||||
dd if=/dev/urandom of="$SCRATCH_MNT"/file1 bs=1M count=1 \
|
||||
>>$seqres.full 2>&1
|
||||
dd if=/dev/urandom of="$SCRATCH_MNT"/file2 bs=1M count=2 \
|
||||
>>$seqres.full 2>&1
|
||||
dd if=/dev/urandom of="$SCRATCH_MNT"/file3 bs=1M count=4 \
|
||||
>>$seqres.full 2>&1
|
||||
_ddt of="$SCRATCH_MNT"/file1 bs=1M count=1 >> $seqres.full 2>&1
|
||||
_ddt of="$SCRATCH_MNT"/file2 bs=1M count=2 >> $seqres.full 2>&1
|
||||
_ddt of="$SCRATCH_MNT"/file3 bs=1M count=4 >> $seqres.full 2>&1
|
||||
|
||||
# nuke a device and remount in degraded mode
|
||||
_scratch_unmount
|
||||
|
||||
Reference in New Issue
Block a user