--- /dev/null
+In order to use the win32 bacula regression scripts, it is important to have
+some unix tools (such as sed, grep, and diff). To make things simple, download
+UnxUtils from http://sourceforge.net/projects/unxutils
+
+Extract UnxUtils somewhere and add the the files in usr\local\wbin to $PATH.
+
+Copy regress/win32 to a local directory on your system.
+
+Set your sources directory in prototype.conf to a mapped drive or a local copy
+of the bacula sources including windows binaries.
+
+Run "config.cmd prototype.conf" from a command prompt in your regress/win32
+directory followed by "make setup".
+
+Tests are executed with "make test".
--- /dev/null
+CALL make setup
+CALL do_all_tests
--- /dev/null
+CALL make setup
+CALL all-non-root-tape-tests
--- /dev/null
+python starttime.py
+IF NOT EXIST bin\tape_options touch bin/tape_options
+ECHO. >test.out
+TYPE build/config.out >>test.out
+ECHO. >>test.out
+ECHO Test results >>test.out
+ECHO. >>test.out
+python starttime.py
+CALL all-non-root-tests
+CALL all-non-root-tape-tests
+CALL all-non-root-2tape-tests
+ECHO.
+ECHO End do_all tests
+ECHO End do_all tests >>test.out
+CALL scripts/cleanup
+TYPE test.out
+python endtime.py
--- /dev/null
+REM /home/kern/bacula/bin/startmysql
+CALL make setup
+ECHO. >test.out
+TYPE build/config.out >>test.out
+ECHO. >>test.out
+ECHO Test results >>test.out
+ECHO. >>test.out
+python starttime.py
+CALL all-non-root-tests
+ECHO.
+ECHO End do_file tests
+ECHO End do_file tests >>test.out
+CALL scripts/cleanup
+TYPE test.out
+python endtime.py
--- /dev/null
+-----BEGIN PGP MESSAGE-----
+Charset: ISO-8859-1
+Version: GnuPG v1.4.2 (FreeBSD)
+Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
+
+hQIOA/nlxaDbIWjjEAf/dEGV3MNkQk92dZIzRIgKx3MuKElsIcQmc053MT8Wc7V3
++FmwbqsfhirEdBU+qEINRT+3UQ+RLY1NXKlbL2JxeMdJTWx81x6wTbR+wPgi8HeE
+jhPvEx1633IWS8+Au3Flmry3SxjEf4uI5N4r+hFWuvYxdalXtXtkTOvTbfmtoQPG
+y9mQ7eC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qLcizaEdxq7aXqX
+GIUWMeXTvWtYE9et/3NJrRm6Eo2IOQO6J0OnUvsuBc+i0pZaIi7WVnDBDMgojXXa
+yRNRgm4jtwT+5KWi8QA6owXgDhjWH+dILSWTE8Q7V7grlRp4C42STtvtXmwuIDws
+sb72EmQs3IkKylS7Nk6mZwhDK8Wjo6olUjS8PceWDVWLOII+hcHiuGSZXZyy7Bwg
+mfswd8sqIaWPDkYwlsBq82yRS4YV224pBBxqiT3o14LqCQ56Er3ZaogGfKiL0mpJ
+Lu3fpivt/HslXbumQeggeFfhn6Z/Otbr1EGrvcslPEPLehpEfks/2syF9vfqLaFp
++spDOiRKBUg=
+=W5Nc
+-----END PGP MESSAGE-----
\ No newline at end of file
--- /dev/null
+From: "Michel Meyers" <steltek@tcnnet.dyndns.org>
+To: "bacula-users" <bacula-users@lists.sourceforge.net>
+Subject: [Bacula-users] Script for pushing new clients to Windows boxes
+Date: Mon, 2 Feb 2004 16:10:48 +0100
+
+Hello,
+
+Some of you may remember my document on how to remotely push a Win32 bacula
+client onto a WinNT/2k/XP box. Well, I've written a script to do it for me
+and thought I'd share it with you:
+- ----------------------------------------------------------------
+#!/bin/bash
+#
+# Remote Win32 client upgrade script
+# written by Michel Meyers (last update 2006-09-25 11:34)
+#
+# WARNING: Make sure that no bacula-fd.conf exists in the source directory!
+# You will destroy/overwrite all your client's configs if you don't
+# be careful with this.
+#
+# The upgrade function does the following:
+# - Shutdown Bacula service on remote machine
+# - Wait 30 seconds (to allow proper shutdown)
+# - Mount C: drive of remote box
+# - Copy new client to remote machine
+# - Unmount C;
+# - Startup the new Bacula service
+#
+# To upgrade a machine append the following at the bottom of this file:
+#
+# SERVERNAME=<hostname>
+# USERNAME=<username>
+# PASSWORD=<password, "" for blank>
+# upgrade
+
+upgrade() {
+net rpc -S $SERVERNAME -U $USERNAME%"$PASSWORD" service stop bacula
+sleep 30
+smbmount //$SERVERNAME/c$ /mnt -o username=$USERNAME,password="$PASSWORD"
+cp /home/michel/winbacula/bin/* /mnt/bacula/bin
+umount /mnt
+net rpc -S $SERVERNAME -U $USERNAME%"$PASSWORD" service start bacula
+}
+
+SERVERNAME=xerxes
+USERNAME=administrator
+PASSWORD=secret
+upgrade
+
+SERVERNAME=shodan
+USERNAME=teh_one
+PASSWORD=""
+upgrade
+- ----------------------------------------------------------------
+
+It should be pretty self-explanatory. I'm not good at shell programming and
+I don't know whether there's any notion of arrays or 'for' loops that could
+make it cleaner so I simply wrote a function which references some variables
+and then call that repeatedly (once per machine). You can of course change
+the values according to your system and liking (if 30 secs seem to much for
+you, just reduce the value after sleep, make sure to check on the paths and
+mountpoint /mnt may not be usable on your system, ...)
+
+Note: The requirements are the same as described in my other document
+(Samba-TNG clients among others, otherwise you'll be missing rpcclient).
+
+Update 2006-09-25: Samba-TNG is no longer required, the 'net' command from
+Samba 3 works for starting and stopping services. Paths may need to be
+updated with quotation marks as the new Bacula Win32 Installer no longer
+installs into C:\bacula but into 'C:\Program Files\bacula' (on English
+Windows versions).
+
+
+Enjoy!
+
--- /dev/null
+from time import time as now
+
+t = now()
+fn = open('time.out', 'r')
+s = fn.readline()
+fn.close()
+diff = t - float(s)
+h = int(diff / 3600)
+m = int((diff - h * 3600) / 60)
+sec = diff - h * 3600 - m * 60
+print 'Total time = %d:%02d:%02d or %d secs' % (h, m, sec, t - float(s))
--- /dev/null
+CALL all-non-root-tests
--- /dev/null
+CALL tests\btape-fill-full-tape
+CALL tests\eot-fail-tape
--- /dev/null
+bin\bacula start
+bin\bacuula -c bin\bconsole.conf
--- /dev/null
+from time import time as now
+
+fn = open('time.out', 'w+')
+fn.write('%s' % now())
+fn.close()
--- /dev/null
+CALL all-non-root-tape-tests
--- /dev/null
+@output nul
+messages
+@@out@ @topdir@/tmp/log1.out
+setdebug level=51 storage=DDS-4
+label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
+label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Full drive=1
+@#label storage=DDS-4 volume=TestVolume003 slot=3 Pool=Inc drive=2
+status storage=DDS-4
+@#run job=@JobName@ level=Full Pool=Inc yes
+run job=@JobName@ level=Full Pool=Full yes
+run job=@JobName@ level=Full Pool=Default yes
+setdebug level=200 storage=DDS-4
+run job=@JobName@ level=Full Pool=Default yes
+run job=@JobName@ level=Full Pool=Default yes
+@sleep 10
+status storage=DDS-4
+list volumes
+wait
+list volumes
+list jobs
+status storage=DDS-4
+messages
+quit
+
--- /dev/null
+@@out@ @topdir@/tmp/log1.out
+messages
+@#
+@# now do a restore
+@#
+@@out@ @topdir@/tmp/log2.out
+restore where=@topdir@/tmp/bacula-restores select all storage=DDS-4 done
+yes
+wait
+messages
+@@out@
+quit
+
--- /dev/null
+REM Run a simple backup of the Bacula build directory. Create three
+REM tapes, each in a different pool, then run some jobs asking for the
+REM volume on drive three. It should find it without moving the
+REM volume.
+REM
+REM This script uses the virtual disk autochanger and two drives
+REM
+SET TestName="2drive-3pool-disk"
+SET JobName="2dr3pooldisk"
+
+CALL scripts\functions set_debug 0
+
+CALL scripts\cleanup
+CALL scripts\copy-2disk-drive-confs
+CALL scripts\prepare-two-disks
+
+ECHO %CD:\=/%/build >tmp\file-list
+CALL scripts\functions change_jobname NightlySave %JobName%
+CALL scripts\functions start_test
+
+REM Turn off Prefer Mounted Volumes so we use 2 drives
+REM outf="tmp/sed_tmp"
+REM ECHO "s%REM Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
+REM cp bin/bacula-dir.conf tmp/1
+REM Comment the next line out to write everything to one drive
+REM otherwise, it writes the two jobs to different drives
+REM sed -f ${outf} tmp/1 >bin/bacula-dir.conf
+
+REM Write out bconsole commands
+sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\2drive-3pool-test.1.bscr >tmp\bconcmds
+CALL scripts\functions run_bacula
+
+sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\2drive-3pool-test.2.bscr >tmp\bconcmds
+CALL scripts\functions run_bconsole
+
+CALL scripts\functions check_for_zombie_jobs storage=DDS-4
+CALL scripts\functions stop_bacula
+
+CALL scripts\functions check_two_logs
+CALL scripts\functions check_restore_diff
+
+CALL scripts\functions end_test
+
--- /dev/null
+@output nul
+messages
+@@out@ @topdir@/tmp/log1.out
+label pool=Default storage=DDS-4 volume=TestVolume001 slot=1 drive=0
+label pool=Default storage=DDS-4 volume=TestVolume002 slot=2 drive=1
+update Volume=TestVolume001 MaxVolBytes=100000000
+@#50000000
+@#12
+setdebug level=001 Storage=DDS-4
+status storage=DDS-4
+llist volume=TestVolume001
+llist volume=TestVolume002
+run job=@JobName@ level=Full Storage=DDS-4
+yes
+reload
+llist volume=TestVolume001
+llist volume=TestVolume002
+run job=@JobName@ level=Full Storage=DDS-4
+yes
+reload
+llist volume=TestVolume001
+llist volume=TestVolume002
+run job=@JobName@ level=Full Storage=DDS-4
+yes
+reload
+llist volume=TestVolume001
+llist volume=TestVolume002
+status storage=DDS-4
+run job=@JobName@ level=Full Storage=DDS-4
+yes
+status storage=DDS-4
+reload
+reload
+reload
+reload
+@sleep 2
+status dir
+status storage=DDS-4
+llist volume=TestVolume001
+llist volume=TestVolume002
+reload
+@sleep 5
+messages
+reload
+reload
+wait
+status storage=DDS-4
+reload
+messages
+@#
+@# now do a restore
+@#
+@@out@ @topdir@/tmp/log2.out
+restore where=@topdir@/tmp/bacula-restores select storage=DDS-4
+unmark *
+mark *
+done
+yes
+wait
+reload
+reload
+messages
+@output
+quit
+
--- /dev/null
+REM Run four jobs at the same time, with two Volumes.
+REM Set max Vol bytes of first volume
+REM to less than total backup to force Bacula to use the second
+REM Volume.
+REM
+SET TestName="2drive-concurrent-test"
+SET JobName=Four-concurrent-jobs
+CALL CALL scripts\functions set_debug 0
+
+CALL scripts\cleanup
+CALL scripts\copy-2disk-drive-confs
+CALL scripts\prepare-two-disks
+ECHO %CD:\=/%/build >tmp\file-list
+
+CALL scripts\functions change_jobname NightlySave %JobName%
+CALL scripts\functions start_test
+
+sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\2drive-concurrent-test.bscr >tmp\bconcmds
+
+CALL scripts\functions run_bacula
+CALL scripts\functions check_for_zombie_jobs storage=DDS-4
+CALL scripts\functions stop_bacula
+
+CALL scripts\functions check_two_logs
+CALL scripts\functions check_restore_diff
+CALL scripts\functions end_test
--- /dev/null
+@output nul
+messages
+@@out@ @topdir@/tmp/log1.out
+sql
+UPDATE Media SET Volbytes=@size@ WHERE VolumeName='TestVolume001';
+
+llist volume=TestVolume001
+@# Now do another full save with big Volume
+run level=Full job=@JobName@ yes
+wait
+messages
+@#
+@# now do a restore
+@#
+sql
+SELECT * FROM JobMedia;
+
+@output @topdir@/tmp/log2.out
+restore where=@topdir@/tmp/bacula-restores storage=File select all done
+yes
+wait
+messages
+@@out@
+quit
+
--- /dev/null
+@output nul
+messages
+@@out@ @topdir@/tmp/log1.out
+@#setdebug level=100 storage=File
+label storage=File volume=TestVolume001
+run job=@JobName@ yes
+wait
+messages
+quit
+
--- /dev/null
+REM Create a big Volume > 5 GB and backup to it to test disk
+REM seeking on big volumes. We cheat and artifically grow
+REM the volume.
+SET TestName="big-vol-test"
+SET JobName=bigvol
+
+CALL scripts\functions set_debug 0
+
+CALL scripts\cleanup
+CALL scripts\copy-test-confs
+ECHO %CD:\=/%/build >tmp\file-list
+
+CALL scripts\functions change_jobname CompressedTest %JobName%
+CALL scripts\functions start_test
+
+sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\big-vol-test.1.bscr >tmp\bconcmds
+
+CALL scripts\functions run_bacula
+CALL scripts\functions check_for_zombie_jobs storage=File
+
+REM
+REM Now increase the size of the Volume using gigaslam
+REM
+CD %CD%\tmp
+REM make big file
+SET size=5200000000
+%CD%/build/src/tools/grow TestVolume001 %size%
+IF NOT ERRORLEVEL 0 GOTO ERROR
+CD %CD%
+
+sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" -e "s;@size@;%size%;g" tests\big-vol-test.2.bscr >tmp\bconcmds
+
+CALL scripts\functions run_bconsole
+CALL scripts\functions check_for_zombie_jobs storage=File
+CALL scripts\functions stop_bacula
+
+CALL scripts\functions check_two_logs
+CALL scripts\functions check_restore_diff
+CALL scripts\functions end_test
+REM Get rid of big files
+DEL /F %CD%\tmp\TestVolume001
+
+:ERROR
+ECHO Execute of %CD%\build\src\tools\grow failed.
--- /dev/null
+@@out@ nul
+messages
+@@out@ @topdir@/tmp/log1.out
+label storage=File volume=TestVolume001
+setdebug level=100 fd
+run job=@JobName@ yes
+wait
+messages
+@#
+@# now do a restore
+@#
+@@out@ @topdir@/tmp/log2.out
+setdebug level=100 fd
+restore where=@topdir@/tmp/bacula-restores storage=File
+5
+mark *
+done
+yes
+wait
+messages
+@@out@
+quit
+
--- /dev/null
+REM Run a simple backup of untitled15.jpg that fails to
+REM restore properly in bug REM763
+REM
+SET TestName="encrypt-bug-test"
+SET JobName=Crypto-bug
+CALL scripts\functions set_debug 0
+
+CALL scripts\cleanup
+CALL scripts\copy-crypto-confs
+ECHO %CD%/encrypt-bug.jpg >tmp/file-list
+ECHO %CD%/encrypt-bug.jpg >tmp/restore-list
+ECHO %CD%/encrypt-bug.txt >>tmp/file-list
+ECHO %CD%/encrypt-bug.txt >>tmp/restore-list
+ECHO %CD%/encrypt-bug2.txt >>tmp/file-list
+ECHO %CD%/encrypt-bug2.txt >>tmp/restore-list
+SET files="encrypt-bug.jpg encrypt-bug.txt encrypt-bug2.txt"
+mkdir -p %CD%\tmp\build
+for i in %files% do XCOPY /k %CD%\encrypt-bug*.* %CD%\tmp\build
+
+CALL scripts\functions change_jobname NightlySave @JobName@
+CALL scripts\functions start_test
+
+sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\encrypt-bug-test.bscr >tmp\bconcmds
+
+CALL scripts\functions run_bacula
+sleep 2
+CALL scripts\functions check_for_zombie_jobs storage=File
+CALL scripts\functions stop_bacula
+
+CALL scripts\functions check_two_logs
+diff %CD%\tmp\build %CD%\tmp\bacula-restores\%CD%
+SET dstat=%ERRORLEVEL%
+CALL scripts\functions end_test
--- /dev/null
+@output
+messages
+@@out@ tmp/log1.out
+@#setdebug level=100 storage=File
+label storage=File volume=FileVolume001 Pool=Default
+label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
+label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
+@# run two jobs (both will be migrated)
+run job=@JobName@ yes
+run job=@JobName@ yes
+wait
+list jobs
+list volumes
+@#setdebug level=100 dir
+@# should migrate two jobs
+@#setdebug level=51 storage=DiskChanger
+run job=migrate-job yes
+wait
+messages
+@# purge volume=FileVolume001
+list jobs
+list volumes
+wait
+@#
+@# Now do another backup, but level Incremental
+@#
+run job=@JobName@ level=Incremental yes
+wait
+messages
+@#
+@# This final job that runs should be Incremental and
+@# not upgraded to full.
+list jobs
+@#
+@# now do a restore
+@#
+@@out@ tmp/log2.out
+list volumes
+restore where=tmp/bacula-restores select storage=DiskChanger
+unmark *
+mark *
+done
+yes
+wait
+messages
+@output
+quit
--- /dev/null
+@output
+messages
+@@out@ @topdir@/tmp/log1.out
+@#setdebug level=10 dir
+@#setdebug level=100 storage=File
+label storage=File volume=FileVolume001 Pool=Default
+label storage=File volume=FileVolume002 Pool=Default
+update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default
+label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
+label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
+list volumes
+@#
+run job=@JobName@ yes
+@#run job=@JobName@ yes
+wait
+list volumes
+@#setdebug level=200 dir
+@# should migrate both Volumes
+run job=migrate-job yes
+wait
+purge volume=FileVolume001
+purge volume=FileVolume002
+list volumes
+list jobs
+messages
+wait
+@#
+@# now do a restore
+@#
+@@out@ @topdir@/tmp/log2.out
+restore where=@topdir@/tmp/bacula-restores select storage=DiskChanger
+unmark *
+mark *
+done
+yes
+wait
+messages
+@output
+quit
+
--- /dev/null
+@output
+messages
+@@out@ @topdir@/tmp/log1.out
+label storage=File volume=FileVolume001 Pool=Default
+label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
+label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
+list volumes
+@# run two jobs (both will be migrated)
+run job=@JobName@ yes
+run job=@JobName@ yes
+wait
+update volume=FileVolume001 VolStatus=Used
+list volumes
+@# should migrate two jobs
+run job=migrate-occupancy yes
+list volumes
+wait
+messages
+purge volume=FileVolume001
+wait
+@#
+@# now do a restore
+@#
+@@out@ @topdir@/tmp/log2.out
+restore where=@topdir@/tmp/bacula-restores select storage=DiskChanger
+unmark *
+mark *
+done
+yes
+wait
+messages
+@output
+quit
+
--- /dev/null
+@output
+messages
+@@out@ @topdir@/tmp/log1.out
+label storage=File volume=FileVolume001 Pool=Default
+label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
+label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
+list volumes
+@# run three jobs
+run job=@JobName@ level=Full yes
+run job=@JobName@ level=Full yes
+run job=@JobName@ level=Full yes
+wait
+update volume=FileVolume001 VolStatus=Used
+sql
+update Job SET RealEndTime='2004-01-01 12:01:01' WHERE JobId IN (2,3);
+
+llist jobid=2,3
+list jobs
+list volumes
+@# should migrate only jobid=2 and 3
+run job=migrate-time yes
+wait
+messages
+wait
+purge volume=FileVolume001
+list jobs
+list volumes
+@#
+@# now do a restore
+@#
+@@out@ @topdir@/tmp/log2.out
+restore where=@topdir@/tmp/bacula-restores select storage=DiskChanger
+unmark *
+mark *
+done
+yes
+wait
+messages
+@output
+quit
+
--- /dev/null
+@output
+messages
+@@out@ @topdir@/tmp/log1.out
+label storage=File volume=FileVolume001 Pool=Default
+label storage=File volume=FileVolume002 Pool=Default
+update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default
+label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
+label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
+@#
+run job=@JobName@ yes
+wait
+run job=@JobName@ yes
+wait
+update volume=FileVolume001 VolStatus=Used
+update volume=FileVolume002 VolStatus=Used
+@#list volumes
+@#list jobs
+@# should migrate two jobs
+@# setdebug level=11 dir
+@echo "Run migrate-volume Job"
+@#setdebug level=100 dir
+run job=migrate-volume yes
+@sleep 5
+list jobs
+llist jobid=1
+llist jobid=2
+llist jobid=3
+llist jobid=4
+llist jobid=5
+status storage=DiskChanger
+wait
+list volumes
+list jobs
+llist jobid=1
+llist jobid=2
+llist jobid=3
+llist jobid=4
+llist jobid=5
+sql
+select * from JobMedia where JobId=1;
+
+@# Now run a second Migration job, which should do nothing
+run job=migrate-volume yes
+wait
+list jobs
+@# ensure we don't pickup old backup by purging volume
+@# purge volume=FileVolume001
+@# purge volume=FileVolume002
+@echo "Now do a restore"
+messages
+@#
+@# now do a restore
+@#
+@@out@ @topdir@/tmp/log2.out
+restore where=@topdir@/tmp/bacula-restores select storage=DiskChanger
+unmark *
+mark *
+done
+yes
+wait
+messages
+@output
+quit
+