Ignore:
Timestamp:
Jul 24, 2006, 11:01:29 PM (18 years ago)
Author:
rainer
Message:

Fix stealth mode (regression in parser), add test for regression test suite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/testrun_1b.sh

    r51 r52  
    2020#
    2121
    22 MAXTEST=2; export MAXTEST
     22MAXTEST=3; export MAXTEST
    2323LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
    2424RCFILE="$PW_DIR/testrc_1.dyn";  export RCFILE
     
    7070            [ -z "$quiet" ]   && log_msg_fail  "extract gpg signed files...";
    7171            return 1
     72        fi
     73
     74        if test "x$2" = "x"; then
     75            :
     76        else
     77            CONVERT="$2"
     78            if test -f "${TOP_SRCDIR}/stealth_template.jpg"; then
     79                [ -z "$verbose" ] || log_msg_ok "convert..."
     80                "${CONVERT}" +compress "${TOP_SRCDIR}/stealth_template.jpg" stealth_template.ps >/dev/null
     81            else
     82                [ -z "$quiet" ]   && log_msg_fail  "cannot find file stealth_template.jpg"
     83                return 1
     84            fi
     85            if [ $? -ne 0 ]; then
     86                [ -z "$quiet" ]   && log_msg_fail  "${CONVERT} +compress ${TOP_SRCDIR}/stealth_template.jpg stealth_template.ps";
     87                return 1
     88            fi
     89
     90            [ -z "$verbose" ] || log_msg_ok "hide..."
     91            ./samhain_stealth -s stealth_template.ps "$RCFILE" >/dev/null
     92            if [ $? -ne 0 ]; then
     93                [ -z "$quiet" ]   && log_msg_fail  "${CONVERT} +compress ${TOP_SRCDIR}/stealth_template.jpg stealth_template.ps";
     94                return 1
     95            fi
     96
     97            mv -f stealth_template.ps "$RCFILE"
     98            if [ $? -ne 0 ]; then
     99                [ -z "$quiet" ]   && log_msg_fail  "mv -f stealth_template.ps $RCFILE";
     100                return 1
     101            fi
     102
    72103        fi
    73104
     
    171202            log_skip 2 $MAXTEST 'public PGP key 0x0F571F6C not present'
    172203        else
     204            #
     205            # -------------  first test -------------
     206            #
    173207            BUILDOPTS="--quiet $TRUST --enable-debug --with-gpg=${GPG} --with-checksum=no --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
    174             testrun1b_internal "${BUILDOPTS}"
     208            testrun1b_internal "${BUILDOPTS}" 
    175209            do_test_1b
    176210            if [ $? -eq 0 ]; then
     
    179213                log_fail 1 $MAXTEST 'gpg signed config/database files'
    180214            fi
     215
     216
     217            #
     218            # -------------  second test -------------
     219            #
     220            PRECONV=`find_path convert`
     221            "${PRECONV}" --help | grep  ImageMagick >/dev/null 2>&1 && \
     222                CONVERT="${PRECONV}"
     223
     224            if [ -z "$CONVERT" ]; then
     225                log_skip 2 $MAXTEST 'ImageMagick convert not found in $PATH'
     226            else
     227                BUILDOPTS="--quiet $TRUST --enable-debug --with-gpg=${GPG} --with-checksum=no --enable-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
     228                testrun1b_internal "${BUILDOPTS}" "$CONVERT"
     229                do_test_1b
     230                if [ $? -eq 0 ]; then
     231                    log_ok   2 $MAXTEST 'gpg signed config/database files'
     232                else
     233                    log_fail 2 $MAXTEST 'gpg signed config/database files'
     234                fi
     235            fi
     236
     237
     238            #
     239            # -------------  third test -------------
     240            #
    181241            PM=`find_path prelude-manager`
    182242            if [ -z "$PM" ]; then
    183                 log_skip 2 $MAXTEST 'prelude-manager not found in $PATH'
     243                log_skip 3 $MAXTEST 'prelude-manager not found in $PATH'
    184244            elif [ -z "$doall" ]; then
    185                 log_skip 2 $MAXTEST 'logging to prelude (or use --really-all)'
     245                log_skip 3 $MAXTEST 'logging to prelude (or use --really-all)'
    186246            else
    187247                BUILDOPTS="--quiet $TRUST --enable-debug --with-prelude --with-gpg=${GPG} --with-checksum=no --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
     
    189249                do_test_1b_2
    190250                if [ $? -eq 0 ]; then
    191                     log_ok   2 $MAXTEST 'logging to prelude'
     251                    log_ok   3 $MAXTEST 'logging to prelude'
    192252                else
    193                     log_fail 2 $MAXTEST 'logging to prelude'
     253                    log_fail 3 $MAXTEST 'logging to prelude'
    194254                fi
    195255            fi
Note: See TracChangeset for help on using the changeset viewer.