Print this page
7290 ZFS test suite needs to control what utilities it can run
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/test/zfs-tests/tests/functional/rsend/rsend.kshlib
          +++ new/usr/src/test/zfs-tests/tests/functional/rsend/rsend.kshlib
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18  #
  19   19  # CDDL HEADER END
  20   20  #
  21   21  
  22   22  #
  23   23  # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24  # Use is subject to license terms.
  25   25  #
  26   26  
  27   27  #
  28      -# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
       28 +# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
  29   29  #
  30   30  
  31   31  . $STF_SUITE/include/libtest.shlib
  32   32  . $STF_SUITE/tests/functional/rsend/rsend.cfg
  33   33  
  34   34  #
  35   35  # Set up test model which includes various datasets
  36   36  #
  37   37  #               @final
  38   38  #               @snapB
↓ open down ↓ 20 lines elided ↑ open up ↑
  59   59  #                                 @init
  60   60  #                                 @snapC
  61   61  #                                 @final
  62   62  #
  63   63  # $1 pool name
  64   64  #
  65   65  function setup_test_model
  66   66  {
  67   67          typeset pool=$1
  68   68  
  69      -        log_must $ZFS create -p $pool/$FS/fs1/fs2
       69 +        log_must zfs create -p $pool/$FS/fs1/fs2
  70   70  
  71      -        log_must $ZFS snapshot $pool@psnap
  72      -        log_must $ZFS clone $pool@psnap $pool/pclone
       71 +        log_must zfs snapshot $pool@psnap
       72 +        log_must zfs clone $pool@psnap $pool/pclone
  73   73  
  74   74          if is_global_zone ; then
  75      -                log_must $ZFS create -V 16M $pool/vol
  76      -                log_must $ZFS create -V 16M $pool/$FS/vol
       75 +                log_must zfs create -V 16M $pool/vol
       76 +                log_must zfs create -V 16M $pool/$FS/vol
  77   77  
  78      -                log_must $ZFS snapshot $pool/$FS/vol@vsnap
  79      -                log_must $ZFS clone $pool/$FS/vol@vsnap $pool/$FS/vclone
       78 +                log_must zfs snapshot $pool/$FS/vol@vsnap
       79 +                log_must zfs clone $pool/$FS/vol@vsnap $pool/$FS/vclone
  80   80          fi
  81   81  
  82   82          log_must snapshot_tree $pool/$FS/fs1/fs2@fsnap
  83      -        log_must $ZFS clone $pool/$FS/fs1/fs2@fsnap $pool/$FS/fs1/fclone
  84      -        log_must $ZFS snapshot -r $pool@init
       83 +        log_must zfs clone $pool/$FS/fs1/fs2@fsnap $pool/$FS/fs1/fclone
       84 +        log_must zfs snapshot -r $pool@init
  85   85  
  86   86          log_must snapshot_tree $pool@snapA
  87   87          log_must snapshot_tree $pool@snapC
  88   88          log_must snapshot_tree $pool/pclone@snapB
  89   89          log_must snapshot_tree $pool/$FS@snapB
  90   90          log_must snapshot_tree $pool/$FS@snapC
  91   91          log_must snapshot_tree $pool/$FS/fs1@snapA
  92   92          log_must snapshot_tree $pool/$FS/fs1@snapB
  93   93          log_must snapshot_tree $pool/$FS/fs1@snapC
  94   94          log_must snapshot_tree $pool/$FS/fs1/fclone@snapA
  95   95  
  96   96          if is_global_zone ; then
  97      -                log_must $ZFS snapshot $pool/vol@snapA
  98      -                log_must $ZFS snapshot $pool/$FS/vol@snapB
  99      -                log_must $ZFS snapshot $pool/$FS/vol@snapC
 100      -                log_must $ZFS snapshot $pool/$FS/vclone@snapC
       97 +                log_must zfs snapshot $pool/vol@snapA
       98 +                log_must zfs snapshot $pool/$FS/vol@snapB
       99 +                log_must zfs snapshot $pool/$FS/vol@snapC
      100 +                log_must zfs snapshot $pool/$FS/vclone@snapC
 101  101          fi
 102  102  
 103      -        log_must $ZFS snapshot -r $pool@final
      103 +        log_must zfs snapshot -r $pool@final
 104  104  
 105  105          return 0
 106  106  }
 107  107  
 108  108  #
 109  109  # Cleanup the BACKDIR and given pool content and all the sub datasets
 110  110  #
 111  111  # $1 pool name
 112  112  #
 113  113  function cleanup_pool
 114  114  {
 115  115          typeset pool=$1
 116      -        log_must $RM -rf $BACKDIR/*
      116 +        log_must rm -rf $BACKDIR/*
 117  117  
 118  118          if is_global_zone ; then
 119      -                log_must $ZFS destroy -Rf $pool
      119 +                log_must zfs destroy -Rf $pool
 120  120          else
 121      -                typeset list=$($ZFS list -H -r -t filesystem,snapshot,volume -o name $pool)
      121 +                typeset list=$(zfs list -H -r -t filesystem,snapshot,volume -o name $pool)
 122  122                  for ds in $list ; do
 123  123                          if [[ $ds != $pool ]] ; then
 124  124                                  if datasetexists $ds ; then
 125      -                                        log_must $ZFS destroy -Rf $ds
      125 +                                        log_must zfs destroy -Rf $ds
 126  126                                  fi
 127  127                          fi
 128  128                  done
 129  129          fi
 130  130  
 131  131          typeset mntpnt=$(get_prop mountpoint $pool)
 132  132          if ! ismounted $pool ; then
 133  133                  # Make sure mountpoint directory is empty
 134  134                  if [[ -d $mntpnt ]]; then
 135      -                        log_must $RM -rf $mntpnt/*
      135 +                        log_must rm -rf $mntpnt/*
 136  136                  fi
 137  137  
 138      -                log_must $ZFS mount $pool
      138 +                log_must zfs mount $pool
 139  139          fi
 140  140          if [[ -d $mntpnt ]]; then
 141      -                log_must $RM -rf $mntpnt/*
      141 +                log_must rm -rf $mntpnt/*
 142  142          fi
 143  143  
 144  144          return 0
 145  145  }
 146  146  
 147  147  #
 148  148  # Detect if the given two filesystems have same sub-datasets
 149  149  #
 150  150  # $1 source filesystem
 151  151  # $2 destination filesystem
 152  152  #
 153  153  function cmp_ds_subs
 154  154  {
 155  155          typeset src_fs=$1
 156  156          typeset dst_fs=$2
 157  157  
 158      -        $ZFS list -r -H -t filesystem,snapshot,volume -o name $src_fs > $BACKDIR/src1
 159      -        $ZFS list -r -H -t filesystem,snapshot,volume -o name $dst_fs > $BACKDIR/dst1
      158 +        zfs list -r -H -t filesystem,snapshot,volume -o name $src_fs > $BACKDIR/src1
      159 +        zfs list -r -H -t filesystem,snapshot,volume -o name $dst_fs > $BACKDIR/dst1
 160  160  
 161      -        eval $SED -e 's:^$src_fs:PREFIX:g' < $BACKDIR/src1 > $BACKDIR/src
 162      -        eval $SED -e 's:^$dst_fs:PREFIX:g' < $BACKDIR/dst1 > $BACKDIR/dst
      161 +        eval sed -e 's:^$src_fs:PREFIX:g' < $BACKDIR/src1 > $BACKDIR/src
      162 +        eval sed -e 's:^$dst_fs:PREFIX:g' < $BACKDIR/dst1 > $BACKDIR/dst
 163  163  
 164      -        $DIFF $BACKDIR/src $BACKDIR/dst
      164 +        diff $BACKDIR/src $BACKDIR/dst
 165  165          typeset -i ret=$?
 166  166  
 167      -        $RM -f $BACKDIR/src $BACKDIR/dst $BACKDIR/src1 $BACKDIR/dst1
      167 +        rm -f $BACKDIR/src $BACKDIR/dst $BACKDIR/src1 $BACKDIR/dst1
 168  168  
 169  169          return $ret
 170  170  }
 171  171  
 172  172  #
 173  173  # Compare all the directores and files in two filesystems
 174  174  #
 175  175  # $1 source filesystem
 176  176  # $2 destination filesystem
 177  177  #
 178  178  function cmp_ds_cont
 179  179  {
 180  180          typeset src_fs=$1
 181  181          typeset dst_fs=$2
 182  182  
 183  183          typeset srcdir dstdir
 184  184          srcdir=$(get_prop mountpoint $src_fs)
 185  185          dstdir=$(get_prop mountpoint $dst_fs)
 186  186  
 187      -        $DIFF -r $srcdir $dstdir > /dev/null 2>&1
      187 +        diff -r $srcdir $dstdir > /dev/null 2>&1
 188  188          echo $?
 189  189  }
 190  190  
 191  191  #
 192  192  # Compare the given two dataset properties
 193  193  #
 194  194  # $1 dataset 1
 195  195  # $2 dataset 2
 196  196  #
 197  197  function cmp_ds_prop
 198  198  {
 199  199          typeset dtst1=$1
 200  200          typeset dtst2=$2
 201  201  
 202  202          for item in "type" "origin" "volblocksize" "aclinherit" "aclmode" \
 203  203              "atime" "canmount" "checksum" "compression" "copies" "devices" \
 204  204              "exec" "quota" "readonly" "recordsize" "reservation" "setuid" \
 205  205              "sharenfs" "snapdir" "version" "volsize" "xattr" "zoned" \
 206  206              "mountpoint";
 207  207          do
 208      -                $ZFS get -H -o property,value,source $item $dtst1 >> \
      208 +                zfs get -H -o property,value,source $item $dtst1 >> \
 209  209                      $BACKDIR/dtst1
 210      -                $ZFS get -H -o property,value,source $item $dtst2 >> \
      210 +                zfs get -H -o property,value,source $item $dtst2 >> \
 211  211                      $BACKDIR/dtst2
 212  212          done
 213  213  
 214      -        eval $SED -e 's:$dtst1:PREFIX:g' < $BACKDIR/dtst1 > $BACKDIR/dtst1
 215      -        eval $SED -e 's:$dtst2:PREFIX:g' < $BACKDIR/dtst2 > $BACKDIR/dtst2
      214 +        eval sed -e 's:$dtst1:PREFIX:g' < $BACKDIR/dtst1 > $BACKDIR/dtst1
      215 +        eval sed -e 's:$dtst2:PREFIX:g' < $BACKDIR/dtst2 > $BACKDIR/dtst2
 216  216  
 217      -        $DIFF $BACKDIR/dtst1 $BACKDIR/dtst2
      217 +        diff $BACKDIR/dtst1 $BACKDIR/dtst2
 218  218          typeset -i ret=$?
 219  219  
 220      -        $RM -f $BACKDIR/dtst1 $BACKDIR/dtst2
      220 +        rm -f $BACKDIR/dtst1 $BACKDIR/dtst2
 221  221  
 222  222          return $ret
 223  223  
 224  224  }
 225  225  
 226  226  #
 227  227  # Random create directories and files
 228  228  #
 229  229  # $1 directory
 230  230  #
 231  231  function random_tree
 232  232  {
 233  233          typeset dir=$1
 234  234  
 235  235          if [[ -d $dir ]]; then
 236      -                $RM -rf $dir
      236 +                rm -rf $dir
 237  237          fi
 238      -        $MKDIR -p $dir
      238 +        mkdir -p $dir
 239  239          typeset -i ret=$?
 240  240  
 241  241          typeset -i nl nd nf
 242  242          ((nl = RANDOM % 6 + 1))
 243  243          ((nd = RANDOM % 3 ))
 244  244          ((nf = RANDOM % 5 ))
 245      -        $MKTREE -b $dir -l $nl -d $nd -f $nf
      245 +        mktree -b $dir -l $nl -d $nd -f $nf
 246  246          ((ret |= $?))
 247  247  
 248  248          return $ret
 249  249  }
 250  250  
 251  251  #
 252  252  # Put data in filesystem and take snapshot
 253  253  #
 254  254  # $1 snapshot name
 255  255  #
↓ open down ↓ 8 lines elided ↑ open up ↑
 264  264                  typeset mntpnt=$(get_prop mountpoint $ds)
 265  265                  ((ret |= $?))
 266  266  
 267  267                  if ((ret == 0)) ; then
 268  268                          eval random_tree $mntpnt/${snap##$ds}
 269  269                          ((ret |= $?))
 270  270                  fi
 271  271          fi
 272  272  
 273  273          if ((ret == 0)) ; then
 274      -                $ZFS snapshot $snap
      274 +                zfs snapshot $snap
 275  275                  ((ret |= $?))
 276  276          fi
 277  277  
 278  278          return $ret
 279  279  }
 280  280  
 281  281  #
 282  282  # Destroy the given snapshot and stuff
 283  283  #
 284  284  # $1 snapshot
 285  285  #
 286  286  function destroy_tree
 287  287  {
 288  288          typeset -i ret=0
 289  289          typeset snap
 290  290          for snap in "$@" ; do
 291      -                $ZFS destroy $snap
      291 +                zfs destroy $snap
 292  292                  ret=$?
 293  293  
 294  294                  typeset ds=${snap%%@*}
 295  295                  typeset type=$(get_prop "type" $ds)
 296  296                  if [[ $type == "filesystem" ]]; then
 297  297                          typeset mntpnt=$(get_prop mountpoint $ds)
 298  298                          ((ret |= $?))
 299  299  
 300  300                          if ((ret != 0)); then
 301      -                                $RM -r $mntpnt/$snap
      301 +                                rm -r $mntpnt/$snap
 302  302                                  ((ret |= $?))
 303  303                          fi
 304  304                  fi
 305  305  
 306  306                  if ((ret != 0)); then
 307  307                          return $ret
 308  308                  fi
 309  309          done
 310  310  
 311  311          return 0
↓ open down ↓ 3 lines elided ↑ open up ↑
 315  315  # Get all the sub-datasets of give dataset with specific suffix
 316  316  #
 317  317  # $1 Given dataset
 318  318  # $2 Suffix
 319  319  #
 320  320  function getds_with_suffix
 321  321  {
 322  322          typeset ds=$1
 323  323          typeset suffix=$2
 324  324  
 325      -        typeset list=$($ZFS list -r -H -t filesystem,snapshot,volume -o name $ds \
 326      -            | $GREP "$suffix$")
      325 +        typeset list=$(zfs list -r -H -t filesystem,snapshot,volume -o name $ds \
      326 +            | grep "$suffix$")
 327  327  
 328      -        $ECHO $list
      328 +        echo $list
 329  329  }
 330  330  
 331  331  #
 332  332  # Output inherited properties whitch is edited for file system
 333  333  #
 334  334  function fs_inherit_prop
 335  335  {
 336  336          typeset fs_prop
 337  337          if is_global_zone ; then
 338      -                fs_prop=$($ZFS inherit 2>&1 | \
 339      -                    $AWK '$2=="YES" && $3=="YES" {print $1}')
      338 +                fs_prop=$(zfs inherit 2>&1 | \
      339 +                    awk '$2=="YES" && $3=="YES" {print $1}')
 340  340                  if ! is_te_enabled ; then
 341      -                        fs_prop=$(echo $fs_prop | $GREP -v "mlslabel")
      341 +                        fs_prop=$(echo $fs_prop | grep -v "mlslabel")
 342  342                  fi
 343  343          else
 344      -                fs_prop=$($ZFS inherit 2>&1 | \
 345      -                    $AWK '$2=="YES" && $3=="YES" {print $1}'|
 346      -                    $EGREP -v "devices|mlslabel|sharenfs|sharesmb|zoned")
      344 +                fs_prop=$(zfs inherit 2>&1 | \
      345 +                    awk '$2=="YES" && $3=="YES" {print $1}'|
      346 +                    egrep -v "devices|mlslabel|sharenfs|sharesmb|zoned")
 347  347          fi
 348  348  
 349      -        $ECHO $fs_prop
      349 +        echo $fs_prop
 350  350  }
 351  351  
 352  352  #
 353  353  # Output inherited properties for volume
 354  354  #
 355  355  function vol_inherit_prop
 356  356  {
 357      -        $ECHO "checksum readonly"
      357 +        echo "checksum readonly"
 358  358  }
 359  359  
 360  360  #
 361  361  # Get the destination dataset to compare
 362  362  #
 363  363  function get_dst_ds
 364  364  {
 365  365          typeset srcfs=$1
 366  366          typeset dstfs=$2
 367  367  
 368  368          #
 369  369          # If the srcfs is not pool
 370  370          #
 371      -        if ! $ZPOOL list $srcfs > /dev/null 2>&1 ; then
      371 +        if ! zpool list $srcfs > /dev/null 2>&1 ; then
 372  372                  eval dstfs="$dstfs/${srcfs#*/}"
 373  373          fi
 374  374  
 375      -        $ECHO $dstfs
      375 +        echo $dstfs
 376  376  }
 377  377  
 378  378  #
 379  379  # Make test files
 380  380  #
 381  381  # $1 Number of files to create
 382  382  # $2 Maximum file size
 383  383  # $3 File ID offset
 384  384  # $4 File system to create the files on
 385  385  #
 386  386  function mk_files
 387  387  {
 388  388          nfiles=$1
 389  389          maxsize=$2
 390  390          file_id_offset=$3
 391  391          fs=$4
 392  392  
 393  393          for ((i=0; i<$nfiles; i=i+1)); do
 394      -                $DD if=/dev/urandom \
      394 +                dd if=/dev/urandom \
 395  395                      of=/$fs/file-$maxsize-$((i+$file_id_offset)) \
 396  396                      bs=$(($RANDOM * $RANDOM % $maxsize)) \
 397  397                      count=1 >/dev/null 2>&1 || log_fail \
 398  398                      "Failed to create /$fs/file-$maxsize-$((i+$file_id_offset))"
 399  399          done
 400      -        $ECHO Created $nfiles files of random sizes up to $maxsize bytes
      400 +        echo Created $nfiles files of random sizes up to $maxsize bytes
 401  401  }
 402  402  
 403  403  #
 404  404  # Remove test files
 405  405  #
 406  406  # $1 Number of files to remove
 407  407  # $2 Maximum file size
 408  408  # $3 File ID offset
 409  409  # $4 File system to remove the files from
 410  410  #
 411  411  function rm_files
 412  412  {
 413  413          nfiles=$1
 414  414          maxsize=$2
 415  415          file_id_offset=$3
 416  416          fs=$4
 417  417  
 418  418          for ((i=0; i<$nfiles; i=i+1)); do
 419      -                $RM -f /$fs/file-$maxsize-$((i+$file_id_offset))
      419 +                rm -f /$fs/file-$maxsize-$((i+$file_id_offset))
 420  420          done
 421      -        $ECHO Removed $nfiles files of random sizes up to $maxsize bytes
      421 +        echo Removed $nfiles files of random sizes up to $maxsize bytes
 422  422  }
 423  423  
 424  424  #
 425  425  # Mess up file contents
 426  426  #
 427  427  # $1 The file path
 428  428  #
 429  429  function mess_file
 430  430  {
 431  431          file=$1
 432  432  
 433      -        filesize=$($STAT -c '%s' $file)
      433 +        filesize=$(stat -c '%s' $file)
 434  434          offset=$(($RANDOM * $RANDOM % $filesize))
 435  435          if (($RANDOM % 7 <= 1)); then
 436  436                  #
 437  437                  # We corrupt 2 bytes to minimize the chance that we
 438  438                  # write the same value that's already there.
 439  439                  #
 440      -                log_must eval "$DD if=/dev/random of=$file conv=notrunc " \
      440 +                log_must eval "dd if=/dev/random of=$file conv=notrunc " \
 441  441                      "bs=1 count=2 oseek=$offset >/dev/null 2>&1"
 442  442          else
 443      -                log_must $TRUNCATE -s $offset $file
      443 +                log_must truncate -s $offset $file
 444  444          fi
 445  445  }
 446  446  
 447  447  #
 448  448  # Diff the send/receive filesystems
 449  449  #
 450  450  # $1 The sent filesystem
 451  451  # $2 The received filesystem
 452  452  #
 453  453  function file_check
 454  454  {
 455  455          sendfs=$1
 456  456          recvfs=$2
 457  457  
 458  458          if [[ -d /$recvfs/.zfs/snapshot/a && -d \
 459  459              /$sendfs/.zfs/snapshot/a ]]; then
 460      -                $DIFF -r /$recvfs/.zfs/snapshot/a /$sendfs/.zfs/snapshot/a
      460 +                diff -r /$recvfs/.zfs/snapshot/a /$sendfs/.zfs/snapshot/a
 461  461                  [[ $? -eq 0 ]] || log_fail "Differences found in snap a"
 462  462          fi
 463  463          if [[ -d /$recvfs/.zfs/snapshot/b && -d \
 464  464              /$sendfs/.zfs/snapshot/b ]]; then
 465      -                $DIFF -r /$recvfs/.zfs/snapshot/b /$sendfs/.zfs/snapshot/b
      465 +                diff -r /$recvfs/.zfs/snapshot/b /$sendfs/.zfs/snapshot/b
 466  466                  [[ $? -eq 0 ]] || log_fail "Differences found in snap b"
 467  467          fi
 468  468  }
 469  469  
 470  470  #
 471  471  # Resume test helper
 472  472  #
 473  473  # $1 The ZFS send command
 474  474  # $2 The filesystem where the streams are sent
 475  475  # $3 The receive filesystem
↓ open down ↓ 2 lines elided ↑ open up ↑
 478  478  {
 479  479          sendcmd=$1
 480  480          streamfs=$2
 481  481          recvfs=$3
 482  482  
 483  483          stream_num=1
 484  484          log_must eval "$sendcmd >/$streamfs/$stream_num"
 485  485  
 486  486          for ((i=0; i<2; i=i+1)); do
 487  487                  mess_file /$streamfs/$stream_num
 488      -                log_mustnot $ZFS recv -sv $recvfs </$streamfs/$stream_num
      488 +                log_mustnot zfs recv -sv $recvfs </$streamfs/$stream_num
 489  489                  stream_num=$((stream_num+1))
 490  490  
 491      -                token=$($ZFS get -Hp -o value receive_resume_token $recvfs)
 492      -                log_must eval "$ZFS send -v -t $token >/$streamfs/$stream_num"
      491 +                token=$(zfs get -Hp -o value receive_resume_token $recvfs)
      492 +                log_must eval "zfs send -v -t $token >/$streamfs/$stream_num"
 493  493                  [[ -f /$streamfs/$stream_num ]] || \
 494  494                      log_fail "NO FILE /$streamfs/$stream_num"
 495  495          done
 496      -        log_must $ZFS recv -sv $recvfs </$streamfs/$stream_num
      496 +        log_must zfs recv -sv $recvfs </$streamfs/$stream_num
 497  497  }
 498  498  
 499  499  #
 500  500  # Setup filesystems for the resumable send/receive tests
 501  501  #
 502  502  # $1 The pool to set up with the "send" filesystems
 503  503  # $2 The pool for receive
 504  504  #
 505  505  function test_fs_setup
 506  506  {
 507  507          sendpool=$1
 508  508          recvpool=$2
 509  509  
 510  510          sendfs=$sendpool/sendfs
 511  511          recvfs=$recvpool/recvfs
 512  512          streamfs=$sendpool/stream
 513  513  
 514  514          if datasetexists $recvfs; then
 515      -                log_must $ZFS destroy -r $recvfs
      515 +                log_must zfs destroy -r $recvfs
 516  516          fi
 517  517          if datasetexists $sendfs; then
 518      -                log_must $ZFS destroy -r $sendfs
      518 +                log_must zfs destroy -r $sendfs
 519  519          fi
 520      -        if $($ZFS create -o compress=lz4 $sendfs); then
      520 +        if $(zfs create -o compress=lz4 $sendfs); then
 521  521                  mk_files 1000 256 0 $sendfs &
 522  522                  mk_files 1000 131072 0 $sendfs &
 523  523                  mk_files 100 1048576 0 $sendfs &
 524  524                  mk_files 10 10485760 0 $sendfs &
 525  525                  mk_files 1 104857600 0 $sendfs &
 526      -                log_must $WAIT
 527      -                log_must $ZFS snapshot $sendfs@a
      526 +                log_must wait
      527 +                log_must zfs snapshot $sendfs@a
 528  528  
 529  529                  rm_files 200 256 0 $sendfs &
 530  530                  rm_files 200 131072 0 $sendfs &
 531  531                  rm_files 20 1048576 0 $sendfs &
 532  532                  rm_files 2 10485760 0 $sendfs &
 533      -                log_must $WAIT
      533 +                log_must wait
 534  534  
 535  535                  mk_files 400 256 0 $sendfs &
 536  536                  mk_files 400 131072 0 $sendfs &
 537  537                  mk_files 40 1048576 0 $sendfs &
 538  538                  mk_files 4 10485760 0 $sendfs &
 539      -                log_must $WAIT
      539 +                log_must wait
 540  540  
 541      -                log_must $ZFS snapshot $sendfs@b
 542      -                log_must eval "$ZFS send -v $sendfs@a >/$sendpool/initial.zsend"
 543      -                log_must eval "$ZFS send -v -i @a $sendfs@b " \
      541 +                log_must zfs snapshot $sendfs@b
      542 +                log_must eval "zfs send -v $sendfs@a >/$sendpool/initial.zsend"
      543 +                log_must eval "zfs send -v -i @a $sendfs@b " \
 544  544                      ">/$sendpool/incremental.zsend"
 545  545          fi
 546  546  
 547  547          if datasetexists $streamfs; then
 548      -                log_must $ZFS destroy -r $streamfs
      548 +                log_must zfs destroy -r $streamfs
 549  549          fi
 550      -        log_must $ZFS create -o compress=lz4 $sendpool/stream
      550 +        log_must zfs create -o compress=lz4 $sendpool/stream
 551  551  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX