Skip to content

Commit

Permalink
ZTS: Only use ext4 on Linux
Browse files Browse the repository at this point in the history
And while here, add a workaround for FreeBSD to ensure dirty data is
synced before taking a snapshot, by remounting read-only, then remount
again read-write after the snapshot.

Reviewed-by: John Kennedy <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #9914
  • Loading branch information
Ryan Moeller authored Jan 31, 2020
1 parent fe7c159 commit 591505d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/zfs-tests/tests/functional/rsend/send-wDR_encrypted_zvol.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ verify_runnable "both"

function cleanup
{
ismounted $recvmnt ext4 && log_must umount $recvmnt
ismounted $mntpnt ext4 && log_must umount $mntpnt
ismounted $recvmnt $fstype && log_must umount $recvmnt
ismounted $mntpnt $fstype && log_must umount $mntpnt
[[ -d $recvmnt ]] && log_must rm -rf $keyfile
[[ -d $mntpnt ]] && log_must rm -rf $keyfile
destroy_dataset $TESTPOOL/recv "-r"
Expand All @@ -57,6 +57,7 @@ typeset mntpnt=$TESTDIR/$TESTVOL
typeset recvdev=$ZVOL_DEVDIR/$TESTPOOL/recv
typeset recvmnt=$TESTDIR/recvmnt
typeset sendfile=$TESTDIR/sendfile
typeset fstype=none

log_must eval "echo 'password' > $keyfile"

Expand All @@ -67,8 +68,14 @@ block_device_wait
if is_linux; then
# ext4 only supported on Linux
log_must new_fs -t ext4 $zdev
fstype=ext4
typeset remount_ro="-o remount,ro"
typeset remount_rw="-o remount,rw"
else
log_must new_fs $zdev
fstype=$NEWFS_DEFAULT_FS
typeset remount_ro="-ur"
typeset remount_rw="-uw"
fi
log_must mkdir -p $mntpnt
log_must mkdir -p $recvmnt
Expand All @@ -81,7 +88,9 @@ for ((i = 1; i <= $snap_count; i++)); do
done

log_must sync
log_must mount $remount_ro $zdev $mntpnt
log_must zfs snap $TESTPOOL/$TESTVOL@snap$i
log_must mount $remount_rw $zdev $mntpnt
done

log_must eval "zfs send -wDR $TESTPOOL/$TESTVOL@snap$snap_count > $sendfile"
Expand Down

0 comments on commit 591505d

Please sign in to comment.