From: Radoslaw Korzeniewski Date: Fri, 4 Sep 2020 11:37:29 +0000 (+0200) Subject: BEE Backport regress/scripts/copy-kubernetes-plugin-confs X-Git-Tag: Release-11.3.2~1096 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=578929dec9dcd6341059d1f332fee7aabe308521;p=thirdparty%2Fbacula.git BEE Backport regress/scripts/copy-kubernetes-plugin-confs This commit is the result of the squash of the following main commits: Author: Radosław Korzeniewski Date: Tue Nov 19 19:47:35 2019 +0100 k8s: Update regression tests preparation. Author: Eric Bollengier Date: Wed Oct 23 14:11:49 2019 +0200 regress: Add regress script for k8s --- diff --git a/regress/scripts/collect-bacula-dir.conf.in b/regress/scripts/collect-bacula-dir.conf.in old mode 100755 new mode 100644 diff --git a/regress/scripts/copy-kubernetes-plugin-confs b/regress/scripts/copy-kubernetes-plugin-confs new file mode 100755 index 000000000..7fb5b163d --- /dev/null +++ b/regress/scripts/copy-kubernetes-plugin-confs @@ -0,0 +1,10 @@ +#!/bin/sh +cp -f ${rscripts}/kubernetes-plugin-test-bacula-dir.conf ${conf}/bacula-dir.conf +cp -f ${rscripts}/test-bacula-sd.conf ${conf}/bacula-sd.conf +cp -f ${rscripts}/test-bacula-fd.conf ${conf}/bacula-fd.conf +cp -f ${rscripts}/test-console.conf ${conf}/bconsole.conf +cp -f ${rscripts}/test-console.conf ${conf}/bat.conf +cp -f ${rscripts}/k8s_backend ${bin}/k8s_backend +chmod +x ${bin}/k8s_backend + +scripts/set_tape_options diff --git a/regress/scripts/kubernetes-plugin-test-bacula-dir.conf.in b/regress/scripts/kubernetes-plugin-test-bacula-dir.conf.in new file mode 100644 index 000000000..11d1d3b5a --- /dev/null +++ b/regress/scripts/kubernetes-plugin-test-bacula-dir.conf.in @@ -0,0 +1,240 @@ +# +# Kubernetes Plugin Bacula Director Configuration file +# + +Director { # define myself + Name = @hostname@-dir + DIRPort = @dirport@ # where we listen for UA connections + QueryFile = "@scriptdir@/query.sql" + WorkingDirectory = "@working_dir@" + PidDirectory = "@piddir@" + SubSysDirectory = "@subsysdir@" + Maximum Concurrent Jobs = 1 + Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password + Messages = Standard +} + + +JobDefs { + Name = "Default" + Type = Backup + Client=@hostname@-fd + Level = Full + Storage = File1 + Messages = Standard + Write Bootstrap = "@working_dir@/%c.bsr" + Pool = SmallVols + SpoolData = yes + Max Run Time = 30min +} + +FileSet { + Name = "TestPluginKubernetesSet" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@" + } +} +Job { + Name = "PluginKubernetesTest" + JobDefs = Default + FileSet = TestPluginKubernetesSet +} + +FileSet { + Name = "TestPluginKubernetesSet1" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ namespace=plugintest" + } +} +Job { + Name = "PluginKubernetesTest1" + JobDefs = Default + FileSet = TestPluginKubernetesSet1 +} + +FileSet { + Name = "TestPluginKubernetesSet2" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ persistentvolume=@PV1@" + } +} +Job { + Name = "PluginKubernetesTest2" + JobDefs = Default + FileSet = TestPluginKubernetesSet2 +} + +FileSet { + Name = "TestPluginKubernetesSet3" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ namespace=plugintest persistentvolume=@PV1@" + } +} +Job { + Name = "PluginKubernetesTest3" + JobDefs = Default + FileSet = TestPluginKubernetesSet3 +} + +FileSet { + Name = "TestPluginKubernetesSet11" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ namespace=nonexistent" + } +} +Job { + Name = "PluginKubernetesTest11" + JobDefs = Default + FileSet = TestPluginKubernetesSet11 +} + +FileSet { + Name = "TestPluginKubernetesSet12" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ persistentvolume=nonexistent" + } +} +Job { + Name = "PluginKubernetesTest12" + JobDefs = Default + FileSet = TestPluginKubernetesSet12 +} + +FileSet { + Name = "TestPluginKubernetesSet13" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ persistentvolume=@PV1@ invalidoption" + } +} +Job { + Name = "PluginKubernetesTest13" + JobDefs = Default + FileSet = TestPluginKubernetesSet13 +} + +FileSet { + Name = "TestPluginKubernetesSet21" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ namespace=nonexistent abort_on_error" + } +} +Job { + Name = "PluginKubernetesTest21" + JobDefs = Default + FileSet = TestPluginKubernetesSet21 +} + +FileSet { + Name = "TestPluginKubernetesSet22" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ persistentvolume=nonexistent abort_on_error" + } +} +Job { + Name = "PluginKubernetesTest22" + JobDefs = Default + FileSet = TestPluginKubernetesSet22 +} + + +# List of files to be backed up +FileSet { + Name = "Full Set" + Include { Options { signature=SHA1 } + File =<@tmpdir@/file-list + } +} + +# Client (File Services) to backup +Client { + Name = @hostname@-fd + Address = @hostname@ + FDPort = @fdport@ + Catalog = MyCatalog + Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc" # password for FileDaemon + File Retention = 30d # 30 days + Job Retention = 180d # six months + AutoPrune = yes # Prune expired Jobs/Files +} + +# Definiton of file storage device +Storage { + Name = File1 + Address = @hostname@ # N.B. Use a fully qualified name here + SDPort = @sdport@ + Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" + Device = FileStorage + Media Type = File +} + +Storage { + Name = File2 + Address = @hostname@ # N.B. Use a fully qualified name here + SDPort = @sdport@ + Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" + Device = FileStorage1 + Media Type = File1 +} + +# Standard Restore template, to be changed by Console program +Job { + Name = "RestoreFiles" + Type = Restore + Client=@hostname@-fd + FileSet="Full Set" + Storage = File1 + Messages = Standard + Pool = Default + Where = @tmpdir@/bacula-restores + Max Run Time = 30min +} + +# Generic catalog service +Catalog { + Name = MyCatalog + @libdbi@ + dbname = @db_name@; user = @db_user@; password = "@db_password@" +} + +# Reasonable message delivery -- send most everything to email address +# and to the console +Messages { + Name = Standard + mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula regression\) %r\" -s \"Regression: %t %e of %c %l\" %r" + operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula regression\) %r\" -s \"Regression: Intervention needed for %j\" %r" +# MailOnError = @job_email@ = all, !terminate +# operator = @job_email@ = mount + console = all, !skipped, !terminate + + append = "@working_dir@/log" = all, !skipped + catalog = all, !skipped +} + +Messages { + Name = NoEmail + mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula regression\) %r\" -s \"Regression: %t %e of %c %l\" %r" + console = all, !skipped, !terminate, !restored + append = "@working_dir@/log" = all, !skipped + catalog = all, !skipped +} + + +# Default pool definition +Pool { + Name = Default + Pool Type = Backup + Recycle = yes # Bacula can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365d # one year +} + +Pool { + Name = SmallVols + Pool Type = Backup + Recycle = yes # Bacula can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365d # one year + Maximum Volumes = 10 + MaximumVolumeBytes = 10M + LabelFormat = Small +}