aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-01-31 12:00:47 -0500
committerGitHub <[email protected]>2020-01-31 09:00:47 -0800
commit591505dc2737bcd77c587e369e1d91b0fd97325c (patch)
tree9fd0c0d3e6955c754be30d4fecc4ede43e00af9a /tests
parentfe7c15985b184e6e15320755ebcea0ec786be59c (diff)
ZTS: Only use ext4 on Linux
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
Diffstat (limited to 'tests')
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/send-wDR_encrypted_zvol.ksh13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/zfs-tests/tests/functional/rsend/send-wDR_encrypted_zvol.ksh b/tests/zfs-tests/tests/functional/rsend/send-wDR_encrypted_zvol.ksh
index b2797cce7..f9cfeee21 100755
--- a/tests/zfs-tests/tests/functional/rsend/send-wDR_encrypted_zvol.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/send-wDR_encrypted_zvol.ksh
@@ -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"
@@ -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"
@@ -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
@@ -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"