This repository has been archived by the owner on Mar 19, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
4 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |