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.
added test for client-initiated-connection
- Loading branch information
1 parent
5dee4e3
commit 324d21d
Showing
2 changed files
with
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/sh | ||
# | ||
# Run a simple backup of the Bareos build directory | ||
# then restore it. | ||
# | ||
TestName="backup-bareos-client-initiated-connection-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 | ||
|
||
dircfg=$conf/bareos-dir.conf | ||
$bperl -e "add_attribute('$dircfg', 'Initiate Connection To Client', 'yes', 'Client')" | ||
$bperl -e "add_attribute('$dircfg', 'Allow Connection From Client', 'no', 'Client')" | ||
|
||
fdcfg=$conf/bareos-fd.conf | ||
$bperl -e "add_attribute('$fdcfg', 'Address', 'localhost', 'Director')" | ||
$bperl -e "add_attribute('$fdcfg', 'Initiate Connection To Director', 'no', 'Director')" | ||
$bperl -e "add_attribute('$fdcfg', 'Allow Connection From Director', 'yes', 'Director')" | ||
|
||
change_jobname BackupClient1 $JobName | ||
start_test | ||
|
||
cat <<END_OF_DATA >$tmp/bconcmds | ||
@$out /dev/null | ||
messages | ||
@$out $tmp/log1.out | ||
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 | ||
|
||
run_bareos | ||
check_for_zombie_jobs storage=File | ||
stop_bareos | ||
|
||
cat <<END_OF_DATA >$tmp/bconcmds | ||
@$out /dev/null | ||
messages | ||
@$out $tmp/log1.out | ||
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 |