--- /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
+@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
+