diff options
author | Matthew Ahrens <[email protected]> | 2016-01-06 22:22:48 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-06-28 13:47:02 -0700 |
commit | 47dfff3b86c67c6ae184c2b7166eaa529590c2d2 (patch) | |
tree | ea731650ffe4a016c08fb83d2a6f00e6bd6738d4 /tests/zfs-tests | |
parent | 669cf0ab298dd66e512b37f6c4a42aee2d767b80 (diff) |
OpenZFS 2605, 6980, 6902
2605 want to resume interrupted zfs send
Reviewed by: George Wilson <[email protected]>
Reviewed by: Paul Dagnelie <[email protected]>
Reviewed by: Richard Elling <[email protected]>
Reviewed by: Xin Li <[email protected]>
Reviewed by: Arne Jansen <[email protected]>
Approved by: Dan McDonald <[email protected]>
Ported-by: kernelOfTruth <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
OpenZFS-issue: https://www.illumos.org/issues/2605
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/9c3fd12
6980 6902 causes zfs send to break due to 32-bit/64-bit struct mismatch
Reviewed by: Paul Dagnelie <[email protected]>
Reviewed by: George Wilson <[email protected]>
Approved by: Robert Mustacchi <[email protected]>
Ported by: Brian Behlendorf <[email protected]>
OpenZFS-issue: https://www.illumos.org/issues/6980
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ea4a67f
Porting notes:
- All rsend and snapshop tests enabled and updated for Linux.
- Fix misuse of input argument in traverse_visitbp().
- Fix ISO C90 warnings and errors.
- Fix gcc 'missing braces around initializer' in
'struct send_thread_arg to_arg =' warning.
- Replace 4 argument fletcher_4_native() with 3 argument version,
this change was made in OpenZFS 4185 which has not been ported.
- Part of the sections for 'zfs receive' and 'zfs send' was
rewritten and reordered to approximate upstream.
- Fix mktree xattr creation, 'user.' prefix required.
- Minor fixes to newly enabled test cases
- Long holds for volumes allowed during receive for minor registration.
Diffstat (limited to 'tests/zfs-tests')
-rw-r--r-- | tests/zfs-tests/cmd/mktree/mktree.c | 2 | ||||
-rw-r--r-- | tests/zfs-tests/include/commands.cfg.in | 3 | ||||
-rw-r--r-- | tests/zfs-tests/tests/functional/cli_root/zfs_receive/Makefile.am | 5 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh | 2 | ||||
-rw-r--r-- | tests/zfs-tests/tests/functional/rsend/rsend.kshlib | 16 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/zfs-tests/tests/functional/rsend/rsend_014_pos.ksh | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/zfs-tests/tests/functional/rsend/rsend_019_pos.ksh | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/zfs-tests/tests/functional/rsend/rsend_020_pos.ksh | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/zfs-tests/tests/functional/rsend/rsend_021_pos.ksh | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/zfs-tests/tests/functional/rsend/rsend_022_pos.ksh | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/zfs-tests/tests/functional/rsend/rsend_024_pos.ksh | 0 |
12 files changed, 21 insertions, 16 deletions
diff --git a/tests/zfs-tests/cmd/mktree/mktree.c b/tests/zfs-tests/cmd/mktree/mktree.c index 8f9b38578..95d31a652 100644 --- a/tests/zfs-tests/cmd/mktree/mktree.c +++ b/tests/zfs-tests/cmd/mktree/mktree.c @@ -172,7 +172,7 @@ crtfile(char *pname) exit(errno); } - if (fsetxattr(fd, "xattr", pbuf, 1024, 0) < 0) { + if (fsetxattr(fd, "user.xattr", pbuf, 1024, 0) < 0) { (void) fprintf(stderr, "fsetxattr(fd, \"xattr\", pbuf, " "1024, 0) failed.\n[%d]: %s.\n", errno, strerror(errno)); exit(errno); diff --git a/tests/zfs-tests/include/commands.cfg.in b/tests/zfs-tests/include/commands.cfg.in index 823ee9679..bea8df629 100644 --- a/tests/zfs-tests/include/commands.cfg.in +++ b/tests/zfs-tests/include/commands.cfg.in @@ -85,6 +85,7 @@ export SHARE="@SHARE@" export SHUF="@SHUF@" export SLEEP="@SLEEP@" export SORT="@SORT@" +export STAT="@STAT@" export STRINGS="@STRINGS@" export SU="@SU@" export SUM="@SUM@" @@ -97,8 +98,8 @@ export TAIL="@TAIL@" export TAR="@TAR@" export TOUCH="@TOUCH@" export TR="@TR@" -export TRUE="@TRUE@" export TRUNCATE="@TRUNCATE@" +export TRUE="@TRUE@" export UDEVADM="@UDEVADM@" export UFSDUMP="@UFSDUMP@" export UFSRESTORE="@UFSRESTORE@" diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/Makefile.am b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/Makefile.am index 533acc695..f5857f4a4 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/Makefile.am +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/Makefile.am @@ -10,4 +10,7 @@ dist_pkgdata_SCRIPTS = \ zfs_receive_006_pos.ksh \ zfs_receive_007_neg.ksh \ zfs_receive_008_pos.ksh \ - zfs_receive_009_neg.ksh + zfs_receive_009_neg.ksh \ + zfs_receive_010_pos.ksh \ + zfs_receive_011_pos.ksh \ + zfs_receive_012_pos.ksh diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh index 13ae4f024..308903d97 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh @@ -61,7 +61,7 @@ test_pool () first_object=$(ls -i $mntpnt | awk '{print $1}') log_must $ZFS snapshot $POOL/fs@a while true; do - log_must $FIND $mntpnt -delete + log_must $FIND $mntpnt/* -delete sync log_must $MKFILES "$mntpnt/" 4000 FILE=$(ls -i $mntpnt | awk \ diff --git a/tests/zfs-tests/tests/functional/rsend/rsend.kshlib b/tests/zfs-tests/tests/functional/rsend/rsend.kshlib index 91779cc78..4cdf6b731 100644 --- a/tests/zfs-tests/tests/functional/rsend/rsend.kshlib +++ b/tests/zfs-tests/tests/functional/rsend/rsend.kshlib @@ -74,9 +74,11 @@ function setup_test_model if is_global_zone ; then log_must $ZFS create -V 16M $pool/vol log_must $ZFS create -V 16M $pool/$FS/vol + block_device_wait log_must $ZFS snapshot $pool/$FS/vol@vsnap log_must $ZFS clone $pool/$FS/vol@vsnap $pool/$FS/vclone + block_device_wait fi log_must snapshot_tree $pool/$FS/fs1/fs2@fsnap @@ -199,10 +201,10 @@ function cmp_ds_prop typeset dtst1=$1 typeset dtst2=$2 - for item in "type" "origin" "volblocksize" "aclinherit" "aclmode" \ + for item in "type" "origin" "volblocksize" "aclinherit" "acltype" \ "atime" "canmount" "checksum" "compression" "copies" "devices" \ "dnodesize" "exec" "quota" "readonly" "recordsize" "reservation" \ - "setuid" "sharenfs" "snapdir" "version" "volsize" "xattr" "zoned" \ + "setuid" "snapdir" "version" "volsize" "xattr" "zoned" \ "mountpoint"; do $ZFS get -H -o property,value,source $item $dtst1 >> \ @@ -393,7 +395,7 @@ function mk_files for ((i=0; i<$nfiles; i=i+1)); do $DD if=/dev/urandom \ of=/$fs/file-$maxsize-$((i+$file_id_offset)) \ - bs=$(($RANDOM * $RANDOM % $maxsize)) \ + bs=$((($RANDOM * $RANDOM % ($maxsize - 1)) + 1)) \ count=1 >/dev/null 2>&1 || log_fail \ "Failed to create /$fs/file-$maxsize-$((i+$file_id_offset))" done @@ -438,7 +440,7 @@ function mess_file # write the same value that's already there. # log_must eval "$DD if=/dev/urandom of=$file conv=notrunc " \ - "bs=1 count=2 oseek=$offset >/dev/null 2>&1" + "bs=1 count=2 seek=$offset >/dev/null 2>&1" else log_must $TRUNCATE -s $offset $file fi @@ -523,20 +525,20 @@ function test_fs_setup mk_files 100 1048576 0 $sendfs & mk_files 10 10485760 0 $sendfs & mk_files 1 104857600 0 $sendfs & - log_must $WAIT + wait log_must $ZFS snapshot $sendfs@a rm_files 200 256 0 $sendfs & rm_files 200 131072 0 $sendfs & rm_files 20 1048576 0 $sendfs & rm_files 2 10485760 0 $sendfs & - log_must $WAIT + wait mk_files 400 256 0 $sendfs & mk_files 400 131072 0 $sendfs & mk_files 40 1048576 0 $sendfs & mk_files 4 10485760 0 $sendfs & - log_must $WAIT + wait log_must $ZFS snapshot $sendfs@b log_must eval "$ZFS send -v $sendfs@a >/$sendpool/initial.zsend" diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh index 91cdd6e34..a7698da69 100755 --- a/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh +++ b/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh @@ -110,9 +110,6 @@ function cleanup log_must $ZFS inherit $prop $POOL2 done - #if is_shared $POOL; then - # log_must $ZFS set sharenfs=off $POOL - #fi log_must setup_test_model $POOL if [[ -d $TESTDIR ]]; then @@ -131,7 +128,7 @@ for fs in "$POOL" "$POOL/pclone" "$POOL/$FS" "$POOL/$FS/fs1" \ "$POOL/$FS/fs1/fs2" "$POOL/$FS/fs1/fclone" ; do rand_set_prop $fs aclinherit "discard" "noallow" "secure" "passthrough" rand_set_prop $fs checksum "on" "off" "fletcher2" "fletcher4" "sha256" - rand_set_prop $fs aclmode "discard" "groupmask" "passthrough" + rand_set_prop $fs acltype "off" "noacl" "posixacl" rand_set_prop $fs atime "on" "off" rand_set_prop $fs checksum "on" "off" "fletcher2" "fletcher4" "sha256" rand_set_prop $fs compression "on" "off" "lzjb" "gzip" \ @@ -161,7 +158,8 @@ done # Verify inherited property can be received -rand_set_prop $POOL sharenfs "on" "off" "rw" +rand_set_prop $POOL redundant_metadata "all" "most" +rand_set_prop $POOL sync "standard" "always" "disabled" # # Duplicate POOL2 for testing diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_014_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_014_pos.ksh index b6cbb1c63..68576816c 100644..100755 --- a/tests/zfs-tests/tests/functional/rsend/rsend_014_pos.ksh +++ b/tests/zfs-tests/tests/functional/rsend/rsend_014_pos.ksh @@ -46,6 +46,7 @@ log_must cleanup_pool $POOL2 log_must eval "$ZFS send -R $POOL/$FS@final > $BACKDIR/fs-final-R" log_must eval "$ZFS receive -d $POOL2 < $BACKDIR/fs-final-R" +block_device_wait log_must eval "$ZPOOL export $POOL" log_must eval "$ZPOOL import $POOL" diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_019_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_019_pos.ksh index 26f475ea4..26f475ea4 100644..100755 --- a/tests/zfs-tests/tests/functional/rsend/rsend_019_pos.ksh +++ b/tests/zfs-tests/tests/functional/rsend/rsend_019_pos.ksh diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_020_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_020_pos.ksh index 43cf34591..43cf34591 100644..100755 --- a/tests/zfs-tests/tests/functional/rsend/rsend_020_pos.ksh +++ b/tests/zfs-tests/tests/functional/rsend/rsend_020_pos.ksh diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_021_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_021_pos.ksh index 37901213e..37901213e 100644..100755 --- a/tests/zfs-tests/tests/functional/rsend/rsend_021_pos.ksh +++ b/tests/zfs-tests/tests/functional/rsend/rsend_021_pos.ksh diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_022_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_022_pos.ksh index fd06b06fd..fd06b06fd 100644..100755 --- a/tests/zfs-tests/tests/functional/rsend/rsend_022_pos.ksh +++ b/tests/zfs-tests/tests/functional/rsend/rsend_022_pos.ksh diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_024_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_024_pos.ksh index 2f8f3f77d..2f8f3f77d 100644..100755 --- a/tests/zfs-tests/tests/functional/rsend/rsend_024_pos.ksh +++ b/tests/zfs-tests/tests/functional/rsend/rsend_024_pos.ksh |