From: Eric Bollengier Date: Wed, 22 Mar 2023 14:08:25 +0000 (+0100) Subject: regress: Add test for purge jobs jobid=x with ACLs X-Git-Tag: Release-13.0.3~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6c9313d9d3075cc759eb50091d55f4de04d69c3;p=thirdparty%2Fbacula.git regress: Add test for purge jobs jobid=x with ACLs --- diff --git a/regress/tests/console-acl-test b/regress/tests/console-acl-test index 0c43a4395..2dbdb7a30 100755 --- a/regress/tests/console-acl-test +++ b/regress/tests/console-acl-test @@ -1557,5 +1557,76 @@ if grep "17 | TestVolume003" $fn > /dev/null; then estat=1 fi +################ +fn=$tmp/purge-jobid.out +cat < $tmp/bconcmds +@############################################## +@$out $fn +update volume=TestVolume001 volstatus=Append +update volume=TestVolume002 volstatus=Append +run job=Simple client=test1-fd level=full yes +wait +message +quit +EOF + +$bin/bconsole -c $conf/bconsole.conf.old < $tmp/bconcmds + +# Here everything should work + +cat < $tmp/bconcmds +@############################################## +@$out $fn-purge +list files jobid=18 +purge files jobid=18 yes +list files jobid=18 +list jobs +purge jobs name=Simple client=test1-fd yes +list jobs +quit +EOF + +$bin/bconsole -c $tmp/bconsole.conf.job-client < $tmp/bconcmds + +if grep " 18 " $fn-purge; then + print_debug "ERROR: Should not even find jobid 18 in $fn-purge" + estat=1 +fi + +nb=`grep uk.po $fn-purge | wc -l` +if [ $nb != 0 ]; then + print_debug "ERROR: Should not find uk.po file in $fn-purge" + estat=1 +fi + +# Try to purge jobid 18 +cat < $tmp/bconcmds +@############################################## +@$out $fn-after-purge +list files jobid=18 +purge files jobid=18 yes +list files jobid=18 + +list jobs +purge jobs name=Simple client=test1-fd yes +list jobs +quit +EOF + +$bin/bconsole -c $conf/bconsole.conf.old < $tmp/bconcmds + +nb=`grep " 18 " $fn-after-purge | wc -l` +if [ $nb != 3 ]; then + print_debug "ERROR: Should find 3 times jobid 18 in $fn-after-purge" + estat=1 +fi + +nb=`grep uk.po $fn-after-purge | wc -l` +if [ $nb != 1 ]; then + print_debug "ERROR: Should find 1 time the uk.po file in $fn-after-purge" + estat=1 +fi + + stop_bacula end_test