]> git.sur5r.net Git - bacula/bacula/commitdiff
regress: add mssql test
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 30 Nov 2010 19:46:08 +0000 (20:46 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:39:40 +0000 (14:39 +0200)
regress/tests/win32-mssql-test [new file with mode: 0755]

diff --git a/regress/tests/win32-mssql-test b/regress/tests/win32-mssql-test
new file mode 100755 (executable)
index 0000000..dac6ab3
--- /dev/null
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# How to use this test
+# --------------------
+#
+# * Get a working Windows OS on your network
+# * Install strawberry perl version with msi to c:/strawberry
+#   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
+#
+# Add user auth info to ./config file to enable autologin
+#  WIN32_MSSQL_USER=sa
+#  WIN32_MSSQL_PASS=PasswordSecret
+# * Install MSSQL with default options
+#
+#
+# Note, once everything is setup, and you have run the above once
+#  you can simply run the first part of this script prior to the URL=
+#  to get the proper conf files loaded in bin, then manually
+#  start bacula, and run the "systemstate" backup job, then
+#  restore it.
+#
+TestName="win32-mssql-test"
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-test-confs
+cp scripts/win32-bacula-dir-systemstate.conf bin/bacula-dir.conf
+
+echo "Connect with Win32 server"
+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"
+set -e
+wget -qO - "$URL/check_mssql?user=$WIN32_MSSQL_USER;pass=$WIN32_MSSQL_PASS" | grep OK
+wget -qO - "$URL/setup_mssql_db?db=db$$" | grep OK
+set +e
+
+echo "Start test"
+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=MSSQLJob storage=File yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@# 
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=/ storage=File
+5
+m @MSSQL
+done
+yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bconsole
+
+check_for_zombie_jobs storage=File
+stop_bacula
+
+check_two_logs
+
+wget -qO $tmp/cleanup.log "$URL/cleanup_setup_db?db=db$$"
+
+end_test