#
# DESCRIPTION:
-#
+# Verify that a raw zfs send and receive can deal with several different
+# types of file layouts.
#
# STRATEGY:
# 1. Create a new encrypted filesystem
# 3. Add a small 512 byte file to the filesystem
# 4. Add a larger 32M file to the filesystem
# 5. Add a large sparse file to the filesystem
-# 6. Add a 3 files that are to be truncated later
-# 7. Add 1000 empty files to the filesystem
-# 8. Add a file with a large xattr value
-# 9. Use xattrtest to create files with random xattrs (with and without xattrs=on)
-# 10. Take a snapshot of the filesystem
-# 11. Truncate one of the files from 32M to 128k
-# 12. Truncate one of the files from 512k to 384k
-# 13. Truncate one of the files from 512k to 0 to 384k
-# 14. Remove the 1000 empty files to the filesystem
-# 15. Take another snapshot of the filesystem
-# 16. Send and receive both snapshots
-# 17. Mount the filesystem and check the contents
+# 6. Add 1000 empty files to the filesystem
+# 7. Add a file with a large xattr value
+# 8. Use xattrtest to create files with random xattrs (with and without xattrs=on)
+# 9. Take a snapshot of the filesystem
+# 10. Remove the 1000 empty files to the filesystem
+# 11. Take another snapshot of the filesystem
+# 12. Send and receive both snapshots
+# 13. Mount the filesystem and check the contents
#
verify_runnable "both"
log_must zfs create -o encryption=on -o keyformat=passphrase \
-o keylocation=file://$keyfile $TESTPOOL/$TESTFS2
-# Create files with vaired layouts on disk
+# Create files with varied layouts on disk
log_must touch /$TESTPOOL/$TESTFS2/empty
log_must mkfile 512 /$TESTPOOL/$TESTFS2/small
log_must mkfile 32M /$TESTPOOL/$TESTFS2/full
log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS2/sparse \
bs=512 count=1 seek=1048576 >/dev/null 2>&1
-log_must mkfile 32M /$TESTPOOL/$TESTFS2/truncated
-log_must mkfile 524288 /$TESTPOOL/$TESTFS2/truncated2
-log_must mkfile 524288 /$TESTPOOL/$TESTFS2/truncated3
log_must mkdir -p /$TESTPOOL/$TESTFS2/dir
for i in {1..1000}; do
log_must touch /$TESTPOOL/$TESTFS2/attrs
log_must eval "python -c 'print \"a\" * 4096' | \
attr -s bigval /$TESTPOOL/$TESTFS2/attrs"
+log_must zfs set compression=off xattr=on $TESTPOOL/$TESTFS2
log_must zfs snapshot $TESTPOOL/$TESTFS2@snap1
-#
-# Truncate files created in the first snapshot. The first tests
-# truncating a large file to a single block. The second tests
-# truncating one block off the end of a file without changing
-# the required nlevels to hold it. The last tests handling
-# of a maxblkid that is dropped and then raised again.
-#
-log_must truncate -s 131072 /$TESTPOOL/$TESTFS2/truncated
-log_must truncate -s 393216 /$TESTPOOL/$TESTFS2/truncated2
-log_must truncate -s 0 /$TESTPOOL/$TESTFS2/truncated3
-log_must zpool sync $TESTPOOL
-log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS2/truncated3 \
- bs=128k count=3 iflag=fullblock
-
# Remove the empty files created in the first snapshot
for i in {1..1000}; do
log_must rm /$TESTPOOL/$TESTFS2/dir/file-$i