1 #!/usr/bin/ksh
   2 
   3 #
   4 # This file and its contents are supplied under the terms of the
   5 # Common Development and Distribution License ("CDDL"), version 1.0.
   6 # You may only use this file in accordance with the terms of version
   7 # 1.0 of the CDDL.
   8 #
   9 # A full copy of the text of the CDDL should have accompanied this
  10 # source.  A copy of the CDDL is also available via the Internet at
  11 # http://www.illumos.org/license/CDDL.
  12 #
  13 
  14 #
  15 # Define necessary environments and config variables here
  16 # prior to invoke TET test runner 'run_test'
  17 #
  18 export TET_ROOT=/opt/SUNWstc-tetlite
  19 export CTI_ROOT=$TET_ROOT/contrib/ctitools
  20 export TET_SUITE_ROOT=/opt
  21 PATH=$PATH:$CTI_ROOT/bin
  22 export PATH
  23 export SCRATCH_DIR=/var/tmp
  24 
  25 
  26 function fail
  27 {
  28         echo $1
  29         exit ${2:-1}
  30 }
  31 
  32 #
  33 # Test needs to be run as root 
  34 #
  35 [[ $(id -u) != "0" ]] && fail "This script must be run as root."
  36 
  37 # Make sure /dev/lofi does not exist
  38 if [ -d /dev/lofi ]; then
  39     rm -rf /dev/lofi
  40 fi
  41 
  42 PATH=$PATH:$CTI_ROOT/bin
  43 export PATH
  44 #
  45 # To run entire suite
  46 #
  47 run_test -U /var/tmp/test_results/lofi-tests lofi-tests $1
  48 
  49 #
  50 # To run component
  51 #
  52 #run_test lofi-tests compression_dynamic
  53 
  54 #
  55 # To run individual testcase
  56 #
  57 #run_test lofi-tests compression_dynamic:10