"Fossies" - the Fresh Open Source Software Archive

Member "tcpflow-1.6.1/tests/test-iptree.sh" (19 Feb 2021, 850 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. See also the last Fossies "Diffs" side-by-side code changes report for "test-iptree.sh": 1.4.5_vs_1.5.0.

    1 . $srcdir/test-subs.sh
    2 
    3 echo DMPDIR=$DMPDIR
    4 echo TCPFLOW=$TCPFLOW
    5 
    6 # check the results
    7 checkmd5()
    8 {
    9   if [ ! -r $1 ] ; 
   10   then 
   11      echo file $1 was not created
   12      ls -l
   13      exit 1
   14   fi
   15 
   16   md5val=`openssl md5 $1 | awk '{print $2;}'`
   17   if [ x$2 != x$md5val ];
   18   then 
   19      echo failure:         $1
   20      echo expected md5:    $2 "(got '$md5val')"
   21      echo expected length: $3
   22      ls -l $1
   23      exit 1
   24   fi
   25 }
   26 
   27 testmd5()
   28 {
   29   md5val=`openssl md5 $1 | awk '{print $2;}'`
   30   len=`stat -r $1  | awk '{print $8;}'`
   31   echo checkmd5 \"$1\" \"$md5val\" \"$len\"
   32 }
   33 
   34 cmd()
   35 {
   36     echo $1
   37     if ! $1 ; then echo failed; exit 1; fi
   38 }
   39 NITROBA=nitroba.pcap
   40 if [ -r $NITROBA ]; then
   41   /bin/rm -rf out1
   42   cmd "$TCPFLOW -S netviz_max_histogram_size=1000 -S netviz_histogram_dump=1 -o out1 -r $NITROBA"
   43   /bin/rm -rf out1
   44 else
   45   echo $NITROBA not present.
   46 fi
   47 exit 0
   48