Skip to content

Commit

Permalink
Merge pull request #377 from bareos/dev/franku/master/config-reload-s…
Browse files Browse the repository at this point in the history
…ystemtests

dev/franku/master/config reload systemtests
  • Loading branch information
pstorz committed Dec 18, 2019
2 parents 2173e6f + 52dd95b commit 1b4462e
Show file tree
Hide file tree
Showing 126 changed files with 1,925 additions and 176 deletions.
3 changes: 1 addition & 2 deletions regress/DartTestfile.txt.in
Expand Up @@ -5,7 +5,6 @@ ADD_TEST(disk:webui-connection-test-tls "@webuidir@/tests/regress/webui-bsock-co
ADD_TEST(disk:python-bareos-connection-test "@regressdir@/tests/python-bareos-connection-test")
ADD_TEST(disk:lan-addr-test "@regressdir@/tests/lan-addr-test")
ADD_TEST(disk:lan-addr-test-passive "@regressdir@/tests/lan-addr-test-passive")
ADD_TEST(disk:reload-test "@regressdir@/tests/reload-test")
#ADD_TEST(disk:always-incremental-test "@regressdir@/tests/always-incremental-test")
ADD_TEST(disk:secure-erase-test "@regressdir@/tests/secure-erase-test")
ADD_TEST(disk:migrate-sd-sd-test "@regressdir@/tests/migration-volume-sd-sd-test")
Expand All @@ -18,7 +17,7 @@ ADD_TEST(disk:allowed-jobcommand-test "@regressdir@/tests/allowed-jobcommand-tes
ADD_TEST(disk:auto-label-test "@regressdir@/tests/auto-label-test")
ADD_TEST(disk:backup-bareos-test "@regressdir@/tests/backup-bareos-test")
ADD_TEST(disk:backup-bareos-passive-test "@regressdir@/tests/backup-bareos-passive-test")
ADD_TEST(disk:backup-bareos-client-initiated-connection-test "@regressdir@/tests/reload-test")
ADD_TEST(disk:backup-bareos-client-initiated-connection-test "@regressdir@/tests/backup-bareos-client-initiated-connection-test")
ADD_TEST(disk:backup-to-null "@regressdir@/tests/backup-to-null")
ADD_TEST(disk:base-job-test "@regressdir@/tests/base-job-test")
ADD_TEST(disk:bconsole-test "@regressdir@/tests/bconsole-test")
Expand Down
170 changes: 0 additions & 170 deletions regress/tests/reload-test

This file was deleted.

8 changes: 8 additions & 0 deletions systemtests/CMakeLists.txt
Expand Up @@ -145,6 +145,7 @@ macro(prepare_test)
# set(DEFAULT_DB_TYPE )
set(archivedir ${current_test_directory}/storage)
set(confdir ${current_test_directory}/etc/bareos)
set(config_directory_dir_additional_test_config ${current_test_directory}/etc/bareos/bareos-dir.d/additional_test_config)

set(logdir ${current_test_directory}/log)
set(tmpdir ${current_test_directory}/tmp)
Expand All @@ -159,6 +160,7 @@ macro(prepare_test)
file(MAKE_DIRECTORY ${logdir})
file(MAKE_DIRECTORY ${tmpdir})
file(MAKE_DIRECTORY ${working_dir})
file(MAKE_DIRECTORY ${config_directory_dir_additional_test_config})
endmacro()

# extract db version from cats.h
Expand Down Expand Up @@ -304,6 +306,12 @@ set(SYSTEM_TESTS
copy-remote-bscan
bconsole-status-client
scheduler-backup-test
reload-works-on-adding-duplicate-job-resource
reload-works-on-unchanged-config
reload-works-on-adding-uncommented-string
reload-works-on-adding-empty-job-resource
reload-works-on-adding-second-director-resource
reload-works-on-adding-client-resource
)

set(SYSTEM_TESTS_DISABLED # initialy empty
Expand Down
2 changes: 2 additions & 0 deletions systemtests/environment.in
Expand Up @@ -15,6 +15,8 @@ export confdir=${conf}
configs=${conf}
BAREOS_CONFIG_DIR=${conf}

export config_directory_dir_additional_test_config=@config_directory_dir_additional_test_config@

working=${current_test_directory}/working
working_dir=${working}
tmp=${current_test_directory}/tmp
Expand Down
3 changes: 2 additions & 1 deletion systemtests/scripts/cleanup
@@ -1,8 +1,8 @@
#!/bin/sh
set -u

. ./environment


rm -rf ${tmp}/*
rm -rf ${logdir}/*.log
rm -rf ${working}/*.bsr ${working}/log*.sd
Expand All @@ -14,6 +14,7 @@ rm -rf ${working}/*.mail
rm -rf ${working}/CLEANUPMARKER
rm -rf ${working}/plugins/*
rm -rf ${archivedir}/*
rm -f ${config_directory_dir_additional_test_config}/*
find . -name "gigaslam.gif" -exec rm -f {} \;
# cleanup old config files
# don't delete mtx-changer.conf (and other files?)
Expand Down
6 changes: 3 additions & 3 deletions systemtests/scripts/functions
Expand Up @@ -736,7 +736,7 @@ end_test()
cat "$tmp/err.log"
fi
ENDDATE="$(date +%R:%S)"
if [ $estat != 0 ] ; then
if [ "$estat" != "0" ] ; then
echo " "
echo " !!!!! $TestName failed!!! $ENDDATE !!!!! "
echo " Status: estat=$estat zombie=$zstat backup=$bstat restore=$rstat diff=$dstat"
Expand All @@ -745,7 +745,7 @@ end_test()
echo " "
exit 1
fi
if [ $zstat != 0 ] ; then
if [ "$zstat" != "0" ] ; then
echo " "
echo " !!!!! $TestName failed!!! $ENDDATA !!!!! "
echo " Status: zombie=$zstat backup=$bstat restore=$rstat diff=$dstat"
Expand All @@ -754,7 +754,7 @@ end_test()
echo " "
exit 1
fi
if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
if [ "$dstat" != "0" -o "$bstat" != "0" -o "$rstat" != "0" ] ; then
echo " "
echo " "
echo " !!!!! $TestName failed!!! $ENDDATE !!!!! "
Expand Down
@@ -0,0 +1,8 @@
Catalog {
Name = MyCatalog
#dbdriver = "@DEFAULT_DB_TYPE@"
dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX"
dbname = "@db_name@"
dbuser = "@db_user@"
dbpassword = "@db_password@"
}
@@ -0,0 +1,7 @@
Client {
Name = bareos-fd
Description = "Client resource of the Director itself."
Address = localhost
Password = "@fd_password@" # password for FileDaemon
FD PORT = @fd_port@
}
@@ -0,0 +1,7 @@
Console {
Name = bareos-mon
Description = "Restricted console used by tray-monitor to get the status of the director."
Password = "@mon_dir_password@"
CommandACL = status, .status
JobACL = *all*
}
@@ -0,0 +1,27 @@
Director { # define myself
Name = bareos-dir
QueryFile = "@scriptdir@/query.sql"
Maximum Concurrent Jobs = 10
Password = "@dir_password@" # Console password
Messages = Daemon
Auditing = yes

# Enable the Heartbeat if you experience connection losses
# (eg. because of your router or firewall configuration).
# Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd.
#
# Heartbeat Interval = 1 min

# remove comment in next line to load dynamic backends from specified directory
Backend Directory = @backenddir@

# remove comment from "Plugin Directory" to load plugins from specified directory.
# if "Plugin Names" is defined, only the specified plugins will be loaded,
# otherwise all director plugins (*-dir.so) from the "Plugin Directory".
#
# Plugin Directory = "@python_plugin_module_src_dir@"
# Plugin Names = ""
Working Directory = "@working_dir@"
Pid Directory = "@piddir@"
DirPort = @dir_port@
}
@@ -0,0 +1,11 @@
FileSet {
Name = "Catalog"
Description = "Backup the catalog dump and Bareos configuration files."
Include {
Options {
signature = MD5
}
File = "@working_dir@/@db_name@.sql" # database dump
File = "@confdir@" # configuration
}
}
@@ -0,0 +1,11 @@
FileSet {
Name = "SelfTest"
Description = "fileset just to backup some files for selftest"
Include {
Options {
Signature = MD5 # calculate md5 checksum per file
}
#File = "@sbindir@"
File=<@tmpdir@/file-list
}
}
@@ -0,0 +1,20 @@
Job {
Name = "BackupCatalog"
Description = "Backup the catalog database (after the nightly save)"
JobDefs = "DefaultJob"
Level = Full
FileSet="Catalog"

# This creates an ASCII copy of the catalog
# Arguments to make_catalog_backup.pl are:
# make_catalog_backup.pl <catalog-name>
RunBeforeJob = "@scriptdir@/make_catalog_backup.pl MyCatalog"

# This deletes the copy of the catalog
RunAfterJob = "@scriptdir@/delete_catalog_backup"

# This sends the bootstrap via mail for disaster recovery.
# Should be sent to another system, please change recipient accordingly
Write Bootstrap = "|@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" @job_email@" # (#01)
Priority = 11 # run after main backup
}
@@ -0,0 +1,11 @@
Job {
Name = "RestoreFiles"
Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..."
Type = Restore
Client = bareos-fd
FileSet = SelfTest
Storage = File
Pool = Incremental
Messages = Standard
Where = @tmp@/bareos-restores
}
@@ -0,0 +1,5 @@
Job {
Name = "backup-bareos-fd"
JobDefs = "DefaultJob"
Client = "bareos-fd"
}

0 comments on commit 1b4462e

Please sign in to comment.