"Fossies" - the Fresh Open Source Software Archive

Member "tcpflow-1.6.1/tests/test-subs.sh" (19 Feb 2021, 992 Bytes) of package /linux/misc/tcpflow-1.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 case x"$srcdir" in 
    2   x)
    3     echo No srcdir specified. Assuming $0 is run locally
    4     DMPDIR=.
    5     TCPFLOW=../src/tcpflow
    6     ;;
    7   x.)
    8     echo srcdir is .  Assuming $0 is run locally from make check
    9     DMPDIR=.
   10     TCPFLOW=../src/tcpflow
   11     ;;
   12   *)
   13     echo srcdir is $srcdir Assuming $0 is run from make distcheck
   14     DMPDIR=../../tests/
   15     TCPFLOW=../../_build/src/tcpflow
   16     ;;
   17 esac
   18 
   19 echo DMPDIR=$DMPDIR
   20 echo TCPFLOW=$TCPFLOW
   21 
   22 # check the results
   23 checkmd5()
   24 {
   25   if [ ! -r $1 ] ; 
   26   then 
   27      echo file $1 was not created
   28      ls -l
   29      exit 1
   30   fi
   31 
   32   md5val=`openssl md5 $1 | awk '{print $2;}'`
   33   if [ x$2 != x$md5val ];
   34   then 
   35      echo failure:         $1
   36      echo expected md5:    $2 "(got '$md5val')"
   37      echo expected length: $3
   38      ls -l $1
   39      exit 1
   40   fi
   41 }
   42 
   43 testmd5()
   44 {
   45   md5val=`openssl md5 $1 | awk '{print $2;}'`
   46   len=`stat -r $1  | awk '{print $8;}'`
   47   echo checkmd5 \"$1\" \"$md5val\" \"$len\"
   48 }
   49 
   50 cmd()
   51 {
   52     echo $1
   53     if ! $1 ; then echo failed; exit 1; fi
   54 }
   55