Changeset 51 for trunk/test
- Timestamp:
- Jul 17, 2006, 10:31:56 PM (18 years ago)
- Location:
- trunk/test
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/test.sh
r30 r51 398 398 } 399 399 400 # This looks silly, but with solaris10/i386 on vmware, 401 # 'sleep' occasionally does not sleep... 402 403 one_sec_sleep () { 404 onesdate=`date` 405 onestest=0 406 while [ $onestest -eq 0 ]; do 407 sleep 1 408 twosdate=`date` 409 if [ "x$twosdate" = "x$onesdate" ]; then 410 onestest=0 411 else 412 onestest=1 413 fi 414 done 415 } 416 417 five_sec_sleep () { 418 for f in 1 2 3 4 5; do 419 one_sec_sleep 420 done 421 } 422 400 423 do_cleanup () { 401 424 rm -f testrc_1.dyn -
trunk/test/testext.sh
r30 r51 101 101 102 102 # The shell is too fast ... 103 sleep 1103 one_sec_sleep 104 104 [ -z "$verbose" ] || { 105 105 echo; -
trunk/test/testrun_1.sh
r30 r51 76 76 77 77 mod_testdata_11 () { 78 sleep 178 one_sec_sleep 79 79 echo "foobar" >"${BASE}/c/x"; # bad 80 80 chmod 0555 "${BASE}/a/y"; # bad 81 81 ORIGINAL='SetFilecheckTime=60' 82 82 REPLACEMENT='FileCheckScheduleOne = 6 12 * * *' 83 ex $RCFILE <<EOF83 ex -s $RCFILE <<EOF 84 84 %s/${ORIGINAL}/${REPLACEMENT}/g 85 85 wq … … 120 120 121 121 mod_testdata_10 () { 122 sleep 1122 one_sec_sleep 123 123 echo "foobar" >"${BASE}/b/x"; # ok 124 124 echo "foobar" >"${BASE}/c/x"; # bad … … 222 222 223 223 mod_testdata_7 () { 224 sleep 1224 one_sec_sleep 225 225 echo "foobar" >"${BASE}/a/a/a/z" # ok 226 226 echo "foobar" >"${BASE}/a/a/a/x" # bad … … 275 275 276 276 mod_testdata_6 () { 277 sleep 1277 one_sec_sleep 278 278 for ff in $TDIRS; do 279 279 echo "foobar" >"${BASE}/${ff}/x" … … 446 446 447 447 mod_testdata_4 () { 448 sleep 1448 one_sec_sleep 449 449 echo "foobar" >> "${BASE}/a/a/x" # Attributes 450 450 echo "foobar" > "${BASE}/a/a/c/foo" # new within LogFiles … … 535 535 " 536 536 mod_testdata_3 () { 537 sleep 1537 one_sec_sleep 538 538 echo "foobar" > "${BASE}/a/b/foo" # new within Attributes 539 539 chmod 0555 "${BASE}/a/b" … … 666 666 667 667 mod_testdata_1 () { 668 sleep 1668 one_sec_sleep 669 669 touch "${BASE}/a/a/x" 670 670 chmod 0555 "${BASE}/a/a/y" -
trunk/test/testrun_1b.sh
r27 r51 123 123 PID=$! 124 124 125 sleep 5125 five_sec_sleep 126 126 127 127 ./samhain -t check -p none -l info --set-prelude-severity=info --prelude --server-addr 127.0.0.1:5500 >/dev/null -
trunk/test/testrun_1c.sh
r30 r51 53 53 54 54 mod_suiddata_6 () { 55 sleep 155 one_sec_sleep 56 56 chmod 4755 "${BASE}/a/a/y" 57 57 } 58 58 59 59 chk_suiddata_6 () { 60 sleep 160 one_sec_sleep 61 61 tmp=`ls -l "${BASE}/a/a/y" 2>/dev/null | awk '{ print $1}'` 62 62 if [ "x$tmp" = "x-rwsr-xr-x" ]; then … … 91 91 92 92 mod_suiddata_5 () { 93 sleep 193 one_sec_sleep 94 94 chmod 4755 "${BASE}/a/a/y" 95 95 } 96 96 97 97 chk_suiddata_5 () { 98 sleep 198 one_sec_sleep 99 99 if [ -f "${BASE}/a/a/y" ]; then 100 100 [ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y (not deleted)"; … … 127 127 128 128 mod_suiddata_4 () { 129 sleep 1129 one_sec_sleep 130 130 chmod 4755 "${BASE}/a/a/y" 131 131 } 132 132 133 133 chk_suiddata_4 () { 134 sleep 1134 one_sec_sleep 135 135 tmp=`cat "${BASE}/a/a/y" 2>/dev/null | wc -c` 136 136 if [ $tmp -ne 0 ]; then … … 164 164 165 165 mod_suiddata_3 () { 166 sleep 1166 one_sec_sleep 167 167 chmod 4755 "${BASE}/a/a/y" 168 168 } 169 169 170 170 chk_suiddata_3 () { 171 sleep 1171 one_sec_sleep 172 172 tmp=`ls -l "${BASE}/a/a/y" 2>/dev/null | awk '{ print $1}'` 173 173 if [ "x$tmp" = "x-rwxr-xr-x" ]; then … … 192 192 193 193 mod_suiddata_2 () { 194 sleep 1194 one_sec_sleep 195 195 chmod 4755 "${BASE}/a/a/y" 196 196 } 197 197 198 198 chk_suiddata_2 () { 199 sleep 1199 one_sec_sleep 200 200 tmp=`cat "${BASE}/a/a/y" 2>/dev/null | wc -c` 201 201 if [ $tmp -ne 0 ]; then … … 218 218 219 219 mod_suiddata_1 () { 220 sleep 1220 one_sec_sleep 221 221 chmod 4755 "${BASE}/a/a/y" 222 222 } 223 223 224 224 chk_suiddata_1 () { 225 sleep 1225 one_sec_sleep 226 226 if [ -f "${BASE}/a/a/y" ]; then 227 227 [ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y (not removed)"; -
trunk/test/testrun_2.sh
r34 r51 37 37 ${VALGRIND} ./yule.2 -l info -p none >/dev/null 2>>test_log_valgrind & 38 38 PROC_Y2=$! 39 sleep 539 five_sec_sleep 40 40 41 41 [ -z "$verbose" ] || { … … 48 48 --server-port=49778 >/dev/null 2>>test_log_valgrind & 49 49 PROC_Y=$! 50 sleep 550 five_sec_sleep 51 51 52 52 [ -z "$verbose" ] || { … … 68 68 kill $PROC_Y 69 69 kill $PROC_Y2 70 sleep 570 five_sec_sleep 71 71 72 72 # cp ${LOGFILE} triple_test … … 137 137 ORIGINAL="UseSeparateLogs=no" 138 138 REPLACEMENT="UseSeparateLogs=yes" 139 ex $RCFILE <<EOF139 ex -s $RCFILE <<EOF 140 140 %s/$ORIGINAL/$REPLACEMENT/g 141 141 wq … … 154 154 ${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind & 155 155 PROC_Y=$! 156 sleep 5156 five_sec_sleep 157 157 158 158 [ -z "$verbose" ] || { … … 172 172 173 173 kill $PROC_Y 174 sleep 5174 five_sec_sleep 175 175 176 176 if [ -f ${LOGFILE}.${SH_LOCALHOST} ]; then … … 242 242 ORIGINAL_5="dir=1" 243 243 REPLACEMENT_5="#dir=1" 244 ex $RCFILE <<EOF244 ex -s $RCFILE <<EOF 245 245 %s/${ORIGINAL_1}/${REPLACEMENT_1}/g 246 246 %s/${ORIGINAL_2}/${REPLACEMENT_2}/g … … 263 263 ${VALGRIND} ./yule -p none -e none >/dev/null 2>>test_log_valgrind & 264 264 PROC_Y=$! 265 sleep 5265 five_sec_sleep 266 266 267 267 [ -z "$verbose" ] || { … … 276 276 # echo "PID is ${PROC_S}" 277 277 [ -z "$verbose" ] || log_msg_ok "samhain.new -t check"; 278 sleep 5278 five_sec_sleep 279 279 # Redirect the shells (un-)helpful job monitoring messages. 280 280 # The 'disown' buildin is not portable. … … 293 293 294 294 kill $PROC_Y 295 sleep 5295 five_sec_sleep 296 296 297 297 egrep "START(>|\").*Yule(>|\")" $LOGFILE >/dev/null 2>&1 … … 340 340 341 341 # 'id -u' is posix 342 me=`id -u` 342 if test -f /usr/xpg4/bin/id 343 then 344 me=`/usr/xpg4/bin/id -u` 345 else 346 me=`id -u` 347 fi 343 348 344 349 ORIGINAL_1="SetSocketAllowUid=0" 345 350 REPLACEMENT_1="SetSocketAllowUid=$me" 346 ex $RCFILE <<EOF351 ex -s $RCFILE <<EOF 347 352 %s/${ORIGINAL_1}/${REPLACEMENT_1}/g 348 353 wq … … 361 366 >/dev/null 2>>test_log_valgrind & 362 367 PROC_Y=$! 363 sleep 5368 five_sec_sleep 364 369 365 370 [ -z "$verbose" ] || { … … 444 449 445 450 kill ${PROC_Y} 446 sleep 2 451 one_sec_sleep 452 one_sec_sleep 447 453 kill -9 ${PROC_Y} >/dev/null 2>&1 448 454 … … 499 505 >/dev/null 2>>test_log_valgrind & 500 506 PROC_Y=$! 501 sleep 5507 five_sec_sleep 502 508 503 509 egrep '<!-- head -->' $HTML >/dev/null 2>&1 … … 533 539 534 540 kill $PROC_Y 535 sleep 5541 five_sec_sleep 536 542 537 543 # rm -f head.html; rm -f foot.html; rm -f entry.html; -
trunk/test/testrun_2a.sh
r44 r51 38 38 ${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind & 39 39 PROC_Y=$! 40 sleep 540 five_sec_sleep 41 41 42 42 [ -z "$verbose" ] || { … … 56 56 57 57 kill $PROC_Y 58 sleep 558 five_sec_sleep 59 59 60 60 egrep "START(>|\").*Yule(>|\")" $LOGFILE >/dev/null 2>&1 -
trunk/test/testrun_2c.sh
r30 r51 91 91 ORIGINAL="DatabaseSeverity=none" 92 92 REPLACEMENT="DatabaseSeverity=info" 93 ex $RCFILE <<EOF93 ex -s $RCFILE <<EOF 94 94 %s/$ORIGINAL/$REPLACEMENT/g 95 95 wq -
trunk/test/testrun_2d.sh
r30 r51 93 93 ORIGINAL="DatabaseSeverity=none" 94 94 REPLACEMENT="DatabaseSeverity=info" 95 ex $RCFILE <<EOF95 ex -s $RCFILE <<EOF 96 96 %s/$ORIGINAL/$REPLACEMENT/g 97 97 wq -
trunk/test/testtimesrv.sh
r30 r51 186 186 count=0 187 187 until [ -f $PIDFILE ]; do 188 sleep 1188 one_sec_sleep 189 189 let "count = count + 1" >/dev/null 190 190 if [ $count -gt 12 ]; then … … 241 241 count=0 242 242 while [ `kill -0 $PID` ]; do 243 sleep 1243 one_sec_sleep 244 244 let "count = count + 1" >/dev/null 245 245 if [ $count -gt 12 ]; then … … 261 261 tmp2=`grep 'SUSPEND' $LOGFILE | wc -l` 262 262 while [ $tmp2 -ne $2 ]; do 263 sleep 1263 one_sec_sleep 264 264 let "count = count + 1" >/dev/null 265 265 if [ $count -gt 12 ]; then … … 275 275 tmp2=$tmp 276 276 while [ $tmp2 -eq $tmp ]; do 277 sleep 1277 one_sec_sleep 278 278 let "count = count + 1" >/dev/null 279 279 if [ $count -gt 12 ]; then … … 294 294 tmp2=$tmp 295 295 while [ $tmp2 -eq $tmp ]; do 296 sleep 1296 one_sec_sleep 297 297 let "count = count + 1" >/dev/null 298 298 if [ $count -gt 12 ]; then … … 324 324 tmp=`grep CRIT $LOGFILE | grep -v Runtime | wc -l` 325 325 while [ $tmp -lt 2 ]; do 326 sleep 1326 one_sec_sleep 327 327 if [ $count -gt 12 ]; then 328 328 [ -z "$verbose" ] || log_msg_fail "policy count (after)"; … … 336 336 tmp2=0 337 337 while [ $tmp2 -ne $2 ]; do 338 sleep 1338 one_sec_sleep 339 339 let "count = count + 1" >/dev/null 340 340 if [ $count -gt 12 ]; then … … 353 353 count=0 354 354 while [ -f $LOGFILE.lock ]; do 355 sleep 1355 one_sec_sleep 356 356 let "count = count + 1" >/dev/null 357 357 if [ $count -gt 12 ]; then … … 363 363 kill -TTOU $PID 364 364 365 sleep 4365 five_sec_sleep 366 366 367 367 if [ -f $LOGFILE.lock ]; then
Note:
See TracChangeset
for help on using the changeset viewer.