]> git.sur5r.net Git - bacula/bacula/commitdiff
Add new test for win32
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 7 Dec 2009 13:39:08 +0000 (14:39 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 7 Dec 2009 13:39:08 +0000 (14:39 +0100)
regress/tests/win32-fd-test [new file with mode: 0644]

diff --git a/regress/tests/win32-fd-test b/regress/tests/win32-fd-test
new file mode 100644 (file)
index 0000000..099f2b3
--- /dev/null
@@ -0,0 +1,98 @@
+#!/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-fd-test"
+JobName=win32
+. 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"
+
+wget -qO $tmp/init1.log "$URL/init_attrib_test?source=$WIN32_FILE"
+wget -qO $tmp/init2.log "$URL/init_weird_runscript_test?source=$WIN32_FILE"
+wget -qO $tmp/clean.log "$URL/cleandir?source=$WIN32_FILE/restore"
+
+change_jobname NightlySave $JobName
+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=$JobName storage=File yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=$WIN32_FILE/restore select all done storage=File
+yes
+wait
+messages
+@$out ${cwd}/tmp/log3.out
+@#
+@# make some runscript tests
+@#
+run job=RunScript storage=File yes
+wait
+messages
+@$out ${cwd}/tmp/log4.out
+@#
+@# make some accurate tests
+@#
+run job=AccurateJob storage=File yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+check_two_logs
+
+DST=`echo $WIN32_FILE | sed 's!:!!'`
+
+# Compare original and restored directories
+wget -qO $tmp/1.log "$URL/compare?source=$WIN32_FILE/attrib_test;dest=$WIN32_FILE/restore/$DST/attrib_test"
+print_debug `cat $tmp/1.log`
+rstat=0
+grep OK $tmp/1.log > /dev/null
+if [ $? != 0 ]; then
+    rstat=1
+fi
+
+# Compare with some weird files
+wget -qO $tmp/2.log "$URL/compare?source=$WIN32_FILE/weird_runcript;dest=$WIN32_FILE/restore/$DST/weird_runcript"
+print_debug `cat $tmp/2.log`
+
+grep OK $tmp/2.log > /dev/null
+if [ $? != 0 ]; then
+    rstat=2
+fi
+
+dstat=0
+end_test