]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Add setup_rconsole
authorEric Bollengier <eric@baculasystems.com>
Fri, 19 Nov 2021 20:49:49 +0000 (21:49 +0100)
committerEric Bollengier <eric@baculasystems.com>
Tue, 2 May 2023 07:07:18 +0000 (09:07 +0200)
regress/scripts/setup_rconsole [new file with mode: 0755]
regress/tests/console-acl-test

diff --git a/regress/scripts/setup_rconsole b/regress/scripts/setup_rconsole
new file mode 100755 (executable)
index 0000000..c9e2550
--- /dev/null
@@ -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 <<EOF >> $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 <<EOF >> $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
index 7957d5475f5c7dceaed5ba842bcf0de73645bb75..9a0b6d3b43a91119a3563ca85fc641dcab23be98 100755 (executable)
@@ -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 <<EOF >> $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 <<EOF >> $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