"Fossies" - the Fresh Open Source Software Archive

Member "afio-2.5.2/regtest/regtest" (30 Nov 2018, 1818 Bytes) of package /linux/misc/afio-2.5.2.tgz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "regtest": 2.5.1_vs_2.5.2.

    1 
    2 #set -x
    3 
    4 export -n BASH_ENV
    5 
    6 # ancient versions of awk won't work with these scripts,
    7 # but will give syntax errors trying to parse their program.
    8 # On sun, may have to change this to `nawk' or `gawk'.
    9 export AWK=awk
   10 
   11 echo " * Testing on: `uname -a`"
   12 echo " * OS version: `cat -v /etc/issue`"
   13 echo " * gcc version: `gcc -v 2>&1`"
   14 echo " * Afio shared libraries: `ldd ../afio`"
   15 
   16 #if 1, inject some errors to self-test the regression test.
   17 ERRORINJECT=0
   18 
   19 #for security, regresson test will make
   20 #some devices and suid scripts (solve more elegantly later)
   21 chmod 700 .
   22 
   23 #binary of new afio
   24 NEWAF=`pwd`/../afio
   25 
   26 #try to find an old afio binary
   27 OLDAF=`type -p afio`
   28 
   29 if [ "$OLDAF" = "" ]; then
   30  echo "Can't" find an old afio executable, will not do parts of regression testing...
   31 fi
   32 
   33 #clean up any old regtest directories
   34 source ./regtest.clean
   35 
   36 
   37 #----------------
   38 
   39 failed=0;
   40 
   41 #1) run batch of tests with included test archive
   42 
   43 #OLDTESTD=/root/afio/afiot
   44 OLDTESTD=/i/n/v/a/l/i/d
   45 TESTA=`pwd`/afiotsmall.af
   46 TESTTAR=`pwd`/afiotsmall.tgz
   47 TESTTOC=$TESTA.toc
   48 
   49 if [ "`whoami`" != root ]; then
   50  echo Not running as root, regression test will not cover special files like devices
   51  TESTA=`pwd`/afiotsmallnoroot.af
   52  TESTTAR=`pwd`/afiotsmallnoroot.tgz
   53  TESTTOC=$TESTA.toc
   54  #umask 000 needed to make tar restore all permissions, as afio does
   55  umask 000
   56 fi
   57 
   58 source ./regtest.do
   59 
   60 if [ $failed = 1 ]; then
   61  exit 1
   62 fi
   63 
   64 #2) are we on Koen's machine?  Yes, then run a second batch of tests
   65 
   66 #(only on Koen's machine) location of existing unpacked test directory
   67 OLDTESTD=/oldlin/root/src/afiot
   68 if [ -d $OLDTESTD ]; then
   69 if [ "`whoami`" = root ]; then
   70  TESTTAR=/i/n/v/a/l/i/d
   71  TESTA=/oldlin/root/src/afiot.af
   72  TESTTOC=$TESTA.toc
   73  source ./regtest.do
   74 fi
   75 fi
   76 
   77 if [ $failed = 0 ]; then
   78  echo All regression tests OK\!\!
   79  source ./regtest.clean
   80 fi