Changeset 562 for trunk/test


Ignore:
Timestamp:
Jun 29, 2021, 10:23:44 PM (3 years ago)
Author:
katerina
Message:

Fix for ticket #450 (compiler warnings) and fixes for tests.

Location:
trunk/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/testrun_1b.sh

    r539 r562  
    239239do_test_1b_2 () {
    240240
    241     rm -f $PW_DIR/test_log_prelude
    242 
    243     [ -z "$verbose" ] || { echo " starting prelude-manager.."; echo " ($PM --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &)"; }
    244     "$PM" --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &
    245     PID=$!
    246 
    247     five_sec_sleep
     241    #rm -f $PW_DIR/test_log_prelude
     242    test_log_prelude="/var/log/prelude/prelude-text.log"
     243    echo -n >"${test_log_prelude}"
     244   
     245    #[ -z "$verbose" ] || { echo " starting prelude-manager.."; echo " ($PM --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &)"; }
     246    #"$PM" --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &
     247    #PID=$!
     248
     249    #five_sec_sleep
    248250
    249251    ./samhain -t check -p none -l info --set-prelude-severity=info --prelude --server-addr 127.0.0.1:5500 >/dev/null
     
    259261    else
    260262        [ -z "$quiet" ]   && log_msg_fail  "check...";
    261         kill $PID
     263        #kill $PID
    262264        return 1
    263265    fi
    264266    #
    265     tmp=`egrep 'File original:.*name=etc.*path=/etc' test_log_prelude 2>/dev/null | wc -l`
     267    tmp=`egrep 'File original:.*name=etc.*path=/etc' ${test_log_prelude} 2>/dev/null | wc -l`
    266268    if [ $tmp -lt 1 ]; then
    267269        [ -z "$verbose" ] || log_msg_fail "/etc";
    268         kill $PID
    269         return 1
    270     fi
    271     tmp=`egrep 'Classification text: Checking' test_log_prelude 2>/dev/null | wc -l`
     270        #kill $PID
     271        return 1
     272    fi
     273    tmp=`egrep 'Classification text: Checking' ${test_log_prelude} 2>/dev/null | wc -l`
    272274    if [ $tmp -lt 1 ]; then
    273275        [ -z "$verbose" ] || log_msg_fail "checking";
    274         kill $PID
     276        #kill $PID
    275277        return 1
    276278    fi
    277279    #
    278280    if test "x$2" = "xmodrc"; then
    279         tmp=`egrep 'Classification text: Service opened' test_log_prelude 2>/dev/null | wc -l`
     281        tmp=`egrep 'Classification text: Service opened' ${test_log_prelude} 2>/dev/null | wc -l`
    280282        if [ $tmp -lt 1 ]; then
    281283            [ -z "$verbose" ] || log_msg_fail "service";
    282             kill $PID
    283             return 1
    284         fi
    285         tmp=`egrep 'Service: port=5500' test_log_prelude 2>/dev/null | wc -l`
     284            #kill $PID
     285            return 1
     286        fi
     287        tmp=`egrep 'Service: port=5500' ${test_log_prelude} 2>/dev/null | wc -l`
    286288        if [ $tmp -lt 1 ]; then
    287289            [ -z "$verbose" ] || log_msg_fail "port 5500";
    288             kill $PID
     290            #kill $PID
    289291            return 1
    290292        fi
    291293    fi
    292294    #
    293     kill $PID
     295    #kill $PID
    294296    return 0
    295297}
  • trunk/test/testrun_1e.sh

    r468 r562  
    2525MAXTEST=5; export MAXTEST
    2626
     27test_log_prelude="/var/log/prelude/prelude-text.log"; export test_log_prelude
     28
    2729PORTPOLICY_5="
    2830[ReadOnly]
     
    4244        log_skip 5 $MAXTEST 'logging to prelude (or use --really-all)'
    4345    else
    44         tmp=`egrep 'Service: port=5500 .unknown. protocol=tcp' test_log_prelude 2>/dev/null | wc -l`
     46        tmp=`egrep 'Service: port=5500 .unknown. protocol=tcp' ${test_log_prelude} 2>/dev/null | wc -l`
    4547        if [ $tmp -lt 1 ]; then
    4648            [ -z "$verbose" ] || log_msg_fail "port 5500";
     
    187189run_check_prelude()
    188190{
     191    echo -n >"${test_log_prelude}"
     192
    189193    ./samhain -t check -p none -l info --set-prelude-severity=info --prelude --server-addr 127.0.0.1:5500 >/dev/null
    190194 
     
    322326                  #
    323327                  #
    324                   [ -z "$verbose" ] || { echo " starting prelude-manager.."; echo " ($PM --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &)"; }
    325                   "$PM" --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &
    326                   PRELUDEPID=$!
     328                  #[ -z "$verbose" ] || { echo " starting prelude-manager.."; echo " ($PM --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &)"; }
     329                  #"$PM" --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &
     330                  #PRELUDEPID=$!
    327331                  #
    328332                  #
  • trunk/test/testrun_2d.sh

    r481 r562  
    3838    # PGPASSWORD=samhain; export PGPASSWORD
    3939    create_pgpass
    40     psql -o test_log_db -U samhain -d samhain -c "SELECT * FROM log WHERE entry_status = 'NEW' and log_time > '${DATE}';"
     40    psql -h localhost -o test_log_db -U samhain -d samhain -c "SELECT * FROM log WHERE entry_status = 'NEW' and log_time > '${DATE}';"
    4141    #
    4242    egrep "START.*Yule" test_log_db >/dev/null 2>&1
    4343    if [ $? -ne 0 ]; then
    44         [ -z "$verbose" ] || log_msg_fail "Server start (psql)";
     44        [ -z "$verbose" ] || log_msg_fail "Server start (psql) DATE ${DATE}";
    4545        return 1
    4646    fi
     
    8888        # PGPASSWORD="samhain"; export PGPASSWORD
    8989        create_pgpass
    90         TEST=`psql -U samhain -d samhain -c "SELECT * FROM log LIMIT 1;" 2>/dev/null`
     90        TEST=`psql -h localhost -U samhain -d samhain -c "SELECT * FROM log LIMIT 1;" 2>/dev/null`
    9191        if [ $? -ne 0 -o -z "$TEST" ]; then
    9292            log_skip 1 $MAXTEST "psql not default setup"
     
    112112    ORIGINAL="DatabaseSeverity=none"
    113113    REPLACEMENT="DatabaseSeverity=info"
     114    ex -s $RCFILE <<EOF
     115%s/$ORIGINAL/$REPLACEMENT/g
     116wq
     117EOF
     118    #
     119    ORIGINAL="# setdbname=samhain"
     120    REPLACEMENT="setdbhost=127.0.0.1"
    114121    ex -s $RCFILE <<EOF
    115122%s/$ORIGINAL/$REPLACEMENT/g
Note: See TracChangeset for help on using the changeset viewer.