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/threadsappend/threadsappend_001_pos.ksh
          +++ new/usr/src/test/zfs-tests/tests/functional/threadsappend/threadsappend_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 2007 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  # Ensure multiple threads performing write appends to the same ZFS
  38   38  # file succeed.
  39   39  #
↓ open down ↓ 13 lines elided ↑ open up ↑
  53   53  # size of the file after all the threads have appended to it
  54   54  #
  55   55  typeset -i FILE_SIZE=1310720
  56   56  THREADSAPPEND="$STF_SUITE/tests/functional/threadsappend/threadsappend"
  57   57  TESTFILE='testfile-threadsappend'
  58   58  
  59   59  #
  60   60  # This test should be run on a multi-processor system because otherwise the FS
  61   61  # will not be concurrently used by the threads
  62   62  #
  63      -NCPUS=`$PSRINFO | $WC -l`
       63 +NCPUS=`psrinfo | wc -l`
  64   64  if [[ -z $NCPUS || $NCPUS -le 1 ]]; then
  65   65           log_fail "This test should be executed on a multi-processor system."
  66   66  fi
  67   67  
  68   68  #
  69   69  # zfs_threadsappend tries to append to $TESTFILE using threads
  70   70  # so that the resulting file is $FILE_SIZE bytes in size
  71   71  #
  72   72  log_must $THREADSAPPEND ${TESTDIR}/${TESTFILE}
  73   73  
  74   74  #
  75   75  # Check the size of the resulting file
  76   76  #
  77      -SIZE=`$LS -l ${TESTDIR}/${TESTFILE} | $AWK '{print $5}'`
       77 +SIZE=`ls -l ${TESTDIR}/${TESTFILE} | awk '{print $5}'`
  78   78  if [[ $SIZE -ne $FILE_SIZE ]]; then
  79   79          log_fail "'The length of ${TESTDIR}/${TESTFILE}' doesnt equal 1310720."
  80   80  fi
  81   81  
  82   82  log_pass "Multiple thread appends succeeded. File size as expected"
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX