From: Eric Bollengier Date: Tue, 4 Apr 2023 11:07:39 +0000 (+0200) Subject: regress: add more checks to console-acl-test X-Git-Tag: Release-13.0.3~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c84553bb33503090bc0b1f4ed50854d5646064b3;p=thirdparty%2Fbacula.git regress: add more checks to console-acl-test --- diff --git a/regress/scripts/setup_rconsole b/regress/scripts/setup_rconsole index c9e2550b7..6f08ae9f1 100755 --- a/regress/scripts/setup_rconsole +++ b/regress/scripts/setup_rconsole @@ -12,6 +12,9 @@ sed "s/$HOST-fd/test-rst-fd/" $tmp/1 >> $conf/bacula-dir.conf sed "s/$HOST-fd/test-bkp-fd/" $tmp/1 >> $conf/bacula-dir.conf cat <> $conf/bacula-dir.conf +FileSet { + Name = empty +} Pool { Name = Test Pool Type = Backup diff --git a/regress/tests/console-acl-test b/regress/tests/console-acl-test index 9671b1ada..04cf80622 100755 --- a/regress/tests/console-acl-test +++ b/regress/tests/console-acl-test @@ -30,6 +30,7 @@ change_jobname NightlySave $JobName $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Autoprune", "no", "Director")' $bperl -e 'add_attribute("$conf/bacula-dir.conf", "File Retention", "2s", "Client")' $bperl -e 'add_attribute("$conf/bacula-dir.conf", "File Retention", "2s", "Pool")' +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "FileSet", "empty", "Job", "RestoreFiles")' $rscripts/setup_rconsole @@ -761,11 +762,23 @@ cat < $tmp/bconcmds @############################################## @$out $fn restore +1 +. +restore +11 +. +restore 11 test1 +restore +11 +1,2,3,4 +1 +test1 /etc/ -done -. + /dev/null; then estat=1 fi +if ! grep "Job not run" $fn > /dev/null; then + print_debug "ERROR: Should find that job did not run in $fn" + estat=1 +fi + +if ! grep "Operation not allowed" $fn > /dev/null; then + print_debug "ERROR: Should find a message about < input in $fn" + estat=1 +fi + +if ! grep "Bootstrap records written" $fn > /dev/null; then + print_debug "ERROR: Should find that the restore wrote a bootstrap in $fn" + estat=1 +fi + # Here the client is automatically selected, and we have other jobs # the file fn=$tmp/restore9.out @@ -1643,5 +1671,33 @@ if ! grep "Backup OK" $fn-after-purge > /dev/null; then estat=1 fi +# Try to restore without the fileset configured +fn=$tmp/restore.out +cat < $tmp/bconcmds +@############################################## +@$out $fn +.fileset +run job=backup level=full yes +wait +message +restore client=$HOST-fd +5 +m * +done +yes +wait +message +quit +EOF + +$bin/bconsole -c $tmp/bconsole.conf.fileset < $tmp/bconcmds + +# It should select a different fileset by default +# as "empty" is not available for this console +if grep empty $fn; then + print_debug "ERROR: Should not find the empty fileset in $fn" + estat=1 +fi + stop_bacula end_test