From 2ea860f2c19daa27f71bc191d329f68f9e6ad8fa Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 28 Mar 2023 18:08:30 +0200 Subject: [PATCH] regress: Add more tests with update volumeprotect --- regress/tests/read-only-volume-test | 69 ++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/regress/tests/read-only-volume-test b/regress/tests/read-only-volume-test index 0f3d194d2..161de8529 100755 --- a/regress/tests/read-only-volume-test +++ b/regress/tests/read-only-volume-test @@ -15,7 +15,11 @@ JobName=backup scripts/cleanup scripts/copy-confs -# + +# TODO: Run the command with jobid=%j in a runscript +# TODO: Run the command with concurrent jobs and MaximumVolumeJobs = 1 +# TODO: Check how the immutable flag is removed + # Zap out any schedule in default conf file so that # it doesn't start during our test # @@ -29,6 +33,31 @@ $bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaximumVolumeBytes', '50MB', $bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaximumVolumeJobs', '1', 'Pool')" cat <> $conf/bacula-dir.conf +Job { + Name = acljob + Jobdefs = DefaultJob + ClientRunBeforeJob = "sleep 5" + RunScript { + Console = "update volumeprotect jobid=%i" + RunsOnClient = no + RunsWhen = After + } +} +Console { + Name = restricted-job + Password = xxx + JobAcl = acljob + ClientAcl = $HOST-fd + PoolAcl = File + CatalogAcl = *all* + FileSetAcl = *all* + CommandAcl = *all* + StorageAcl = File1 + WhereAcl = *all* + DirectoryAcl = *all* + UserIdAcl = *all* +} + Job { Name = adm-update-protected Type = Admin @@ -41,6 +70,19 @@ Job { } EOF +cat < $tmp/bconsole.conf.job +Console { + Name = restricted-job + Password = xxx +} +Director { + Name = $HOST-dir + DIRport = $BASEPORT + address = localhost + Password = xxx +} +EOF + change_jobname BackupClient1 $JobName start_test @@ -99,6 +141,23 @@ wait messages @output $tmp/vol5.out llist volume=Vol-0014 +@$out $tmp/vol6.out +run job=acljob yes +wait +messages +@output $tmp/vol6.out +llist volume=Vol-0010 +llist volume=Vol-0011 +@$out $tmp/vol7.out +run job=acljob level=full yes +@sleep 3 +setbandwidth +1 +5MB/s +yes +run job=acljob level=full yes +wait +messages quit END_OF_DATA @@ -152,6 +211,14 @@ $bperl -e 'check_protect("$tmp/log1.out", "Vol-0014", "Used", 0, 1)' if [ $? != 0 ]; then estat=1 fi +$bperl -e 'check_protect("$tmp/vol6.out", "Vol-0011", "Used", 1, 1)' +if [ $? != 0 ]; then + estat=1 +fi +$bperl -e 'check_protect("$tmp/vol6.out", "Vol-0010", "Used", 1, 1)' +if [ $? != 0 ]; then + estat=1 +fi check_two_logs check_restore_diff end_test -- 2.47.3