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/inuse/inuse_001_pos.ksh
          +++ new/usr/src/test/zfs-tests/tests/functional/inuse/inuse_001_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 2008 Sun Microsystems, Inc.  All rights reserved.
  25   25  # Use is subject to license terms.
  26   26  #
  27   27  
  28   28  #
  29      -# Copyright (c) 2013, 2015 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  . $STF_SUITE/tests/functional/inuse/inuse.cfg
  34   34  
  35   35  #
  36   36  # DESCRIPTION:
  37   37  # ZFS will not interfere with devices that are in use by dumpadm.
  38   38  #
  39   39  # STRATEGY:
↓ open down ↓ 2 lines elided ↑ open up ↑
  42   42  #
  43   43  
  44   44  verify_runnable "global"
  45   45  
  46   46  function cleanup
  47   47  {
  48   48          #
  49   49          # Remove dump device.
  50   50          #
  51   51          if [[ -n $PREVDUMPDEV ]]; then
  52      -                log_must $DUMPADM -u -d $PREVDUMPDEV > /dev/null
       52 +                log_must dumpadm -u -d $PREVDUMPDEV > /dev/null
  53   53          fi
  54   54  
  55   55          destroy_pool $TESTPOOL
  56   56  }
  57   57  
  58   58  log_assert "Ensure ZFS cannot use a device designated as a dump device"
  59   59  
  60   60  log_onexit cleanup
  61   61  
  62   62  typeset dumpdev=""
  63   63  typeset diskslice=""
  64   64  
  65      -PREVDUMPDEV=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'`
       65 +PREVDUMPDEV=`dumpadm | grep "Dump device" | awk '{print $3}'`
  66   66  
  67   67  log_note "Zero $FS_DISK0 and place free space in to slice 0"
  68   68  log_must cleanup_devices $FS_DISK0
  69   69  
  70   70  diskslice="/dev/dsk/${FS_DISK0}s0"
  71   71  log_note "Configuring $diskslice as dump device"
  72      -log_must $DUMPADM -d $diskslice > /dev/null
       72 +log_must dumpadm -d $diskslice > /dev/null
  73   73  
  74   74  log_note "Confirm that dump device has been setup"
  75      -dumpdev=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'`
       75 +dumpdev=`dumpadm | grep "Dump device" | awk '{print $3}'`
  76   76  [[ -z "$dumpdev" ]] && log_untested "No dump device has been configured"
  77   77  
  78   78  [[ "$dumpdev" != "$diskslice" ]] && \
  79   79      log_untested "Dump device has not been been configured to $diskslice"
  80   80  
  81   81  log_note "Attempt to zpool the dump device"
  82   82  unset NOINUSE_CHECK
  83      -log_mustnot $ZPOOL create $TESTPOOL "$diskslice"
       83 +log_mustnot zpool create $TESTPOOL "$diskslice"
  84   84  log_mustnot poolexists $TESTPOOL
  85   85  
  86   86  log_pass "Unable to zpool a device in use by dumpadm"
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX