OpenZFS 7535 - need test for resumed send of top most filesystem

Authored by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>

Porting Notes:
- zfs_share_001_pos.ksh - Older versions of exportfs will match
  multiple exports that share a common prefix.  Reorder the 'fs'
  list so unshares occur from most to least unique.
- zfs_share_005_pos.ksh - Enabled and updated for Linux.

OpenZFS-issue: https://www.illumos.org/issues/7535
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ac89d1e
Closes #5979
This commit is contained in:
Brian Behlendorf
2017-04-12 08:47:42 -07:00
committed by GitHub
parent 17b43f96f9
commit dd49132a1d
15 changed files with 107 additions and 87 deletions
@@ -42,7 +42,7 @@ function cleanup
zfs destroy -rf $TESTPOOL/recvfs
rm $streamfile
rm $vdev
zpool destroy testpool
zpool destroy tmp_pool
}
@@ -88,12 +88,11 @@ test_pool ()
test_pool $TESTPOOL
log_must truncate --size=1G $vdev
log_must zpool create -o version=1 testpool $vdev
test_pool testpool
log_must zpool destroy testpool
log_must zpool create -d testpool $vdev
test_pool testpool
log_must zpool destroy testpool
log_must zpool create -o version=1 tmp_pool $vdev
test_pool tmp_pool
log_must zpool destroy tmp_pool
log_must zpool create -d tmp_pool $vdev
test_pool tmp_pool
log_must zpool destroy tmp_pool
log_pass "'zfs send' drills appropriate holes"
@@ -47,9 +47,9 @@
verify_runnable "global"
set -A fs \
"$TESTDIR" "$TESTPOOL/$TESTFS" \
"$TESTDIR1" "$TESTPOOL/$TESTCTR/$TESTFS1" \
"$TESTDIR2" "$TESTPOOL/$TESTFS-clone"
"$TESTDIR2" "$TESTPOOL/$TESTFS-clone" \
"$TESTDIR" "$TESTPOOL/$TESTFS"
function cleanup
{
@@ -50,12 +50,17 @@ function cleanup
log_must unshare_fs $TESTPOOL/$TESTFS
}
set -A shareopts \
"ro" "ro=machine1" "ro=machine1:machine2" \
"rw" "rw=machine1" "rw=machine1:machine2" \
"ro=machine1:machine2,rw" "anon=0" "anon=0,sec=sys,rw" \
"nosuid" "root=machine1:machine2" "rw=.mydomain.mycompany.com" \
"rw=-terra:engineering" "log" "public"
if is_linux; then
set -A shareopts \
"ro" "rw" "rw,insecure" "rw,async" "ro,crossmnt"
else
set -A shareopts \
"ro" "ro=machine1" "ro=machine1:machine2" \
"rw" "rw=machine1" "rw=machine1:machine2" \
"ro=machine1:machine2,rw" "anon=0" "anon=0,sec=sys,rw" \
"nosuid" "root=machine1:machine2" "rw=.mydomain.mycompany.com" \
"rw=-terra:engineering" "log" "public"
fi
log_assert "Verify that NFS share options are propagated correctly."
log_onexit cleanup
@@ -72,6 +77,11 @@ do
log_fail "get sharenfs failed. ($option != ${shareopts[i]})"
fi
# Verify the single option after the leading 'ro' or 'rw'.
if is_linux; then
option=`echo "$option" | cut -f2 -d','`
fi
showshares_nfs | grep $option > /dev/null 2>&1
if (( $? != 0 )); then
log_fail "The '$option' option was not found in share output."
@@ -164,10 +164,11 @@ done
VDEV_FILE=$(mktemp /tmp/tmp.XXXXXX)
log_must mkfile -n 128M $VDEV_FILE
log_must zpool create testpool $VDEV_FILE
log_must zfs create testpool/testfs
ID=$(zpool get -Ho value guid testpool)
log_must zpool export testpool
log_mustnot zpool import $(echo id) $(printf "%*s\n" 250 "" | tr ' ' 'c')
log_must zpool create overflow $VDEV_FILE
log_must zfs create overflow/testfs
ID=$(zpool get -Ho value guid overflow)
log_must zpool export overflow
log_mustnot zpool import -d /tmp $(echo id) \
$(printf "%*s\n" 250 "" | tr ' ' 'c')
log_pass "Successfully imported and renamed a ZPOOL"