From: Radosław Korzeniewski Date: Thu, 24 Jun 2021 14:12:36 +0000 (+0200) Subject: regress: Update metaplugin protocol tests. X-Git-Tag: Release-11.3.2~445 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa9d293c91ba61b88e16127defb5c0a25fddab37;p=thirdparty%2Fbacula.git regress: Update metaplugin protocol tests. --- diff --git a/bacula/src/plugins/fd/pluginlib/Makefile b/bacula/src/plugins/fd/pluginlib/Makefile index 0bb82c7e4..53d66ed57 100644 --- a/bacula/src/plugins/fd/pluginlib/Makefile +++ b/bacula/src/plugins/fd/pluginlib/Makefile @@ -64,12 +64,6 @@ all: $(COMMONPLUGINOBJ) # $(TESTMETAPLUGINBACKENDOBJ) tests: $(COMMONPLUGINTESTS) -$(UNITTESTSOBJ): - $(MAKE) -C $(LIBDIR) unittests.lo - -$(LIBBACOBJ): - $(MAKE) -C $(LIBDIR) libbac.la - $(LIBBACCFGOBJ): $(MAKE) -C $(LIBDIR) libbaccfg.la diff --git a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp index 99928787b..d445e058e 100644 --- a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp +++ b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp @@ -772,6 +772,7 @@ bRC METAPLUGIN::send_parameters(bpContext *ctx, char *command) "regress_metadata_support", "regress_standard_error_backup", "regress_cancel_backup", + "regress_cancel_restore", NULL, }; #endif diff --git a/bacula/src/plugins/fd/pluginlib/test_metaplugin_backend.c b/bacula/src/plugins/fd/pluginlib/test_metaplugin_backend.c index 616a542a8..f447f4fb1 100644 --- a/bacula/src/plugins/fd/pluginlib/test_metaplugin_backend.c +++ b/bacula/src/plugins/fd/pluginlib/test_metaplugin_backend.c @@ -70,6 +70,7 @@ bool regress_backup_other_file = false; bool regress_metadata_support = false; bool regress_standard_error_backup = false; bool regress_cancel_backup = false; +bool regress_cancel_restore = false; #define BUFLEN 4096 @@ -249,7 +250,14 @@ static bool jobcancelled = false; static void catch_function(int signo) { - LOG("#CANCELLED#"); + if (regress_cancel_backup) { + LOG("#CANCELLED BACKUP#"); + } else + if (regress_cancel_restore) { + LOG("#CANCELLED RESTORE#"); + } else { + LOG("#CANCELLED UNKNOWN#"); + } jobcancelled = true; } @@ -303,6 +311,8 @@ void perform_backup() if (regress_cancel_backup) { LOG("#Cancel wait started..."); + snprintf(buf, BIGBUFLEN, "#Cancel PID: %d", getpid()); + write_plugin('I', buf); while (!jobcancelled) sleep(1); LOG("#Cancel event received, EXIT"); @@ -1025,6 +1035,7 @@ int main(int argc, char** argv) { // "regress_error_backup_abort", // "regress_standard_error_backup", // "regress_cancel_backup", + // "regress_cancel_restore", if (strcmp(buf, "regress_error_plugin_params=1\n") == 0) { regress_error_plugin_params = true; @@ -1076,10 +1087,10 @@ int main(int argc, char** argv) { } if (strcmp(buf, "regress_cancel_backup=1\n") == 0) { regress_cancel_backup = true; - if (signal(SIGUSR1, catch_function) == SIG_ERR){ - LOG("Cannot setup signal handler!"); - exit(EXIT_BACKEND_SIGNAL_HANDLER_ERROR); - } + continue; + } + if (strcmp(buf, "regress_cancel_restore=1\n") == 0) { + regress_cancel_restore = true; continue; } if (sscanf(buf, "listing=%s\n", buf) == 1){ @@ -1091,6 +1102,12 @@ int main(int argc, char** argv) { continue; } } + if (regress_cancel_restore || regress_cancel_backup) { + if (signal(SIGUSR1, catch_function) == SIG_ERR){ + LOG("Cannot setup signal handler!"); + exit(EXIT_BACKEND_SIGNAL_HANDLER_ERROR); + } + } write_plugin('I', "TEST3"); if (!regress_error_plugin_params){ signal_eod(); diff --git a/regress/.gitignore b/regress/.gitignore index 8b2a1efe7..52d956787 100644 --- a/regress/.gitignore +++ b/regress/.gitignore @@ -21,6 +21,7 @@ working2 c diff 1 +.vscode *.out backup-mysql-7.0.sql backup-postgres-5.2.sql @@ -28,7 +29,6 @@ bacula-postgres-7.0.sql bin-5.2.0/ bin-7.0/ do_database_ugrade - scripts/bacula-dir.conf.accurate scripts/bacula-dir.conf.errors scripts/bacula-dir.conf.maxruntime diff --git a/regress/scripts/kubernetes-plugin-test-bacula-dir.conf.in b/regress/scripts/kubernetes-plugin-test-bacula-dir.conf.in index e86f23650..ae33367b9 100644 --- a/regress/scripts/kubernetes-plugin-test-bacula-dir.conf.in +++ b/regress/scripts/kubernetes-plugin-test-bacula-dir.conf.in @@ -123,6 +123,20 @@ FileSet { } } +Job { + Name = "PluginK8STestProtocol7" + JobDefs = "BackupJob" + FileSet="TestPluginK8SSetProtocol7" +} + +FileSet { + Name = "TestPluginK8SSetProtocol7" + Include { + Options { signature=MD5 } + Plugin = "kubernetes: regress_cancel_backup" + } +} + FileSet { Name = "TestPluginKubernetesSet" Include { Options { signature=SHA1 } diff --git a/regress/scripts/metaplugin-protocol-tests.sh b/regress/scripts/metaplugin-protocol-tests.sh index 19a9464bd..4925d6173 100755 --- a/regress/scripts/metaplugin-protocol-tests.sh +++ b/regress/scripts/metaplugin-protocol-tests.sh @@ -9,21 +9,26 @@ # # It is expected to use this test just after a proper regression setup, i.e. # -# TestName="rhv-plugin-protocol-test" -# JobBackup1="PluginRHEVTestProtocol1" -# FilesetBackup1="TestPluginRHEVSetProtocol1" -# JobBackup2="PluginRHEVTestProtocol2" -# JobBackup3="PluginRHEVTestProtocol3" -# JobBackup4="PluginRHEVTestProtocol4" -# Plugin="rhv:" -# . scripts/functions -# scripts/cleanup -# scripts/copy-rhv-plugin-confs -# make -C $src/src/plugins/fd/rhv/src install-test-plugin -# . scripts/metaplugin-protocol-tests.sh +# TestName="kubernetes-plugin-protocol-test" +# JobBackup1="PluginK8STestProtocol1" +# FilesetBackup1="TestPluginK8SSetProtocol1" +# FilesetBackup5="TestPluginK8SSetProtocol5" +# JobBackup2="PluginK8STestProtocol2" +# JobBackup3="PluginK8STestProtocol3" +# JobBackup4="PluginK8STestProtocol4" +# JobBackup5="PluginK8STestProtocol5" +# JobBackup6="PluginK8STestProtocol6" +# JobBackup7="PluginK8STestProtocol7" +# Plugin="kubernetes:" +# . scripts/functions +# scripts/cleanup +# scripts/copy-kubernetes-plugin-confs +# make -C ${src}/src/plugins/fd/kubernetes install-test-plugin +# . scripts/metaplugin-protocol-tests.sh # -if [ "x$JobBackup1" = "x" ] || [ "x$JobBackup2" = "x" ] || [ "x$JobBackup3" = "x" ] || [ "x$JobBackup4" = "x" ] || [ "x$JobBackup5" = "x" ] || [ "x$JobBackup6" = "x" ] || [ "x$FilesetBackup1" = "x" ] +if [ "x$JobBackup1" = "x" ] || [ "x$JobBackup2" = "x" ] || [ "x$JobBackup3" = "x" ] || [ "x$JobBackup4" = "x" ] || [ "x$JobBackup5" = "x" ] || [ "x$JobBackup6" = "x" ] || [ "x$JobBackup7" = "x" ] \ + || [ "x$FilesetBackup1" = "x" ] || [ "x$FilesetBackup5" = "x" ] then echo "You have to setup required variables!" exit 2 @@ -161,6 +166,31 @@ END_OF_DATA run_bconsole +# now cancel a backup job +cat <${cwd}/tmp/bconcmds +@# +@# Backup and cancel event +@# +@output /dev/null +messages +@$out ${cwd}/tmp/log9.out +status client=$CLIENT +setdebug level=500 client=$CLIENT trace=1 +run job=$JobBackup7 yes +@sleep 10 +status client=$CLIENT +messages +cancel all yes +wait +status client=$CLIENT +messages +llist job=$JobBackup7 +@output +quit +END_OF_DATA + +run_bconsole + # now test estimate job cat <${cwd}/tmp/bconcmds @@ -408,14 +438,23 @@ then bstat=$((bstat+64)) fi +RET=$(grep "jobstatus:" ${cwd}/tmp/log9.out | awk '{print $2}') +PID=$(grep -w "#Cancel PID:" ${cwd}/tmp/log9.out | awk '{print $9}') +CANCELLED=$(grep -c -w "#CANCELLED BACKUP#" ${cwd}/working/*${PID}.log) +if [ "x$RET" != "xA" ] || [ "$CANCELLED" -ne 1 ] +then + echo "log9" "$RET" "$CANCELLED" + bstat=$((bstat+128)) +fi + MINFO=$(grep -c M_INFO ${cwd}/tmp/log8.out) MWARNING=$(grep -c M_WARNING ${cwd}/tmp/log8.out) -MSAVED=$(grep -c M_SAVED ${cwd}/tmp/log8.out) +# MSAVED=$(grep -c M_SAVED ${cwd}/tmp/log8.out) MNOTSAVED=$(grep -c M_NOTSAVED ${cwd}/tmp/log8.out) if [ "$MINFO" -ne 1 ] || [ "$MWARNING" -ne 1 ] || [ "$MNOTSAVED" -ne 1 ] then echo "log8msg" "$MINFO" "$MWARNING" "$MNOTSAVED" - bstat=$((bstat+128)) + bstat=$((bstat+256)) fi EFILE1=$(grep -c vm1.iso ${cwd}/tmp/log3.out) diff --git a/regress/scripts/openshift-plugin-test-bacula-dir.conf.in b/regress/scripts/openshift-plugin-test-bacula-dir.conf.in new file mode 100644 index 000000000..c80385ca2 --- /dev/null +++ b/regress/scripts/openshift-plugin-test-bacula-dir.conf.in @@ -0,0 +1,339 @@ +# +# 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 = "BackupJob" + Type = Backup + Pool = Default + Storage = File + Messages = Standard + Priority = 10 + Client=@hostname@-fd + Write Bootstrap = "@working_dir@/%n-%f.bsr" +} + +JobDefs { + Name = "Default" + Type = Backup + Client=@hostname@-fd + Level = Full + Storage = File1 + Messages = Standard + Write Bootstrap = "@working_dir@/%c.bsr" + Pool = Default + SpoolData = yes + Max Run Time = 30min +} + +Job { + Name = "PluginK8STestProtocol1" + JobDefs = "BackupJob" + FileSet="TestPluginK8SSetProtocol1" +} + +FileSet { + Name = "TestPluginK8SSetProtocol1" + Include { + Options { signature=MD5 } + Plugin = "openshift:" + } +} + +Job { + Name = "PluginK8STestProtocol2" + JobDefs = "BackupJob" + FileSet="TestPluginK8SSetProtocol2" +} + +FileSet { + Name = "TestPluginK8SSetProtocol2" + Include { + Options { signature=MD5 } + Plugin = "openshift: regress_backup_plugin_objects" + } +} + +Job { + Name = "PluginK8STestProtocol3" + JobDefs = "BackupJob" + FileSet="TestPluginK8SSetProtocol3" +} + +FileSet { + Name = "TestPluginK8SSetProtocol3" + Include { + Options { signature=MD5 } + Plugin = "openshift:" + Plugin = "openshift: regress_backup_other_file" + } +} + +Job { + Name = "PluginK8STestProtocol4" + JobDefs = "BackupJob" + FileSet="TestPluginK8SSetProtocol4" +} + +FileSet { + Name = "TestPluginK8SSetProtocol4" + Include { + Options { signature=MD5 } + Plugin = "openshift: regress_error_backup_stderr" + } +} + +Job { + Name = "PluginK8STestProtocol5" + JobDefs = "BackupJob" + FileSet="TestPluginK8SSetProtocol5" +} + +FileSet { + Name = "TestPluginK8SSetProtocol5" + Include { + Options { signature=MD5 } + Plugin = "openshift: regress_metadata_support" + } +} + +Job { + Name = "PluginK8STestProtocol6" + JobDefs = "BackupJob" + FileSet="TestPluginK8SSetProtocol6" +} + +FileSet { + Name = "TestPluginK8SSetProtocol6" + Include { + Options { signature=MD5 } + Plugin = "openshift: regress_standard_error_backup" + } +} + +Job { + Name = "PluginK8STestProtocol7" + JobDefs = "BackupJob" + FileSet="TestPluginK8SSetProtocol7" +} + +FileSet { + Name = "TestPluginK8SSetProtocol7" + Include { + Options { signature=MD5 } + Plugin = "openshift: regress_cancel_backup" + } +} + +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 = File + Address = @hostname@ # N.B. Use a fully qualified name here + SDPort = @sdport@ + Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" + Device = FileStorage + Media Type = File +} + +# 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 = 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 + + 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 +} diff --git a/regress/scripts/rhv-plugin-test-bacula-dir.conf.in b/regress/scripts/rhv-plugin-test-bacula-dir.conf.in new file mode 100644 index 000000000..e9f5c2161 --- /dev/null +++ b/regress/scripts/rhv-plugin-test-bacula-dir.conf.in @@ -0,0 +1,529 @@ +# +# Default Bacula Director Configuration file +# +# The only thing that MUST be changed is to add one or more +# file or directory names in the Include directive of the +# FileSet resource. +# +# For Bacula release 1.39 or later +# +# You might also want to change the default email address +# from root to your address. See the "mail" and "operator" +# directives in the Messages resource. +# + +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@" + PluginDirectory = "@sbindir@/plugins" + Maximum Concurrent Jobs = 4 + Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password + Messages = Standard +} + +Job { + Name = "PluginRHEVTest" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet" +} + +JobDefs { + Name = "BackupJob" + Type = Backup + Pool = Default + Storage = File + Messages = Standard + Priority = 10 + Client=@hostname@-fd + Write Bootstrap = "@working_dir@/%n-%f.bsr" +} + +# Standard Restore template, to be changed by Console program +Job { + Name = "RestoreFiles" + Type = Restore + Client=@hostname@-fd + FileSet="Full Set" + Storage = File + Messages = Standard + Pool = Default + Where = @tmpdir@/bacula-restores +} + + +# List of files to be backed up +FileSet { + Name = "Full Set" + Include { + Options { signature=MD5; sparse=yes } + File = /tmp + } +} + +FileSet { + Name = "TestPluginRHEVSet" + Include { + Options { + signature=MD5 + } + Plugin = "rhv: User=test:tester Password=testing server=http://127.0.0.1:8080/auth/v1.0 abort_on_error vm_name=container1" + Plugin = "rhv: User=eric:isthebest Password=hello server=http://127.0.0.1:8080/auth/v1.0 abort_on_error vm_name=container2" + } +} + +Job { + Name = "PluginRHEVTestProtocol1" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSetProtocol1" +} + +FileSet { + Name = "TestPluginRHEVSetProtocol1" + Include { + Options { signature=MD5 } + Plugin = "rhv:" + } +} + +Job { + Name = "PluginRHEVTestProtocol2" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSetProtocol2" +} + +FileSet { + Name = "TestPluginRHEVSetProtocol2" + Include { + Options { signature=MD5 } + Plugin = "rhv: regress_backup_plugin_objects" + } +} + +Job { + Name = "PluginRHEVTestProtocol3" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSetProtocol3" +} + +FileSet { + Name = "TestPluginRHEVSetProtocol3" + Include { + Options { signature=MD5 } + Plugin = "rhv:" + Plugin = "rhv: regress_backup_other_file" + } +} + +Job { + Name = "PluginRHEVTestProtocol4" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSetProtocol4" +} + +FileSet { + Name = "TestPluginRHEVSetProtocol4" + Include { + Options { signature=MD5 } + Plugin = "rhv: regress_error_backup_stderr" + } +} + +Job { + Name = "PluginRHEVTestProtocol5" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSetProtocol5" +} + +FileSet { + Name = "TestPluginRHEVSetProtocol5" + Include { + Options { signature=MD5 } + Plugin = "rhv: regress_metadata_support" + } +} + +Job { + Name = "PluginRHEVTestProtocol6" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSetProtocol6" +} + +FileSet { + Name = "TestPluginRHEVSetProtocol6" + Include { + Options { signature=MD5 } + Plugin = "rhv: regress_standard_error_backup" + } +} + +Job { + Name = "PluginRHEVTestProtocol7" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSetProtocol7" +} + +FileSet { + Name = "TestPluginRHEVSetProtocol7" + Include { + Options { signature=MD5 } + Plugin = "rhv: regress_cancel_backup" + } +} + +Job { + Name = "PluginRHEVTest1" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet1" +} + +FileSet { + Name = "TestPluginRHEVSet1" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ output debug" + } +} + +Job { + Name = "PluginRHEVTest2" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet2" +} + +FileSet { + Name = "TestPluginRHEVSet2" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ include=container1/* output debug" + } +} + +Job { + Name = "PluginRHEVTest3" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet3" +} + +FileSet { + Name = "TestPluginRHEVSet3" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ include=container2/bin/bash output debug" + } +} + +Job { + Name = "PluginRHEVTest4" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet4" +} + +FileSet { + Name = "TestPluginRHEVSet4" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ exclude=container2/* output debug" + } +} + +Job { + Name = "PluginRHEVTest5" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet5" +} + +FileSet { + Name = "TestPluginRHEVSet5" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ vm_name=container1 vm_name=container1 output debug" + } +} + +Job { + Name = "PluginRHEVTest6" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet6" +} + +FileSet { + Name = "TestPluginRHEVSet6" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ vm_name=container1 output debug" + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ vm_name=container3 output debug" + } +} + +Job { + Name = "PluginRHEVTest7" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet7" +} + +FileSet { + Name = "TestPluginRHEVSet7" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ vm_name=container2 output debug" + } +} + +Job { + Name = "PluginRHEVTest8" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet8" +} + +FileSet { + Name = "TestPluginRHEVSet8" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ vm_name=container1 output debug" + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ vm_name=container2 output debug" + } +} + +Job { + Name = "PluginRHEVTest9" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet9" +} + +FileSet { + Name = "TestPluginRHEVSet9" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ vm_name=container11 output debug" + } +} + +Job { + Name = "PluginRHEVTest10" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet10" +} + +FileSet { + Name = "TestPluginRHEVSet10" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ vm_name=container1 output debug" + } +} + +Job { + Name = "PluginRHEVTest11" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet11" +} + +FileSet { + Name = "TestPluginRHEVSet11" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ exclude=container11 output debug" + } +} + +Job { + Name = "PluginRHEVTest12" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet12" +} + +FileSet { + Name = "TestPluginRHEVSet12" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=OTHER password=NOTSET server=@st_auth@ debug output abort_on_error" + } +} + +Job { + Name = "PluginRHEVTest13" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet13" +} + +FileSet { + Name = "TestPluginRHEVSet13" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=OTHER password=NOTSET server=192.168.0.80 debug abort_on_error" + } +} + +Job { + Name = "PluginRHEVTest14" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet14" +} + +FileSet { + Name = "TestPluginRHEVSet14" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ server=@st_auth@ debug abort_on_error" + } +} + +Job { + Name = "PluginRHEVTest15" + JobDefs = "BackupJob" + FileSet="TestPluginRHEVSet15" +} + +FileSet { + Name = "TestPluginRHEVSet15" + Include { + Options { + signature=MD5 + compression=GZIP9 + } + Plugin = "rhv: user=@st_user@ password=@st_key@ server=@st_auth@ include=container11/* abort_on_error output debug" + } +} + +# +# When to do the backups, full backup on first sunday of the month, +# differential (i.e. incremental since full) every other sunday, +# and incremental backups other days +Schedule { + Name = "WeeklyCycle" + Run = Level=Full 1st sun at 1:05 + Run = Level=Differential 2nd-5th sun at 1:05 + Run = Level=Incremental mon-sat at 1:05 +} + +# This schedule does the catalog. It starts after the WeeklyCycle +Schedule { + Name = "WeeklyCycleAfterBackup" + Run = Level=Full sun-sat at 1:10 +} + +# 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 + Maximum Concurrent Jobs = 4 +} + +# Definiton of file storage device +Storage { + Name = File + Address = @hostname@ # N.B. Use a fully qualified name here + SDPort = @sdport@ + Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" + Device = FileStorage + Media Type = File + Maximum Concurrent Jobs = 4 +} + +Storage { + Name = File1 + Address = @hostname@ # N.B. Use a fully qualified name here + SDPort = @sdport@ + Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" + Device = FileStorage1 + Media Type = File1 + Maximum Concurrent Jobs = 4 +} + +# 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 + + 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 +# +# WARNING! the following will create a file that you must cycle from +# time to time as it will grow indefinitely. However, it will +# also keep all your messages if the scroll off the console. +# + 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 +# Label Format = "TEST-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}:${NumVols}" +# Maximum Volume Jobs = 1 +} diff --git a/regress/scripts/swift-plugin-test-bacula-dir.conf.in b/regress/scripts/swift-plugin-test-bacula-dir.conf.in new file mode 100644 index 000000000..c117955be --- /dev/null +++ b/regress/scripts/swift-plugin-test-bacula-dir.conf.in @@ -0,0 +1,339 @@ +# +# 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 = "BackupJob" + Type = Backup + Pool = Default + Storage = File + Messages = Standard + Priority = 10 + Client=@hostname@-fd + Write Bootstrap = "@working_dir@/%n-%f.bsr" +} + +JobDefs { + Name = "Default" + Type = Backup + Client=@hostname@-fd + Level = Full + Storage = File1 + Messages = Standard + Write Bootstrap = "@working_dir@/%c.bsr" + Pool = Default + SpoolData = yes + Max Run Time = 30min +} + +Job { + Name = "PluginSWIFTTestProtocol1" + JobDefs = "BackupJob" + FileSet="TestPluginSWIFTSetProtocol1" +} + +FileSet { + Name = "TestPluginSWIFTSetProtocol1" + Include { + Options { signature=MD5 } + Plugin = "swift:" + } +} + +Job { + Name = "PluginSWIFTTestProtocol2" + JobDefs = "BackupJob" + FileSet="TestPluginSWIFTSetProtocol2" +} + +FileSet { + Name = "TestPluginSWIFTSetProtocol2" + Include { + Options { signature=MD5 } + Plugin = "swift: regress_backup_plugin_objects" + } +} + +Job { + Name = "PluginSWIFTTestProtocol3" + JobDefs = "BackupJob" + FileSet="TestPluginSWIFTSetProtocol3" +} + +FileSet { + Name = "TestPluginSWIFTSetProtocol3" + Include { + Options { signature=MD5 } + Plugin = "swift:" + Plugin = "swift: regress_backup_other_file" + } +} + +Job { + Name = "PluginSWIFTTestProtocol4" + JobDefs = "BackupJob" + FileSet="TestPluginSWIFTSetProtocol4" +} + +FileSet { + Name = "TestPluginSWIFTSetProtocol4" + Include { + Options { signature=MD5 } + Plugin = "swift: regress_error_backup_stderr" + } +} + +Job { + Name = "PluginSWIFTTestProtocol5" + JobDefs = "BackupJob" + FileSet="TestPluginSWIFTSetProtocol5" +} + +FileSet { + Name = "TestPluginSWIFTSetProtocol5" + Include { + Options { signature=MD5 } + Plugin = "swift: regress_metadata_support" + } +} + +Job { + Name = "PluginSWIFTTestProtocol6" + JobDefs = "BackupJob" + FileSet="TestPluginSWIFTSetProtocol6" +} + +FileSet { + Name = "TestPluginSWIFTSetProtocol6" + Include { + Options { signature=MD5 } + Plugin = "swift: regress_standard_error_backup" + } +} + +Job { + Name = "PluginSWIFTTestProtocol7" + JobDefs = "BackupJob" + FileSet="TestPluginSWIFTSetProtocol7" +} + +FileSet { + Name = "TestPluginSWIFTSetProtocol7" + Include { + Options { signature=MD5 } + Plugin = "swift: regress_cancel_backup" + } +} + +FileSet { + Name = "TestPluginSWIFTSet" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@" + } +} +Job { + Name = "PluginSWIFTTest" + JobDefs = Default + FileSet = TestPluginSWIFTSet +} + +FileSet { + Name = "TestPluginSWIFTSet1" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ namespace=plugintest" + } +} +Job { + Name = "PluginSWIFTTest1" + JobDefs = Default + FileSet = TestPluginSWIFTSet1 +} + +FileSet { + Name = "TestPluginSWIFTSet2" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ persistentvolume=@PV1@" + } +} +Job { + Name = "PluginSWIFTTest2" + JobDefs = Default + FileSet = TestPluginSWIFTSet2 +} + +FileSet { + Name = "TestPluginSWIFTSet3" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ namespace=plugintest persistentvolume=@PV1@" + } +} +Job { + Name = "PluginSWIFTTest3" + JobDefs = Default + FileSet = TestPluginSWIFTSet3 +} + +FileSet { + Name = "TestPluginSWIFTSet11" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ namespace=nonexistent" + } +} +Job { + Name = "PluginSWIFTTest11" + JobDefs = Default + FileSet = TestPluginSWIFTSet11 +} + +FileSet { + Name = "TestPluginSWIFTSet12" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ persistentvolume=nonexistent" + } +} +Job { + Name = "PluginSWIFTTest12" + JobDefs = Default + FileSet = TestPluginSWIFTSet12 +} + +FileSet { + Name = "TestPluginSWIFTSet13" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ persistentvolume=@PV1@ invalidoption" + } +} +Job { + Name = "PluginSWIFTTest13" + JobDefs = Default + FileSet = TestPluginSWIFTSet13 +} + +FileSet { + Name = "TestPluginSWIFTSet21" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ namespace=nonexistent abort_on_error" + } +} +Job { + Name = "PluginSWIFTTest21" + JobDefs = Default + FileSet = TestPluginSWIFTSet21 +} + +FileSet { + Name = "TestPluginSWIFTSet22" + Include { Options { signature=SHA1 } + Plugin = "@LPLUG@ persistentvolume=nonexistent abort_on_error" + } +} +Job { + Name = "PluginSWIFTTest22" + JobDefs = Default + FileSet = TestPluginSWIFTSet22 +} + + +# 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 = File + Address = @hostname@ # N.B. Use a fully qualified name here + SDPort = @sdport@ + Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" + Device = FileStorage + Media Type = File +} + +# 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 = 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 + + 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 +} diff --git a/regress/tests/kubernetes-plugin-protocol-test b/regress/tests/kubernetes-plugin-protocol-test index d42b4d576..f383537b0 100755 --- a/regress/tests/kubernetes-plugin-protocol-test +++ b/regress/tests/kubernetes-plugin-protocol-test @@ -12,6 +12,7 @@ JobBackup3="PluginK8STestProtocol3" JobBackup4="PluginK8STestProtocol4" JobBackup5="PluginK8STestProtocol5" JobBackup6="PluginK8STestProtocol6" +JobBackup7="PluginK8STestProtocol7" Plugin="kubernetes:" . scripts/functions diff --git a/regress/tests/openshift-plugin-protocol-test b/regress/tests/openshift-plugin-protocol-test new file mode 100755 index 000000000..61c1834c6 --- /dev/null +++ b/regress/tests/openshift-plugin-protocol-test @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Copyright (C) 2020 Radosław Korzeniewski +# License: BSD 2-Clause; see file LICENSE-FOSS +# + +TestName="openshift-plugin-protocol-test" +JobBackup1="PluginK8STestProtocol1" +FilesetBackup1="TestPluginK8SSetProtocol1" +FilesetBackup5="TestPluginK8SSetProtocol5" +JobBackup2="PluginK8STestProtocol2" +JobBackup3="PluginK8STestProtocol3" +JobBackup4="PluginK8STestProtocol4" +JobBackup5="PluginK8STestProtocol5" +JobBackup6="PluginK8STestProtocol6" +JobBackup7="PluginK8STestProtocol7" +Plugin="openshift:" + +. scripts/functions + +# export debug=1 + +scripts/cleanup +scripts/copy-openshift-plugin-confs +make -C ${src}/src/plugins/fd/openshift install-test-plugin + +. scripts/metaplugin-protocol-tests.sh diff --git a/regress/tests/rhv-plugin-protocol-test b/regress/tests/rhv-plugin-protocol-test new file mode 100755 index 000000000..b534be655 --- /dev/null +++ b/regress/tests/rhv-plugin-protocol-test @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Copyright (C) 2020 Radosław Korzeniewski +# License: BSD 2-Clause; see file LICENSE-FOSS +# + +TestName="rhv-plugin-protocol-test" +JobBackup1="PluginRHEVTestProtocol1" +FilesetBackup1="TestPluginRHEVSetProtocol1" +JobBackup2="PluginRHEVTestProtocol2" +JobBackup3="PluginRHEVTestProtocol3" +JobBackup4="PluginRHEVTestProtocol4" +JobBackup5="PluginRHEVTestProtocol5" +JobBackup6="PluginRHEVTestProtocol6" +JobBackup7="PluginRHEVTestProtocol7" +Plugin="rhv:" + +. scripts/functions + +# export debug=1 + +scripts/cleanup +scripts/copy-rhv-plugin-confs +make -C ${src}/src/plugins/fd/rhv/src install-test-plugin + +. scripts/metaplugin-protocol-tests.sh diff --git a/regress/tests/swift-plugin-protocol-test b/regress/tests/swift-plugin-protocol-test new file mode 100755 index 000000000..a398aaa13 --- /dev/null +++ b/regress/tests/swift-plugin-protocol-test @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Copyright (C) 2020 Radosław Korzeniewski +# License: BSD 2-Clause; see file LICENSE-FOSS +# + +TestName="swift-plugin-protocol-test" +JobBackup1="PluginSWIFTTestProtocol1" +FilesetBackup1="TestPluginSWIFTSetProtocol1" +JobBackup2="PluginSWIFTTestProtocol2" +JobBackup3="PluginSWIFTTestProtocol3" +JobBackup4="PluginSWIFTTestProtocol4" +JobBackup5="PluginSWIFTTestProtocol5" +JobBackup6="PluginSWIFTTestProtocol6" +JobBackup7="PluginSWIFTTestProtocol7" +Plugin="swift:" + +. scripts/functions + +# export debug=1 + +scripts/cleanup +scripts/copy-swift-plugin-confs +make -C $src/src/plugins/fd/swift/src install-test-plugin + +. scripts/metaplugin-protocol-tests.sh