From: Eric Bollengier Date: Fri, 19 Nov 2021 20:49:49 +0000 (+0100) Subject: regress: Add setup_rconsole X-Git-Tag: Release-13.0.3~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7639184e0bd5921e905da41f69b0188528213071;p=thirdparty%2Fbacula.git regress: Add setup_rconsole --- diff --git a/regress/scripts/setup_rconsole b/regress/scripts/setup_rconsole new file mode 100755 index 000000000..c9e2550b7 --- /dev/null +++ b/regress/scripts/setup_rconsole @@ -0,0 +1,151 @@ +#!/bin/sh + +. scripts/functions + +$bperl \ + -e "extract_resource('$conf/bacula-dir.conf', 'Client', '$HOST-fd')" \ + > $tmp/1 + +sed "s/$HOST-fd/test1-fd/" $tmp/1 >> $conf/bacula-dir.conf +sed "s/$HOST-fd/test2-fd/" $tmp/1 >> $conf/bacula-dir.conf +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 +Pool { + Name = Test + Pool Type = Backup + Recycle = yes # Bacula can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365d # one year +} +Console { + Name = restricted + Password = xxx + JobAcl = *all* + ClientAcl = test1-fd, test2-fd + RestoreClientAcl = test-rst-fd + BackupClientAcl = test-bkp-fd + PoolAcl = *all* + CatalogAcl = *all* + FileSetAcl = *all* + CommandAcl = *all* + StorageAcl = *all* + WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2 + DirectoryAcl = *all* + UserIdAcl = *all* +} +Console { + Name = restricted-bvfs1 + Password = xxx + JobAcl = *all* + ClientAcl = test1-fd, test2-fd + RestoreClientAcl = test-rst-fd + PoolAcl = *all* + CatalogAcl = *all* + FileSetAcl = *all* + CommandAcl = *all* + StorageAcl = *all* + WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2 + DirectoryAcl = *all* + UserIdAcl = *all* +} +Console { + Name = restricted-bvfs2 + Password = xxx + JobAcl = *all* + RestoreClientAcl = test-rst-fd + PoolAcl = *all* + CatalogAcl = *all* + FileSetAcl = *all* + CommandAcl = *all* + StorageAcl = *all* + WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2 + DirectoryAcl = *all* + UserIdAcl = *all* +} +Console { + Name = restricted-job + Password = xxx + JobAcl = $JobName + ClientAcl = *all* + PoolAcl = *all* + CatalogAcl = *all* + FileSetAcl = *all* + CommandAcl = *all* + StorageAcl = *all* + WhereAcl = *all* + DirectoryAcl = *all* + UserIdAcl = *all* +} +Console { + Name = restricted-client + Password = xxx + JobAcl = *all* + ClientAcl = $HOST-fd + PoolAcl = *all* + CatalogAcl = *all* + FileSetAcl = *all* + CommandAcl = *all* + StorageAcl = *all* + WhereAcl = *all* + DirectoryAcl = *all* + UserIdAcl = *all* +} +Console { + Name = restricted-clients + Password = xxx + JobAcl = *all* + ClientAcl = $HOST-fd, test1-fd + PoolAcl = *all* + CatalogAcl = *all* + FileSetAcl = *all* + CommandAcl = *all* + StorageAcl = *all* + WhereAcl = *all* + DirectoryAcl = *all* + UserIdAcl = *all* +} +Console { + Name = restricted-pool + Password = xxx + JobAcl = *all* + ClientAcl = *all* + PoolAcl = Test + CatalogAcl = *all* + FileSetAcl = *all* + CommandAcl = *all* + StorageAcl = *all* + WhereAcl = *all* + DirectoryAcl = *all* + UserIdAcl = *all* +} +Console { + Name = restricted-fileset + Password = xxx + JobAcl = *all* + ClientAcl = *all* + PoolAcl = *all* + CatalogAcl = *all* + FileSetAcl = "Full Set" + CommandAcl = *all* + StorageAcl = *all* + WhereAcl = *all* + DirectoryAcl = *all* + UserIdAcl = *all* +} +EOF + +cat <> $tmp/bconsole.conf2 +Console { + Name = restricted + Password = xxx +} +EOF + +sed 's/Password.*/Password = xxx/' $conf/bconsole.conf >> $tmp/bconsole.conf2 + +for i in job pool client clients fileset bvfs1 bvfs2 +do + sed "s/restricted/restricted-$i/" $tmp/bconsole.conf2 > $tmp/bconsole.conf.$i +done diff --git a/regress/tests/console-acl-test b/regress/tests/console-acl-test index 7957d5475..9a0b6d3b4 100755 --- a/regress/tests/console-acl-test +++ b/regress/tests/console-acl-test @@ -23,148 +23,10 @@ sed -f ${outf} $tmp/1 >$scripts/bacula-dir.conf echo "$cwd/build/po" > $tmp/file-list +export JobName HOST tmp conf change_jobname NightlySave $JobName -perl -Mscripts::functions \ - -e "extract_resource('$conf/bacula-dir.conf', 'Client', '$HOST-fd')" \ - > $tmp/1 - -sed "s/$HOST-fd/test1-fd/" $tmp/1 >> $conf/bacula-dir.conf -sed "s/$HOST-fd/test2-fd/" $tmp/1 >> $conf/bacula-dir.conf -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 -Pool { - Name = Test - Pool Type = Backup - Recycle = yes # Bacula can automatically recycle Volumes - AutoPrune = yes # Prune expired volumes - Volume Retention = 365d # one year -} -Console { - Name = restricted - Password = xxx - JobAcl = *all* - ClientAcl = test1-fd, test2-fd - RestoreClientAcl = test-rst-fd - BackupClientAcl = test-bkp-fd - PoolAcl = *all* - CatalogAcl = *all* - FileSetAcl = *all* - CommandAcl = *all* - StorageAcl = *all* - WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2 - DirectoryAcl = *all* - UserIdAcl = *all* -} -Console { - Name = restricted-bvfs1 - Password = xxx - JobAcl = *all* - ClientAcl = test1-fd, test2-fd - RestoreClientAcl = test-rst-fd - PoolAcl = *all* - CatalogAcl = *all* - FileSetAcl = *all* - CommandAcl = *all* - StorageAcl = *all* - WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2 - DirectoryAcl = *all* - UserIdAcl = *all* -} -Console { - Name = restricted-bvfs2 - Password = xxx - JobAcl = *all* - RestoreClientAcl = test-rst-fd - PoolAcl = *all* - CatalogAcl = *all* - FileSetAcl = *all* - CommandAcl = *all* - StorageAcl = *all* - WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2 - DirectoryAcl = *all* - UserIdAcl = *all* -} -Console { - Name = restricted-job - Password = xxx - JobAcl = $JobName - ClientAcl = *all* - PoolAcl = *all* - CatalogAcl = *all* - FileSetAcl = *all* - CommandAcl = *all* - StorageAcl = *all* - WhereAcl = *all* - DirectoryAcl = *all* - UserIdAcl = *all* -} -Console { - Name = restricted-client - Password = xxx - JobAcl = *all* - ClientAcl = $HOST-fd - PoolAcl = *all* - CatalogAcl = *all* - FileSetAcl = *all* - CommandAcl = *all* - StorageAcl = *all* - WhereAcl = *all* - DirectoryAcl = *all* - UserIdAcl = *all* -} -Console { - Name = restricted-clients - Password = xxx - JobAcl = *all* - ClientAcl = $HOST-fd, test1-fd - PoolAcl = *all* - CatalogAcl = *all* - FileSetAcl = *all* - CommandAcl = *all* - StorageAcl = *all* - WhereAcl = *all* - DirectoryAcl = *all* - UserIdAcl = *all* -} -Console { - Name = restricted-pool - Password = xxx - JobAcl = *all* - ClientAcl = *all* - PoolAcl = Test - CatalogAcl = *all* - FileSetAcl = *all* - CommandAcl = *all* - StorageAcl = *all* - WhereAcl = *all* - DirectoryAcl = *all* - UserIdAcl = *all* -} -Console { - Name = restricted-fileset - Password = xxx - JobAcl = *all* - ClientAcl = *all* - PoolAcl = *all* - CatalogAcl = *all* - FileSetAcl = "Full Set" - CommandAcl = *all* - StorageAcl = *all* - WhereAcl = *all* - DirectoryAcl = *all* - UserIdAcl = *all* -} -EOF - -cat <> $tmp/bconsole.conf2 -Console { - Name = restricted - Password = xxx -} -EOF +$rscripts/setup_rconsole start_test @@ -181,13 +43,6 @@ messages quit EOF -sed 's/Password.*/Password = xxx/' $conf/bconsole.conf >> $tmp/bconsole.conf2 - -for i in job pool client clients fileset bvfs1 bvfs2 -do - sed "s/restricted/restricted-$i/" $tmp/bconsole.conf2 > $tmp/bconsole.conf.$i -done - # start the director run_bacula