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/poolversion/poolversion_002_pos.ksh
          +++ new/usr/src/test/zfs-tests/tests/functional/poolversion/poolversion_002_pos.ksh
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19  #
  20   20  # CDDL HEADER END
  21   21  #
  22   22  
  23   23  #
  24   24  # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  25   25  # Use is subject to license terms.
  26   26  #
  27   27  
  28   28  #
  29      -# Copyright (c) 2013 by Delphix. All rights reserved.
       29 +# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
  30   30  #
  31   31  
  32   32  . $STF_SUITE/include/libtest.shlib
  33   33  
  34   34  #
  35   35  # DESCRIPTION:
  36   36  #
  37   37  # zpool set version can only increment pool version
  38   38  #
  39   39  # STRATEGY:
  40   40  # 1. Set a version 1 pool to be a version 6 pool
  41   41  # 2. Verify it's set to version 6
  42   42  # 3. Attempt to set prior versions
  43   43  # 4. Verify it's still set to version 6
  44   44  #
  45   45  
  46   46  verify_runnable "global"
  47   47  log_assert "zpool set version can only increment pool version"
  48   48  
  49      -log_must $ZPOOL set version=6 $TESTPOOL2
       49 +log_must zpool set version=6 $TESTPOOL2
  50   50  # verify it's actually that version - by checking the version property
  51   51  # and also by trying to set bootfs (which should fail if it is not version 6)
  52   52  
  53      -VERSION=$($ZPOOL get version $TESTPOOL2| $GREP version | $AWK '{print $3}')
       53 +VERSION=$(zpool get version $TESTPOOL2| grep version | awk '{print $3}')
  54   54  if [ "$VERSION" != "6" ]
  55   55  then
  56   56          log_fail "Version $VERSION set for $TESTPOOL2 expected version 6!"
  57   57  fi
  58      -log_must $ZPOOL set bootfs=$TESTPOOL2 $TESTPOOL2
       58 +log_must zpool set bootfs=$TESTPOOL2 $TESTPOOL2
  59   59  
  60   60  # now verify we can't downgrade the version
  61      -log_mustnot $ZPOOL set version=5 $TESTPOOL2
  62      -log_mustnot $ZPOOL set version=-1 $TESTPOOL2
       61 +log_mustnot zpool set version=5 $TESTPOOL2
       62 +log_mustnot zpool set version=-1 $TESTPOOL2
  63   63  
  64   64  # verify the version is still 6
  65      -VERSION=$($ZPOOL get version $TESTPOOL2 | $GREP version | $AWK '{print $3}')
       65 +VERSION=$(zpool get version $TESTPOOL2 | grep version | awk '{print $3}')
  66   66  if [ "$VERSION" != "6" ]
  67   67  then
  68   68          log_fail "Version $VERSION set for $TESTPOOL2, expected version 6!"
  69   69  fi
  70   70  
  71   71  log_pass "zpool set version can only increment pool version"
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX