]> git.sur5r.net Git - bacula/bacula/commitdiff
regress: add new tests
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 17 Jun 2010 13:16:47 +0000 (15:16 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:53:53 +0000 (16:53 +0200)
regress/tests/multi-drive-group-test [new file with mode: 0755]
regress/tests/multi-drive-test [new file with mode: 0755]
regress/tests/multi-drive1-test [new file with mode: 0755]
regress/tests/win32-systemstate-test [new file with mode: 0644]

diff --git a/regress/tests/multi-drive-group-test b/regress/tests/multi-drive-group-test
new file mode 100755 (executable)
index 0000000..22cb4be
--- /dev/null
@@ -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 <<END_OF_DATA >${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 (executable)
index 0000000..2cb648e
--- /dev/null
@@ -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 <<END_OF_DATA >${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 (executable)
index 0000000..c9ea272
--- /dev/null
@@ -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 <<END_OF_DATA >${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 (file)
index 0000000..4749880
--- /dev/null
@@ -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 <<END_OF_DATA >${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