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/slog/slog_014_pos.ksh
          +++ new/usr/src/test/zfs-tests/tests/functional/slog/slog_014_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/tests/functional/slog/slog.kshlib
  33   33  
  34   34  #
  35   35  # DESCRIPTION:
  36   36  #       log device can survive when one of pool device get corrupted
  37   37  #
  38   38  # STRATEGY:
  39   39  #       1. Create pool with slog devices
↓ open down ↓ 2 lines elided ↑ open up ↑
  42   42  #
  43   43  
  44   44  verify_runnable "global"
  45   45  
  46   46  log_assert "log device can survive when one of the pool device get corrupted."
  47   47  
  48   48  for type in "mirror" "raidz" "raidz2"
  49   49  do
  50   50          for spare in "" "spare"
  51   51          do
  52      -                log_must $ZPOOL create $TESTPOOL $type $VDEV $spare $SDEV \
       52 +                log_must zpool create $TESTPOOL $type $VDEV $spare $SDEV \
  53   53                          log $LDEV
  54   54  
  55   55                  # Corrupt a pool device to make the pool DEGRADED
  56      -                $DD if=/dev/urandom of=/$TESTPOOL/filler bs=1024k count=50
       56 +                dd if=/dev/urandom of=/$TESTPOOL/filler bs=1024k count=50
  57   57                  # The oseek value below is to skip past the vdev label.
  58      -                log_must $DD if=/dev/urandom of=$VDIR/a bs=1024k oseek=4 \
       58 +                log_must dd if=/dev/urandom of=$VDIR/a bs=1024k oseek=4 \
  59   59                      conv=notrunc count=50
  60      -                log_must $ZPOOL scrub $TESTPOOL
       60 +                log_must zpool scrub $TESTPOOL
  61   61                  log_must display_status $TESTPOOL
  62      -                log_must $ZPOOL status $TESTPOOL 2>&1 >/dev/null
       62 +                log_must zpool status $TESTPOOL 2>&1 >/dev/null
  63   63  
  64      -                $ZPOOL status -v $TESTPOOL | \
  65      -                        $GREP "state: DEGRADED" 2>&1 >/dev/null
       64 +                zpool status -v $TESTPOOL | \
       65 +                        grep "state: DEGRADED" 2>&1 >/dev/null
  66   66                  if (( $? != 0 )); then
  67   67                          log_fail "pool $TESTPOOL status should be DEGRADED"
  68   68                  fi
  69   69  
  70      -                $ZPOOL status -v $TESTPOOL | $GREP logs | \
  71      -                        $GREP "DEGRADED" 2>&1 >/dev/null
       70 +                zpool status -v $TESTPOOL | grep logs | \
       71 +                        grep "DEGRADED" 2>&1 >/dev/null
  72   72                  if (( $? == 0 )); then
  73   73                          log_fail "log device should display correct status"
  74   74                  fi
  75   75  
  76      -                log_must $ZPOOL destroy -f $TESTPOOL
       76 +                log_must zpool destroy -f $TESTPOOL
  77   77          done
  78   78  done
  79   79  
  80   80  log_pass "log device can survive when one of the pool device get corrupted."
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX