Changeset 170 for trunk/test/testrun_1b.sh
- Timestamp:
- Apr 30, 2008, 11:56:45 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/testrun_1b.sh
r169 r170 20 20 # 21 21 22 MAXTEST= 6; export MAXTEST22 MAXTEST=7; export MAXTEST 23 23 LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE 24 24 RCFILE="$PW_DIR/testrc_1.dyn"; export RCFILE 25 26 testrun1b_modrc () 27 { 28 ORIGINAL="\[EOF\]" 29 REPLACEMENT="\[PortCheck\]" 30 ex -s $RCFILE <<EOF 31 %s/$ORIGINAL/$REPLACEMENT/g 32 wq 33 EOF 34 35 echo "PortCheckActive = yes" >>"$RCFILE" 36 echo "PortCheckInterface = 127.0.0.1" >>"$RCFILE" 37 } 25 38 26 39 testrun1b_internal () … … 173 186 174 187 cp "${SCRIPTDIR}/testrc_1" "${RCFILE}" 188 189 if test "x$2" = "xmodrc"; then 190 [ -z "$verbose" ] || log_msg_ok "mod rc..."; 191 testrun1b_modrc 192 fi 175 193 176 194 ./samhain -t init -p none -l info … … 253 271 [ -z "$verbose" ] || log_msg_fail "checking"; 254 272 fi 255 tmp=`egrep 'Classification text: Checking' test_log_prelude 2>/dev/null | wc -l` 256 if [ $tmp -lt 1 ]; then 257 [ -z "$verbose" ] || log_msg_fail "checking"; 273 # 274 if test "x$2" = "xmodrc"; then 275 tmp=`egrep 'Classification text: Service opened' test_log_prelude 2>/dev/null | wc -l` 276 if [ $tmp -lt 1 ]; then 277 [ -z "$verbose" ] || log_msg_fail "service"; 278 fi 279 tmp=`egrep 'Service: port=5500' test_log_prelude 2>/dev/null | wc -l` 280 if [ $tmp -lt 1 ]; then 281 [ -z "$verbose" ] || log_msg_fail "port 5500"; 282 fi 258 283 fi 259 284 # … … 270 295 log_skip 2 $MAXTEST 'gpg not found in $PATH' 271 296 log_skip 3 $MAXTEST 'gpg not found in $PATH' 297 log_skip 4 $MAXTEST 'gpg not found in $PATH' 298 log_skip 5 $MAXTEST 'gpg not found in $PATH' 299 log_skip 6 $MAXTEST 'gpg not found in $PATH' 300 log_skip 7 $MAXTEST 'gpg not found in $PATH' 272 301 else 273 302 eval "$GPG" --list-keys 0F571F6C >/dev/null 2>/dev/null … … 278 307 log_skip 4 $MAXTEST 'public PGP key 0x0F571F6C not present' 279 308 log_skip 5 $MAXTEST 'public PGP key 0x0F571F6C not present' 309 log_skip 6 $MAXTEST 'public PGP key 0x0F571F6C not present' 310 log_skip 7 $MAXTEST 'public PGP key 0x0F571F6C not present' 280 311 else 281 312 # … … 342 373 # ------------- fifth test ------------- 343 374 # 344 if test -f /usr/local/lib/libprelude.so375 if ! test -d /var/run/prelude-manager 345 376 then 346 LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" 347 export LD_LIBRARY_PATH 377 [ -z "$verbose" ] || log_msg_ok "create /var/run/prelude-manager..."; 378 sudo mkdir /var/run/prelude-manager 379 sudo chown prelude:rainer /var/run/prelude-manager 380 sudo chmod 770 /var/run/prelude-manager 348 381 fi 349 382 # … … 367 400 # ------------- sixth test ------------- 368 401 # 369 if test -f /usr/local/lib/libprelude.so402 if ! test -d /var/run/prelude-manager 370 403 then 371 LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" 372 export LD_LIBRARY_PATH 404 [ -z "$verbose" ] || log_msg_ok "create /var/run/prelude-manager..."; 405 sudo mkdir /var/run/prelude-manager 406 sudo chown prelude:rainer /var/run/prelude-manager 407 sudo chmod 770 /var/run/prelude-manager 373 408 fi 374 409 # … … 389 424 fi 390 425 426 # 427 # ------------- seventh test ----------- 428 # 429 if ! test -d /var/run/prelude-manager 430 then 431 [ -z "$verbose" ] || log_msg_ok "create /var/run/prelude-manager..."; 432 sudo mkdir /var/run/prelude-manager 433 sudo chown prelude:rainer /var/run/prelude-manager 434 sudo chmod 770 /var/run/prelude-manager 435 fi 436 # 437 PM=`find_path prelude-manager` 438 if [ -z "$PM" ]; then 439 log_skip 7 $MAXTEST 'prelude-manager not found in $PATH' 440 elif [ -z "$doall" ]; then 441 log_skip 7 $MAXTEST 'logging to prelude (or use --really-all)' 442 else 443 BUILDOPTS="--quiet $TRUST --with-prelude --enable-login-watch --enable-mounts-check --enable-process-check --enable-port-check --enable-suidcheck --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" 444 testrun1b_nogpg "${BUILDOPTS} CFLAGS=-DSH_NOFAILOVER=1" "modrc" 445 do_test_1b_2 446 if [ $? -eq 0 ]; then 447 log_ok 7 $MAXTEST 'logging to prelude' 448 else 449 log_fail 7 $MAXTEST 'logging to prelude' 450 fi 451 fi 452 391 453 fi 392 454 fi
Note:
See TracChangeset
for help on using the changeset viewer.