Changeset 206 for trunk/test/testrun_1e.sh
- Timestamp:
- Jan 8, 2009, 10:08:45 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/testrun_1e.sh
r179 r206 23 23 export BUILDOPTS 24 24 25 MAXTEST=4; export MAXTEST 25 MAXTEST=5; export MAXTEST 26 27 PORTPOLICY_5=" 28 [ReadOnly] 29 file=${BASE} 30 [PortCheck] 31 PortCheckActive = yes 32 PortCheckUDP = no 33 PortCheckInterface = 127.0.0.1 34 " 35 36 chk_portdata_5 () { 37 one_sec_sleep 38 39 if [ -z "$PM" ]; then 40 log_skip 5 $MAXTEST 'prelude-manager not found in $PATH' 41 elif [ -z "$doall" ]; then 42 log_skip 5 $MAXTEST 'logging to prelude (or use --really-all)' 43 else 44 tmp=`egrep 'Service: port=5500 .unknown. protocol=tcp' test_log_prelude 2>/dev/null | wc -l` 45 if [ $tmp -lt 1 ]; then 46 [ -z "$verbose" ] || log_msg_fail "port 5500"; 47 [ -z "$quiet" ] && log_fail 5 ${MAXTEST}; 48 return 1 49 fi 50 # 51 [ -z "$quiet" ] && log_ok 5 ${MAXTEST}; 52 fi 53 return 0 54 } 55 56 refine_portpolicy_5 () 57 { 58 echo "PortCheckIgnore=2026/tcp" >>"${RCFILE}" 59 echo "PortCheckIgnore=2027/udp" >>"${RCFILE}" 60 echo "PortCheckIgnore=2028/tcp" >>"${RCFILE}" 61 echo "PortCheckIgnore=2029/udp" >>"${RCFILE}" 62 } 26 63 27 64 PORTPOLICY_4=" … … 147 184 eval echo '"$'"PORTPOLICY_$1"'"' >>"${RCFILE}" 148 185 } 186 187 run_check_prelude() 188 { 189 ./samhain -t check -p none -l info --set-prelude-severity=info --prelude --server-addr 127.0.0.1:5500 >/dev/null 190 191 if test x$? = x0; then 192 193 ./samhain -j -L $LOGFILE >"${LOGFILE}.tmp" && mv "${LOGFILE}.tmp" "${LOGFILE}" 194 195 if [ $? -ne 0 ]; then 196 [ -z "$quiet" ] && log_msg_fail "mv logfile..."; 197 return 1 198 fi 199 [ -z "$verbose" ] || log_msg_ok "check..."; 200 else 201 [ -z "$quiet" ] && log_msg_fail "check..."; 202 return 1 203 fi 204 } 205 149 206 150 207 testrun_internal_1e () … … 209 266 rm -f "$LOGFILE" 210 267 # 211 if [ $errval -eq 0 ]; then 212 run_check 213 check_err $? ${tcount}; errval=$? 214 fi 268 PRELUDEPID=0 269 # 270 if test ${tcount} -eq 5; 271 then 272 273 PM=`find_path prelude-manager` 274 275 if [ -z "$PM" ]; then 276 if [ $errval -eq 0 ]; then 277 run_check 278 check_err $? ${tcount}; errval=$? 279 fi 280 elif [ -z "$doall" ]; then 281 if [ $errval -eq 0 ]; then 282 run_check 283 check_err $? ${tcount}; errval=$? 284 fi 285 else 286 # 287 # 288 ${TOP_SRCDIR}/configure ${BUILDOPTS} --with-prelude 289 # 290 # 291 if test x$? = x0; then 292 [ -z "$verbose" ] || log_msg_ok "configure..."; 293 $MAKE >/dev/null 2>&1 294 if test x$? = x0; then 295 [ -z "$verbose" ] || log_msg_ok "make..."; 296 else 297 [ -z "$quiet" ] && log_msg_fail "make..."; 298 return 1 299 fi 300 301 else 302 [ -z "$quiet" ] && log_msg_fail "configure..."; 303 return 1 304 fi 305 # 306 # 307 if ! test -d /var/run/prelude-manager 308 then 309 [ -z "$verbose" ] || log_msg_ok "create /var/run/prelude-manager..."; 310 sudo mkdir /var/run/prelude-manager 311 sudo chown prelude:rainer /var/run/prelude-manager 312 sudo chmod 770 /var/run/prelude-manager 313 fi 314 if ! test -d /var/spool/prelude/samhain/global 315 then 316 [ -z "$verbose" ] || log_msg_ok "create /var/spool/prelude/samhain/global..."; 317 sudo mkdir -p /var/spool/prelude/samhain/global 318 sudo chown prelude:rainer /var/spool/prelude/samhain/global 319 sudo chmod 770 /var/spool/prelude/samhain/global 320 fi 321 322 # 323 # 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=$! 327 # 328 # 329 five_sec_sleep 330 # 331 # 332 if [ $errval -eq 0 ]; then 333 run_check_prelude 334 check_err $? ${tcount}; errval=$? 335 fi 336 fi 337 338 else 339 if [ $errval -eq 0 ]; then 340 run_check 341 check_err $? ${tcount}; errval=$? 342 fi 343 fi 344 # 215 345 if [ $errval -eq 0 ]; then 216 346 eval chk_portdata_${tcount} … … 219 349 # 220 350 if [ $errval -eq 0 ]; then 221 [ -z "$quiet" ] && log_ok ${tcount} ${MAXTEST}; 351 if test ${tcount} -ne 5; then 352 [ -z "$quiet" ] && log_ok ${tcount} ${MAXTEST}; 353 fi 222 354 fi 223 355 let "tcount = tcount + 1" >/dev/null 224 356 POLICY=`eval echo '"$'"PORTPOLICY_$tcount"'"'` 357 358 if test $PRELUDEPID -ne 0; 359 then 360 kill $PRELUDEPID 361 fi 362 225 363 done 226 364
Note:
See TracChangeset
for help on using the changeset viewer.