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

Commit

Permalink
Browse files Browse the repository at this point in the history
added regression test for passive mode
Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
pstorz authored and Marco van Wieringen committed Jul 4, 2013
1 parent 9d3f344 commit 5884856
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 0 deletions.
1 change: 1 addition & 0 deletions DartTestfile.txt.in
Expand Up @@ -5,6 +5,7 @@ ADD_TEST(disk:accurate-test "@regressdir@/tests/accurate-test")
ADD_TEST(disk:allowcompress-test "@regressdir@/tests/allowcompress-test")
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-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
1 change: 1 addition & 0 deletions all-dev-tests
Expand Up @@ -13,6 +13,7 @@ rm -f dumps/*
./run tests/allowcompress-test
./run tests/auto-label-test
./run tests/backup-bareos-test
./run tests/backup-bareos-passive-test
./run tests/base-job-test
./run tests/bextract-test
./run tests/bconsole-test
Expand Down
1 change: 1 addition & 0 deletions all-disk-tests
Expand Up @@ -13,6 +13,7 @@ rm -f dumps/*
./run tests/accurate-test
./run tests/auto-label-test
./run tests/backup-bareos-test
./run tests/backup-bareos-passive-test
./run tests/bextract-test
./run tests/bconsole-test
./run tests/base-job-test
Expand Down
113 changes: 113 additions & 0 deletions tests/backup-bareos-passive-test
@@ -0,0 +1,113 @@
#!/bin/sh
#
# Run a simple backup of the Bareos build directory
# then restore it.
#
TestName="backup-bareos-passive-test"
JobName=backup
. scripts/functions

scripts/cleanup
scripts/copy-confs

#
# Zap out any schedule in default conf file so that
# it doesn't start during our test
#
outf="$tmp/sed_tmp"
echo "s% Schedule =%# Schedule =%g" >${outf}
cp $scripts/bareos-dir.conf $tmp/1
sed -f ${outf} $tmp/1 >$scripts/bareos-dir.conf


# set passive to yes:
cp $scripts/bareos-dir.conf $tmp/1
echo 's#^Client {#Client { \n passive = yes \n#g' >${outf}
sed -f ${outf} $tmp/1 >$scripts/bareos-dir.conf

# set compatible to no in fd.conf
cp $scripts/bareos-fd.conf $tmp/1
echo 's#^FileDaemon {#FileDaemon { \n compatible = no \n#g' >${outf}
sed -f ${outf} $tmp/1 >$scripts/bareos-fd.conf




change_jobname BackupClient1 $JobName
start_test

cat <<END_OF_DATA >$tmp/bconcmds
@$out /dev/null
messages
@$out $tmp/log1.out
setdebug level=100 storage=File
label volume=TestVolume001 storage=File pool=File
run job=$JobName yes
status storage=File
status storage=File
status storage=File
status storage=File
status storage=File
status storage=File
@sleep 1
status storage=File
status storage=File
status storage=File
status storage=File
status storage=File
@sleep 1
status storage=File
status storage=File
status storage=File
status storage=File
status storage=File
wait
messages
@#
@# now do a restore
@#
@$out $tmp/log2.out
restore where=$tmp/bareos-restores select all done
yes
wait
messages
quit
END_OF_DATA

run_bareos
check_for_zombie_jobs storage=File
stop_bareos

cat <<END_OF_DATA >$tmp/bconcmds
@$out /dev/null
messages
@$out $tmp/log1.out
@#setdebug level=100 storage=File
run job=$JobName yes
wait
messages
@#
@# now do a restore
@#
@$out $tmp/log2.out
restore where=$tmp/bareos-restores select all done
yes
wait
messages
quit
END_OF_DATA

#
# Now do a second backup after making a few changes
#
touch ${cwd}/build/src/dird/*.c
echo "test test" > ${cwd}/build/src/dird/xxx
#

run_bareos
check_for_zombie_jobs storage=File
stop_bareos

check_two_logs
check_restore_diff
end_test

0 comments on commit 5884856

Please sign in to comment.