Print this page
12281 zvol_swap_003_pos shouldn't use swapadd in cleanup

Split Close
Expand all
Collapse all
          --- old/usr/src/test/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_003_pos.ksh
          +++ new/usr/src/test/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_003_pos.ksh
↓ open down ↓ 19 lines elided ↑ open up ↑
  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   29  # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
       30 +# Copyright 2020 Joyent, Inc.
  30   31  #
  31   32  
  32   33  . $STF_SUITE/include/libtest.shlib
  33   34  . $STF_SUITE/tests/functional/zvol/zvol_common.shlib
  34   35  . $STF_SUITE/tests/functional/zvol/zvol_swap/zvol_swap.cfg
  35   36  
  36   37  #
  37   38  # DESCRIPTION:
  38   39  # Verify that a zvol device can be used as a swap device
  39   40  # through /etc/vfstab configuration.
↓ open down ↓ 7 lines elided ↑ open up ↑
  47   48  verify_runnable "global"
  48   49  
  49   50  function cleanup
  50   51  {
  51   52          [[ -f /tmp/$TESTFILE ]] && log_must rm -f /tmp/$TESTFILE
  52   53          [[ -f $NEW_VFSTAB_FILE ]] && log_must rm -f $NEW_VFSTAB_FILE
  53   54          [[ -f $PREV_VFSTAB_FILE ]] && \
  54   55              log_must mv $PREV_VFSTAB_FILE $VFSTAB_FILE
  55   56          [[ -f $PREV_VFSTAB_FILE ]] && rm -f $PREV_VFSTAB_FILE
  56   57  
  57      -        log_must swapadd $VFSTAB_FILE
  58      -
  59   58          if is_swap_inuse $voldev ; then
  60   59                  log_must swap -d $voldev
  61   60          fi
  62   61  
  63   62  }
  64   63  
  65   64  log_assert "Verify that a zvol device can be used as a swap device" \
  66   65      "through /etc/vfstab configuration."
  67   66  
  68   67  log_onexit cleanup
↓ open down ↓ 28 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX