X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Faction-on-purge-test;h=0d013bdcf8cbe96138af9b38bc90a48d9ed88879;hb=86da6147f63b29cb85d51620b55bae7266f1c890;hp=c288a32422e163690c7fee93ae25a957d8827668;hpb=a00e029e3ea1f4fa1d98a3bf3402809844a493c9;p=bacula%2Fbacula diff --git a/regress/tests/action-on-purge-test b/regress/tests/action-on-purge-test index c288a32422..0d013bdcf8 100755 --- a/regress/tests/action-on-purge-test +++ b/regress/tests/action-on-purge-test @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (C) 2000-2015 Kern Sibbald +# Copyright (C) 2000-2017 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS -# - # # TestName="action-on-purge-test" @@ -100,40 +98,54 @@ run_bacula check_for_zombie_jobs storage=File print_debug "Check all media" -perl -Mscripts::functions -e 'foreach $i (1..5){check_min_volume_size(4096,"TestVolume00$i")}' - -if [ $? != 0 ]; then - print_debug `ls -l $tmp` - print_debug "Initialization problem" - estat=2 -fi +for i in 1 2 3 4 5 ; do + size=`du -b $tmp/TestVolume00$i|cut -f1` + if test $size -lt 5000 ; then + print_debug "ERROR 2: Volume TestVolum00$i is too small $size" + ls -l $tmp/TestVolume00$i + estat=2 + fi +done echo "purge volume=TestVolume001 action storage=File" > $tmp/bconcmds run_bconsole -perl -Mscripts::functions -e ' -check_min_volume_size(4096, "TestVolume002","TestVolume003","TestVolume004","TestVolume005"); -check_max_volume_size(4096, "TestVolume001")' - -if [ $? != 0 ]; then - print_debug `ls -l $tmp` - ls -l $tmp - estat=2 -fi +for i in 2 3 4 5 ; do + size=`du -b $tmp/TestVolume00$i|cut -f1` + if test $size -lt 5000 ; then + print_debug "ERROR 3: Volume TestVolum00$i is too small $size" + ls -l $tmp/TestVolume00$i + estat=3 + fi +done +for i in 1 ; do + size=`du -b $tmp/TestVolume00$i|cut -f1` + if test $size -gt 5000 ; then + print_debug "ERROR 4: Volume TestVolum00$i is not truncated (too big) $size" + ls -l $tmp/TestVolume00$i + estat=4 + fi +done echo "purge volume action storage=File" > $tmp/bconcmds run_bconsole -perl -Mscripts::functions -e ' -check_min_volume_size(4096, "TestVolume002", "TestVolume005"); -check_max_volume_size(4096, "TestVolume001", "TestVolume003", "TestVolume004")' - -if [ $? != 0 ]; then - print_debug `ls -l $tmp` - ls -l $tmp - estat=2 -fi - +for i in 2 5 ; do + size=`du -b $tmp/TestVolume00$i|cut -f1` + if test $size -lt 5000 ; then + print_debug "ERROR 5: Volume TestVolum00$i is too small $size" + ls -l $tmp/TestVolume00$i + estat=5 + fi +done +for i in 1 3 4 ; do + size=`du -b $tmp/TestVolume00$i|cut -f1` + if test $size -gt 5000 ; then + print_debug "ERROR 6: Volume TestVolum00$i is not truncated (too big) $size" + ls -l $tmp/TestVolume00$i + estat=6 + fi +done cat < $tmp/bconcmds @#########################################################