From 239a62316dd0634d7661210a8626d9104fe4ced8 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 17 Jun 2010 15:16:47 +0200 Subject: [PATCH] regress: add new tests --- regress/tests/multi-drive-group-test | 88 ++++++++++++++++++++++++++++ regress/tests/multi-drive-test | 71 ++++++++++++++++++++++ regress/tests/multi-drive1-test | 79 +++++++++++++++++++++++++ regress/tests/win32-systemstate-test | 58 ++++++++++++++++++ 4 files changed, 296 insertions(+) create mode 100755 regress/tests/multi-drive-group-test create mode 100755 regress/tests/multi-drive-test create mode 100755 regress/tests/multi-drive1-test create mode 100644 regress/tests/win32-systemstate-test diff --git a/regress/tests/multi-drive-group-test b/regress/tests/multi-drive-group-test new file mode 100755 index 0000000000..22cb4bee91 --- /dev/null +++ b/regress/tests/multi-drive-group-test @@ -0,0 +1,88 @@ +#!/bin/sh +# +# This script is used to test multiple devices grouped in +# the director configuration +# +# +TestName="multi-drive-group-test" +JobName=backup +. scripts/functions + +scripts/cleanup +scripts/copy-2disk-confs +scripts/prepare-disk-changer + +echo "s/signature=MD5/signature=MD5; readfifo=yes/" > $tmp/1 +echo "s/FileStorage/FileStorage; Device=FileStorage2; Device=FileStorage3; Device=FileStorage4/" >> $tmp/1 +sed -f $tmp/1 $conf/bacula-dir.conf > $tmp/2 +# Allow auto label +$bperl -e 'add_attribute("$tmp/2", "Label Format", "Vol", "Pool", "Default")' +$bperl -e 'add_attribute("$tmp/2", "Action On Purge", "Truncate", "Pool", "Default")' +$bperl -e 'add_attribute("$tmp/2", "Label Format", "Vol", "Pool", "Inc")' +$bperl -e 'add_attribute("$conf/bacula-sd.conf", "Label Media", "yes", "Device")' + +# set this to do round robbin +#$bperl -e 'set_maximum_concurrent_jobs("$conf/bacula-sd.conf", 1, "Device")' + +$bperl -e 'add_attribute("$tmp/2", "Prefer Mounted Volumes", "no", "Job")'; + +# Disable spooling for each job +$bperl -e 'add_attribute("$tmp/2", "SpoolData", "no", "Job")' +cp $tmp/2 $conf/bacula-dir.conf + +$bperl -e 'extract_resource("$conf/bacula-sd.conf", "Device", "FileStorage")' > $tmp/2 +for i in 2 3 4; do + sed "s/FileStorage/FileStorage$i/" $tmp/2 >> $conf/bacula-sd.conf +done + +disable_pluguins + +echo "$cwd/build" >${cwd}/tmp/file-list +echo "$tmp/fifo" >>${cwd}/tmp/file-list + +mkfifo $tmp/fifo +(sleep 15 > $tmp/fifo + sleep 3 > $tmp/fifo +)& + +change_jobname $JobName +start_test + +# test with autolabel +# +# +# Write out bconsole commands +cat <${cwd}/tmp/bconcmds +@out /dev/null +messages +@$out ${cwd}/tmp/log1.out +run level=full job=backup storage=File pool=Default yes +run level=full job=backup storage=File pool=Default yes +run level=full job=backup storage=File pool=Default yes +run level=full job=backup storage=File pool=Inc yes +run level=full job=backup storage=File pool=Inc yes +run level=full job=backup storage=File pool=Default yes +run level=full job=backup storage=File pool=Default yes +run level=full job=backup storage=File pool=Default yes +run level=full job=backup storage=File pool=Default yes +@sleep 3 +messages +status storage=File +status dir +messages +wait +messages +quit +END_OF_DATA + +run_bacula + +check_for_zombie_jobs storage=File +check_for_zombie_jobs storage=tape +stop_bacula + +touch $tmp/log2.out +check_two_logs +#check_restore_diff + +end_test diff --git a/regress/tests/multi-drive-test b/regress/tests/multi-drive-test new file mode 100755 index 0000000000..2cb648e0f6 --- /dev/null +++ b/regress/tests/multi-drive-test @@ -0,0 +1,71 @@ +#!/bin/sh +# +# This script is used to test multiple devices grouped in +# the director configuration +# +TestName="multi-drive1-test" +JobName=backup +. scripts/functions + +scripts/cleanup +scripts/copy-2disk-confs +scripts/prepare-disk-changer + +echo "s/signature=MD5/signature=MD5; readfifo=yes/" > $tmp/1 +echo "s/FileStorage/Device = FileStorage; Device=FileStorage2; Device=FileStorage3; Device=FileStorage4/" >> $tmp/1 +sed -f $tmp/1 $conf/bacula-dir.conf > $tmp/2 +$bperl -e 'add_attribute("$tmp/2", "Label Format", "Vol", "Pool", "Default")' +$bperl -e 'add_attribute("$tmp/2", "Label Format", "Vol", "Pool", "Inc")' +$bperl -e 'add_attribute("$tmp/2", "SpoolData", "no", "Job")' +cp $tmp/2 $conf/bacula-dir.conf + +$bperl -e 'add_attribute("$conf/bacula-sd.conf", "Label Media", "yes", "Device")' +$bperl -e 'extract_resource("$conf/bacula-sd.conf", "Device", "FileStorage")' > $tmp/2 +for i in 2 3 4; do + sed "s/FileStorage/FileStorage$i/" $tmp/2 >> $conf/bacula-sd.conf +done + +disable_pluguins + +echo "$cwd/build" >${cwd}/tmp/file-list +echo "$tmp/fifo" >>${cwd}/tmp/file-list + +mkfifo $tmp/fifo +(sleep 15 > $tmp/fifo)& + +change_jobname $JobName +start_test + +# test with autolabel +# +# +# Write out bconsole commands +cat <${cwd}/tmp/bconcmds +@$out /dev/null +messages +@$out ${cwd}/tmp/log1.out +run level=full job=backup storage=File pool=Default yes +@sleep 3 +run level=full job=backup storage=File pool=Default yes +@sleep 3 +run level=full job=backup storage=File pool=Inc yes +@sleep 3 +messages +status storage=File +status dir +messages +wait +quit +END_OF_DATA + +run_bacula + +check_for_zombie_jobs storage=File +check_for_zombie_jobs storage=tape +stop_bacula + +touch $tmp/log2.out +check_two_logs +#check_restore_diff + +end_test diff --git a/regress/tests/multi-drive1-test b/regress/tests/multi-drive1-test new file mode 100755 index 0000000000..c9ea2723f3 --- /dev/null +++ b/regress/tests/multi-drive1-test @@ -0,0 +1,79 @@ +#!/bin/sh +# +# This script is used to test multiple devices grouped in +# the director configuration +# +# +TestName="multi-drive-group-test" +JobName=backup +. scripts/functions + +scripts/cleanup +scripts/copy-2disk-confs +scripts/prepare-disk-changer + +echo "s/signature=MD5/signature=MD5; readfifo=yes/" > $tmp/1 +echo "s/FileStorage/FileStorage; Device=FileStorage2; Device=FileStorage3; Device=FileStorage4/" >> $tmp/1 +sed -f $tmp/1 $conf/bacula-dir.conf > $tmp/2 +# Allow auto label +$bperl -e 'add_attribute("$tmp/2", "Label Format", "Vol", "Pool", "Default")' +$bperl -e 'add_attribute("$tmp/2", "Label Format", "Vol", "Pool", "Inc")' +$bperl -e 'add_attribute("$conf/bacula-sd.conf", "Label Media", "yes", "Device")' + +# set this to do round robbin +$bperl -e 'set_maximum_concurrent_jobs("$conf/bacula-sd.conf", 1, "Device")' + +# Disable spooling for each job +$bperl -e 'add_attribute("$tmp/2", "SpoolData", "no", "Job")' +cp $tmp/2 $conf/bacula-dir.conf + +$bperl -e 'extract_resource("$conf/bacula-sd.conf", "Device", "FileStorage")' > $tmp/2 +for i in 2 3 4; do + sed "s/FileStorage/FileStorage$i/" $tmp/2 >> $conf/bacula-sd.conf +done + +disable_pluguins + +echo "$cwd/build" >${cwd}/tmp/file-list +echo "$tmp/fifo" >>${cwd}/tmp/file-list + +mkfifo $tmp/fifo +(sleep 15 > $tmp/fifo)& + +change_jobname $JobName +start_test + +# test with autolabel +# +# +# Write out bconsole commands +cat <${cwd}/tmp/bconcmds +@out /dev/null +messages +@$out ${cwd}/tmp/log1.out +run level=full job=backup storage=File pool=Default yes +run level=full job=backup storage=File pool=Default yes +run level=full job=backup storage=File pool=Default yes +run level=full job=backup storage=File pool=Inc yes +run level=full job=backup storage=File pool=Inc yes +@sleep 3 +messages +status storage=File +status dir +messages +wait +messages +quit +END_OF_DATA + +run_bacula + +check_for_zombie_jobs storage=File +check_for_zombie_jobs storage=tape +stop_bacula + +touch $tmp/log2.out +check_two_logs +#check_restore_diff + +end_test diff --git a/regress/tests/win32-systemstate-test b/regress/tests/win32-systemstate-test new file mode 100644 index 0000000000..47498800d5 --- /dev/null +++ b/regress/tests/win32-systemstate-test @@ -0,0 +1,58 @@ +#!/bin/sh +# +# How to use this test +# -------------------- +# +# * Get a working Windows OS on your network +# * Install strawberry perl version with msi +# http://www.bacula.org/downloads/depkgs-mingw32/strawberry-perl-5.10.1.0.msi +# * Install the latest version of Bacula FD +# * Copy or make accessible (Network share, VirtualBox share) +# regress/scripts/regress-win32.pl +# * Execute the script on the Windows box +# perl regress-win32.pl +# * Run this script with the proper config settings about WIN32 +# +TestName="win32-systemstate-test" +. scripts/functions + +scripts/cleanup +scripts/copy-test-confs +cp scripts/win32-bacula-dir.conf bin/bacula-dir.conf + +URL=http://$WIN32_ADDR:8091 +wget -qO $tmp/stop.log "$URL/stop" +wget -qO $tmp/update.log "$URL/set_director_name?name=$HOST-dir;pass=$WIN32_PASSWORD" +wget -qO $tmp/start.log "$URL/start" + +start_test + +cat <${cwd}/tmp/bconcmds +@output +messages +@$out ${cwd}/tmp/log1.out +status client=$WIN32_CLIENT +label storage=File volume=TestVolume001 +run job=SystemstateJob storage=File yes +wait +messages +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +restore where=/ storage=File +cd @SYSTEMSTATE +m Reg* +done +yes +wait +messages +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=File +stop_bacula + +check_two_logs +end_test -- 2.39.5