Changeset 235 for trunk/test/testext.sh


Ignore:
Timestamp:
Jul 11, 2009, 2:19:07 PM (15 years ago)
Author:
katerina
Message:

Fix for potential deadlock when calling external programm (ticket #155).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/testext.sh

    r202 r235  
    2020#
    2121
    22 MAXTEST=1; export MAXTEST
     22MAXTEST=2; export MAXTEST
    2323
    2424testext0 ()
     
    5454        fi
    5555        #
    56         ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/testrc_1ext --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file
     56        ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/testrc_1ext --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file
    5757        #
    5858        if test x$? = x0; then
     
    100100        echo "SetChecksum=$CHKSUM"          >> testrc_1ext
    101101        echo "SetFilterOr=ALERT"            >> testrc_1ext
     102        echo "CloseCommand"                 >> testrc_1ext
    102103   
    103104        rm -f $PW_DIR/test_ext.res
     
    133134        fi
    134135
     136        ORIGINAL="SetChecksum=${CHKSUM}"
     137        REPLACEMENT="SetChecksum=DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF"
     138
     139        ex -s "$PW_DIR/testrc_1ext" <<EOF
     140%s/$ORIGINAL/$REPLACEMENT/g
     141wq
     142EOF
     143
     144        rm -f $PW_DIR/test_ext.res
     145        rm -f $PW_DIR/pdbg.child
     146        rm -f $PW_DIR/pdbg.main
     147        ./samhain -p none
     148   
     149        one_sec_sleep
     150
     151        if [ -f $PW_DIR/test_ext.res ]; then
     152            log_fail 2 ${MAXTEST};
     153        else
     154            log_ok   2 ${MAXTEST};
     155        fi
     156
    135157        rm -f $PW_DIR/.samhain_file
    136158        rm -f $LOGFILE
Note: See TracChangeset for help on using the changeset viewer.