Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
make regression work with new config files
Browse files Browse the repository at this point in the history
Before, "make install" has delivered a preconfigured config file.
However, as newer bareos versions work with configuration directories,
we copied the old bareos-*.conf to scripts.
However, it seams regression expects them somehow different.
Not sure what exactly. Anyhow, we make it work
and strip down bareos-dir.conf.
  • Loading branch information
joergsteffens committed Jul 12, 2016
1 parent 8364241 commit 41256fa
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 102 deletions.
3 changes: 0 additions & 3 deletions Makefile
Expand Up @@ -34,9 +34,6 @@ bareos: all
sed:
echo "Doing: scripts/do_sed"
scripts/do_sed
echo "adapting default fileset for regression tests"
cp bin/bareos-dir.conf bin/bareos-dir.conf.orig
sed 's#File.*/$$#File = /usr/sbin#g' < bin/bareos-dir.conf.orig > bin/bareos-dir.conf

# Run all disk tests
test:
Expand Down
2 changes: 2 additions & 0 deletions README
Expand Up @@ -16,6 +16,8 @@ To set it up, create your personal configuration file, by
copying prototype.conf to config or simply editing prototype.conf
directly then copying it to the file config.

cp prototype.conf config

You must end up with a file named config in the main regress
directory that has all the specifications that correspond to
your system.
Expand Down
5 changes: 3 additions & 2 deletions configs/scsi-crypto-test/bareos-dir.conf.scsi-crypto-test.in
Expand Up @@ -239,8 +239,9 @@ Storage {
# Generic catalog service
Catalog {
Name = MyCatalog

dbname = regress; user = root; password = ""
dbname = "@db_name@"
dbuser = "@db_user@"
dbpassword = "@db_password@"
}

# Reasonable message delivery -- send most everything to email address
Expand Down
Expand Up @@ -82,7 +82,9 @@ Storage {
Catalog {
Name = MyCatalog

dbname = regress; user = root; password = ""
dbname = @db_name@
dbuser = "@db_user@"
dbpassword = "@db_password@"
}

Messages {
Expand Down
99 changes: 13 additions & 86 deletions scripts/bareos-dir.conf.in
@@ -1,27 +1,4 @@
#
# Default Bareos Director configuration file for disk-only backup
#
# Each configuration item has a reference number that shows
# where this property can be changed in the configuration file.
# Search for the number to find the correct line.
#
# You have to configure the following accoring to your environment:
#
# (#01)Email Address for bareos disaster recovery.
# Specify a mailaddress outside of your backupserver.
# There will be one mail per day.
#
# (#02)Email Address for bareos reports. (Mail Command)
# This mail address will recieve a report about each backup job.
# It will be sent after the backupjob is complete.
# Has to be configured twice ("Standard" and "Daemon" Message Ressources)
#
# (#03)Email Address for bareos operator. (Operator Command)
# This mail address will recieve a mail immediately when the
# bareos system needs an operator intervention.
# May be the same address as in (#02)
#
#
# This disk-only setup stores all data into @archivedir@
#
# The preconfigured backup scheme is as follows:
Expand All @@ -48,15 +25,9 @@ Director { # define myself
QueryFile = "@scriptdir@/query.sql"
Maximum Concurrent Jobs = 10
Password = "@dir_password@" # Console password
Messages = Daemon
Messages = Standard
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 = 1m

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

Expand All @@ -73,8 +44,7 @@ JobDefs {
Type = Backup
Level = Incremental
Client = @basename@-fd
FileSet = "SelfTest" # selftest fileset (#13)
Schedule = "WeeklyCycle"
FileSet = "SelfTest"
Storage = File
Messages = Standard
Pool = Incremental
Expand Down Expand Up @@ -132,26 +102,6 @@ Job {
Where = /tmp/bareos-restores
}


FileSet {
Name = "Windows All Drives"
Enable VSS = yes
Include {
Options {
Signature = MD5
Drive Type = fixed
IgnoreCase = yes
WildFile = "[A-Z]:/pagefile.sys"
WildDir = "[A-Z]:/RECYCLER"
WildDir = "[A-Z]:/$RECYCLE.BIN"
WildDir = "[A-Z]:/System Volume Information"
Exclude = yes
}
File = /
}
}


FileSet {
Name = "Linux All"
Include {
Expand Down Expand Up @@ -180,32 +130,28 @@ FileSet {
File = /.journal
File = /.fsck
}
}

FileSet {
Name = FS_TESTJOB1
Include {
Options {
Signature = MD5
}
File=<@tmpdir@/file-list
}
}

# fileset just to backup some files for selftest
FileSet {
Name = "SelfTest"
Include {
Options {
Signature = MD5 # calculate md5 checksum per file
Signature = MD5
}
File = "@sbindir@"
File = "@builddir@"
}
}

Schedule {
Name = "WeeklyCycle"
Run = Full 1st sat at 21:00 # (#04)
Run = Differential 2nd-5th sat at 21:00 # (#07)
Run = Incremental mon-fri at 21:00 # (#10)
}

# This schedule does the catalog. It starts after the WeeklyCycle
Schedule {
Name = "WeeklyCycleAfterBackup"
Run = Full mon-fri at 21:10
}

# This is the backup of the catalog
FileSet {
Expand Down Expand Up @@ -243,8 +189,6 @@ Storage {
#
Catalog {
Name = MyCatalog
# Uncomment the following lines if you want the dbi driver
@uncomment_dbi@ dbdriver = "dbi:@DEFAULT_DB_TYPE@"; dbaddress = 127.0.0.1; dbport = @db_port@
#dbdriver = "@DEFAULT_DB_TYPE@"
dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX"
dbname = "@db_name@"
Expand All @@ -257,27 +201,10 @@ Catalog {
#
Messages {
Name = Standard
mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r"
operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r"
mail = @job_email@ = all, !skipped, !audit # (#02)
operator = @job_email@ = mount # (#03)
console = all, !skipped, !saved, !audit
append = "@logdir@/bareos.log" = all, !skipped, !audit
catalog = all, !audit
}

#
# Message delivery for daemon messages (no job).
#
Messages {
Name = Daemon
mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r"
mail = @job_email@ = all, !skipped, !audit # (#02)
console = all, !skipped, !saved, !audit
append = "@logdir@/bareos.log" = all, !skipped, !audit
append = "@logdir@/bareos-audit.log" = audit
}

#
# Full Pool definition
#
Expand Down
10 changes: 8 additions & 2 deletions scripts/create_sed
Expand Up @@ -32,9 +32,13 @@ dbengine=`echo ${WHICHDB} | sed -e 's/--with-//' -e 's/=.*//'`
bversion=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/include/version.h`
bdate=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/include/version.h`
builddir="${src}"
hostname="${hostname:-$HOST}"

# Create sed command script
echo "s%@sbindir@%${bin}%g" >${out}
>${out}
echo "s%@archivedir@%${tmp}%g" >>${out}
echo "s%@bindir@%${bin}%g" >>${out}
echo "s%@sbindir@%${bin}%g" >>${out}
echo "s%@scriptdir@%${scripts}%g" >>${out}
echo "s%@working_dir@%${working}%g" >>${out}
echo "s%@piddir@%${working}%g" >>${out}
Expand All @@ -44,11 +48,11 @@ echo "s%@autochanger@%${AUTOCHANGER}%g" >>${out}
echo "s%@changer_script@%${AUTOCHANGER_SCRIPT}%g" >>${out}
echo "s%@tmpdir@%${tmp}%g" >>${out}
echo "s%@logdir@%${tmp}%g" >>${out}
echo "s%@hostname@%${HOST}%g" >>${out}
echo "s%@changer_path@%${AUTOCHANGER_PATH}%g" >>${out}
echo "s%@tape_drive1@%${TAPE_DRIVE1}%g" >>${out}
echo "s%@smtp_host@%${SMTP_HOST}%g" >>${out}
echo "s%@disk_drive@%${tmp}/disk-changer%g" >>${out}
echo "s%@basename@%${HOST}%g" >>${out}
echo "s%@hostname@%${hostname}%g" >>${out}
echo "s%@hostname1@%${hostname1}%g" >>${out}
echo "s%@hostname2@%${hostname2}%g" >>${out}
Expand All @@ -61,6 +65,7 @@ echo "s%@hostname1_password@%${hostname1_password}%g" >>${out}
echo "s%@hostname2_password@%${hostname2_password}%g" >>${out}
echo "s%@hostname3_password@%${hostname3_password}%g" >>${out}
echo "s%@dirport@%${dirport}%g" >>${out}
echo "s%@dir_port@%${dirport}%g" >>${out}
echo "s%@sdport@%${sdport}%g" >>${out}
echo "s%@sdport2@%${sdport2}%g" >>${out}
echo "s%@fdport@%${fdport}%g" >>${out}
Expand All @@ -84,3 +89,4 @@ echo "s%@db_password@%${db_password}%g" >>${out}
echo "s%@builddir@%${builddir}%g" >>${out}
echo "s%@BUILD_DIR@%${builddir}%g" >>${out}
echo "s%@confdir@%${scripts}%g" >>${out}
echo "s%@uncomment_dbi@%#%g" >>${out}
5 changes: 0 additions & 5 deletions scripts/setup
Expand Up @@ -154,8 +154,3 @@ cd ${cwd}
#
bin/bareos start
bin/bareos stop

#
# Save Bareos default conf files for later use
#
cp -f bin/*.conf scripts
7 changes: 4 additions & 3 deletions tests/acl-xattr-test
Expand Up @@ -100,6 +100,7 @@ rm -rf $d
mkdir -p $d
mkdir -p $d/acl-dir
cp ${cwd}/bin/bconsole $d
ls -la $d

case `uname -s` in
Linux)
Expand Down Expand Up @@ -208,7 +209,7 @@ cat <<END_OF_DATA >${cwd}/tmp/bconcmds
@$out /dev/null
messages
@$out ${cwd}/tmp/log1.out
label volume=TestVolume001 storage=File1 pool=Full slot=1 drive=0
label volume=TestVolume001 storage=File pool=Full slot=1 drive=0
@#setdebug level=400 trace=1 client
@#setdebug level=300 trace=1 director
@#setdebug level=300 trace=1 storage=File1
Expand All @@ -219,15 +220,15 @@ messages
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
restore where=${cwd}/tmp/bareos-restores select all done
restore restorejob=RestoreFiles where=${cwd}/tmp/bareos-restores select all done
yes
wait
messages
quit
END_OF_DATA

run_bareos
check_for_zombie_jobs storage=File1
check_for_zombie_jobs storage=File
stop_bareos

rd=$cwd/tmp/bareos-restores$cwd/build/acl
Expand Down

0 comments on commit 41256fa

Please sign in to comment.