Changeset 562 for trunk/test
- Timestamp:
- Jun 29, 2021, 10:23:44 PM (3 years ago)
- Location:
- trunk/test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/testrun_1b.sh
r539 r562 239 239 do_test_1b_2 () { 240 240 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 248 250 249 251 ./samhain -t check -p none -l info --set-prelude-severity=info --prelude --server-addr 127.0.0.1:5500 >/dev/null … … 259 261 else 260 262 [ -z "$quiet" ] && log_msg_fail "check..."; 261 kill $PID263 #kill $PID 262 264 return 1 263 265 fi 264 266 # 265 tmp=`egrep 'File original:.*name=etc.*path=/etc' test_log_prelude2>/dev/null | wc -l`267 tmp=`egrep 'File original:.*name=etc.*path=/etc' ${test_log_prelude} 2>/dev/null | wc -l` 266 268 if [ $tmp -lt 1 ]; then 267 269 [ -z "$verbose" ] || log_msg_fail "/etc"; 268 kill $PID269 return 1 270 fi 271 tmp=`egrep 'Classification text: Checking' test_log_prelude2>/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` 272 274 if [ $tmp -lt 1 ]; then 273 275 [ -z "$verbose" ] || log_msg_fail "checking"; 274 kill $PID276 #kill $PID 275 277 return 1 276 278 fi 277 279 # 278 280 if test "x$2" = "xmodrc"; then 279 tmp=`egrep 'Classification text: Service opened' test_log_prelude2>/dev/null | wc -l`281 tmp=`egrep 'Classification text: Service opened' ${test_log_prelude} 2>/dev/null | wc -l` 280 282 if [ $tmp -lt 1 ]; then 281 283 [ -z "$verbose" ] || log_msg_fail "service"; 282 kill $PID283 return 1 284 fi 285 tmp=`egrep 'Service: port=5500' test_log_prelude2>/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` 286 288 if [ $tmp -lt 1 ]; then 287 289 [ -z "$verbose" ] || log_msg_fail "port 5500"; 288 kill $PID290 #kill $PID 289 291 return 1 290 292 fi 291 293 fi 292 294 # 293 kill $PID295 #kill $PID 294 296 return 0 295 297 } -
trunk/test/testrun_1e.sh
r468 r562 25 25 MAXTEST=5; export MAXTEST 26 26 27 test_log_prelude="/var/log/prelude/prelude-text.log"; export test_log_prelude 28 27 29 PORTPOLICY_5=" 28 30 [ReadOnly] … … 42 44 log_skip 5 $MAXTEST 'logging to prelude (or use --really-all)' 43 45 else 44 tmp=`egrep 'Service: port=5500 .unknown. protocol=tcp' test_log_prelude2>/dev/null | wc -l`46 tmp=`egrep 'Service: port=5500 .unknown. protocol=tcp' ${test_log_prelude} 2>/dev/null | wc -l` 45 47 if [ $tmp -lt 1 ]; then 46 48 [ -z "$verbose" ] || log_msg_fail "port 5500"; … … 187 189 run_check_prelude() 188 190 { 191 echo -n >"${test_log_prelude}" 192 189 193 ./samhain -t check -p none -l info --set-prelude-severity=info --prelude --server-addr 127.0.0.1:5500 >/dev/null 190 194 … … 322 326 # 323 327 # 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=$! 327 331 # 328 332 # -
trunk/test/testrun_2d.sh
r481 r562 38 38 # PGPASSWORD=samhain; export PGPASSWORD 39 39 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}';" 41 41 # 42 42 egrep "START.*Yule" test_log_db >/dev/null 2>&1 43 43 if [ $? -ne 0 ]; then 44 [ -z "$verbose" ] || log_msg_fail "Server start (psql) ";44 [ -z "$verbose" ] || log_msg_fail "Server start (psql) DATE ${DATE}"; 45 45 return 1 46 46 fi … … 88 88 # PGPASSWORD="samhain"; export PGPASSWORD 89 89 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` 91 91 if [ $? -ne 0 -o -z "$TEST" ]; then 92 92 log_skip 1 $MAXTEST "psql not default setup" … … 112 112 ORIGINAL="DatabaseSeverity=none" 113 113 REPLACEMENT="DatabaseSeverity=info" 114 ex -s $RCFILE <<EOF 115 %s/$ORIGINAL/$REPLACEMENT/g 116 wq 117 EOF 118 # 119 ORIGINAL="# setdbname=samhain" 120 REPLACEMENT="setdbhost=127.0.0.1" 114 121 ex -s $RCFILE <<EOF 115 122 %s/$ORIGINAL/$REPLACEMENT/g
Note:
See TracChangeset
for help on using the changeset viewer.