From: Eric Bollengier Date: Fri, 29 Jan 2010 10:28:06 +0000 (+0100) Subject: regress: Update ActionOnPurge test X-Git-Tag: Release-7.0.0~2295 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a2bef228829992a0c3abf350012f34ee2d63e3e3;p=bacula%2Fbacula regress: Update ActionOnPurge test --- diff --git a/regress/tests/action-on-purge-test b/regress/tests/action-on-purge-test index 264cad4870..cf96c529d6 100755 --- a/regress/tests/action-on-purge-test +++ b/regress/tests/action-on-purge-test @@ -2,7 +2,7 @@ # # TestName="action-on-purge-test" -JobName=AOP +JobName=FIFOTest . scripts/functions cwd=`pwd` @@ -10,10 +10,26 @@ scripts/cleanup scripts/copy-test-confs echo $src > $tmp/file-list +echo $cwd/tmp/bfifo >> $tmp/file-list +rm -f ${cwd}/tmp/bfifo +mkfifo ${cwd}/tmp/bfifo +# send a file into the fifo +( +echo test1 >$cwd/tmp/bfifo +print_debug FIRST ECHO +/bin/sleep 5 +echo test2 >$cwd/tmp/bfifo +print_debug SECOND ECHO +/bin/sleep 5 +echo test2 >$cwd/tmp/bfifo +print_debug THIRD ECHO +/bin/sleep 5 +cat > $cwd/tmp/bfifo & +)& + sed 's/Pool Type = Backup/Pool Type = Backup; ActionOnPurge = Truncate/' $conf/bacula-dir.conf > $tmp/1 cp $tmp/1 $conf/bacula-dir.conf -change_jobname CompressedTest $JobName start_test cat >tmp/bconcmds <tmp/bconcmds < 4096)" if [ $? != 0 ]; then print_debug `ls -l $tmp/TestVolume001` - bstat=2 + estat=2 fi +print_debug "Test TestVolume002 size" perl -e "die 'Volume size too small' if (-s '$tmp/TestVolume002' < 4096)" if [ $? != 0 ]; then print_debug `ls -l $tmp/TestVolume002` - bstat=2 + estat=2 +fi + +print_debug "Test TestVolume003 size (drive busy)" +perl -e "die 'Volume size too small' if (-s '$tmp/TestVolume003' < 4096)" +if [ $? != 0 ]; then + print_debug `ls -l $tmp/TestVolume003` + estat=2 fi print_debug "Test if Pool record is ok" r=`awk '/Default/ { print $4 }' $tmp/log4.out` if [ "$r" != 1 ]; then - print_debug "ActionOnPurge on Pool record should be 1" - bstat=2 + print_debug "ActionOnPurge on Pool record should be 1 ($r)" + estat=2 fi print_debug "Test TestVolume001 if Media record is ok" r=`awk '/TestVolume001/ { print $4 }' $tmp/log4.out` if [ "$r" != 1 ]; then print_debug "ActionOnPurge on Media record should be 1" - bstat=2 + estat=2 fi print_debug "Test TestVolume002 if Media record is ok" r=`awk '/TestVolume002/ { print $4 }' $tmp/log4.out` if [ "$r" != 0 ]; then print_debug "ActionOnPurge on Media record should be 0" - bstat=2 + estat=2 fi end_test