From 31de6e3fe8279064c47e6b828d3e3f686db45f1d Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Sat, 2 Dec 2006 14:18:54 +0000 Subject: [PATCH] Merge unix regress changes into Windows port. Port migration tests. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3733 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/scripts/bacula-sd-2disk-drive.conf | 75 ----------------- regress/scripts/bacula-sd-2disk.conf | 62 -------------- regress/win32/all-non-root-tests.cmd | 9 +- .../win32/scripts/new-test-bacula-dir.conf.in | 17 +++- regress/win32/tests/bextract-test.bscr | 4 +- regress/win32/tests/bextract-test.cmd | 2 +- regress/win32/tests/bscan-test.cmd | 4 +- regress/win32/tests/compressed-test.cmd | 2 +- regress/win32/tests/filed-crypto-test | 49 ----------- regress/win32/tests/migration-job-test | 70 ---------------- regress/win32/tests/migration-job-test.cmd | 37 +++++++++ regress/win32/tests/migration-jobspan-test | 80 ------------------ .../win32/tests/migration-jobspan-test.cmd | 42 ++++++++++ regress/win32/tests/migration-occupancy-test | 71 ---------------- .../win32/tests/migration-occupancy-test.cmd | 36 ++++++++ regress/win32/tests/migration-time-test | 78 ----------------- regress/win32/tests/migration-time-test.cmd | 37 +++++++++ regress/win32/tests/migration-volume-test | 83 ------------------- regress/win32/tests/migration-volume-test.cmd | 40 +++++++++ .../win32/tests/restore-disk-seek-test.cmd | 9 +- regress/win32/tests/span-vol-test.cmd | 2 +- .../win32/tests/sparse-compressed-test.cmd | 2 +- regress/win32/tests/two-pool-test.cmd | 2 +- regress/win32/tests/two-vol-test.cmd | 2 +- regress/win32/tests/two-volume-tape.cmd | 2 +- regress/win32/tests/two-volume-test.cmd | 2 +- 26 files changed, 232 insertions(+), 587 deletions(-) delete mode 100644 regress/scripts/bacula-sd-2disk-drive.conf delete mode 100644 regress/scripts/bacula-sd-2disk.conf delete mode 100644 regress/win32/tests/filed-crypto-test delete mode 100644 regress/win32/tests/migration-job-test create mode 100644 regress/win32/tests/migration-job-test.cmd delete mode 100644 regress/win32/tests/migration-jobspan-test create mode 100644 regress/win32/tests/migration-jobspan-test.cmd delete mode 100644 regress/win32/tests/migration-occupancy-test create mode 100644 regress/win32/tests/migration-occupancy-test.cmd delete mode 100644 regress/win32/tests/migration-time-test create mode 100644 regress/win32/tests/migration-time-test.cmd delete mode 100644 regress/win32/tests/migration-volume-test create mode 100644 regress/win32/tests/migration-volume-test.cmd diff --git a/regress/scripts/bacula-sd-2disk-drive.conf b/regress/scripts/bacula-sd-2disk-drive.conf deleted file mode 100644 index 1d56020cf3..0000000000 --- a/regress/scripts/bacula-sd-2disk-drive.conf +++ /dev/null @@ -1,75 +0,0 @@ -# -# Default Bacula Storage Daemon Configuration file -# -# For Bacula release 1.39 -# -# You may need to change the name of your tape drive -# on the "Archive Device" directive in the Device -# resource. If you change the Name and/or the -# "Media Type" in the Device resource, please ensure -# that dird.conf has corresponding changes. -# - -Storage { # definition of myself - Name = localhost-sd - SDPort = 8103 # Director's port - WorkingDirectory = "/home/kern/bacula/regress/working" - Pid Directory = "/home/kern/bacula/regress/working" - Subsys Directory = "/home/kern/bacula/regress/working" -} - -# -# List Directors who are permitted to contact Storage daemon -# -Director { - Name = localhost-dir - Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" -} - -# -# Devices supported by this Storage daemon -# To connect, the Director's bacula-dir.conf must have the -# same Name and MediaType. -# -Autochanger { - Name = DDS-4 - Changer Device = /home/kern/bacula/regress/tmp/disk-changer/conf - Changer Command ="/home/kern/bacula/regress/bin/disk-changer %c %o %S %a %d" - Device = Drive-0, Drive-1 -} - -Device { - Name = Drive-0 - Device Type = File - Media Type = DDS-4 - Archive Device = /home/kern/bacula/regress/tmp/disk-changer/drive0 - AutomaticMount = yes; # when device opened, read it - Autochanger = yes - Drive Index = 0 - AlwaysOpen = yes; - RemovableMedia = yes; -# Maximum File Size = 1000000 -} - -Device { - Name = Drive-1 - Device Type = File - Media Type = DDS-4 - Archive Device = /home/kern/bacula/regress/tmp/disk-changer/drive1 - AutomaticMount = yes; # when device opened, read it - Autochanger = yes - Drive Index = 1 - AlwaysOpen = yes; - RemovableMedia = yes; -# Maximum File Size = 1000000 -} - - -# -# Send all messages to the Director, -# mount messages also are sent to the email address -# -Messages { - Name = Standard - director = localhost-dir = all, !terminate -} diff --git a/regress/scripts/bacula-sd-2disk.conf b/regress/scripts/bacula-sd-2disk.conf deleted file mode 100644 index 00594665b5..0000000000 --- a/regress/scripts/bacula-sd-2disk.conf +++ /dev/null @@ -1,62 +0,0 @@ -# -# Default Bacula Storage Daemon Configuration file -# -# For Bacula release 1.39 -# -# You may need to change the name of your tape drive -# on the "Archive Device" directive in the Device -# resource. If you change the Name and/or the -# "Media Type" in the Device resource, please ensure -# that dird.conf has corresponding changes. -# - -Storage { # definition of myself - Name = localhost-sd - SDPort = 8103 # Director's port - WorkingDirectory = "/home/kern/bacula/regress/working" - Pid Directory = "/home/kern/bacula/regress/working" - Subsys Directory = "/home/kern/bacula/regress/working" -} - -# -# List Directors who are permitted to contact Storage daemon -# -Director { - Name = localhost-dir - Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" -} - -# -# Devices supported by this Storage daemon -# To connect, the Director's bacula-dir.conf must have the -# same Name and MediaType. -# -Autochanger { - Name = DDS-4 - Changer Device = /home/kern/bacula/regress/tmp/disk-changer/conf - Changer Command ="/home/kern/bacula/regress/bin/disk-changer %c %o %S %a %d" - Device = Drive-0 -} - -Device { - Name = Drive-0 # - Device Type = File - Media Type = DDS-4 - Archive Device = /home/kern/bacula/regress/tmp/disk-changer/drive0 - AutomaticMount = yes; # when device opened, read it - Autochanger = yes - Drive Index = 0 - AlwaysOpen = yes; - RemovableMedia = yes; -# Maximum File Size = 1000000 -} - - -# -# Send all messages to the Director, -# mount messages also are sent to the email address -# -Messages { - Name = Standard - director = localhost-dir = all, !terminate -} diff --git a/regress/win32/all-non-root-tests.cmd b/regress/win32/all-non-root-tests.cmd index 15689bba1e..faeb4699ae 100644 --- a/regress/win32/all-non-root-tests.cmd +++ b/regress/win32/all-non-root-tests.cmd @@ -11,6 +11,7 @@ CALL tests\bscan-test CALL tests\bsr-opt-test CALL tests\compressed-test CALL tests\concurrent-jobs-test +CALL tests\data-encrypt-test CALL tests\differential-test CALL tests\four-concurrent-jobs-test CALL tests\four-jobs-test @@ -29,10 +30,10 @@ CALL tests\two-vol-test CALL tests\verify-vol-test REM CALL tests\weird-files2-test REM CALL tests\weird-files-test -REM CALL tests\migration-job-test -REM CALL tests\migration-jobspan-test -REM CALL tests\migration-volume-test -REM CALL tests\migration-time-test +CALL tests\migration-job-test +CALL tests\migration-jobspan-test +CALL tests\migration-volume-test +CALL tests\migration-time-test REM CALL tests\hardlink-test REM REM The following are Virtual Disk Autochanger tests diff --git a/regress/win32/scripts/new-test-bacula-dir.conf.in b/regress/win32/scripts/new-test-bacula-dir.conf.in index bdb2da5665..7302f0c73d 100644 --- a/regress/win32/scripts/new-test-bacula-dir.conf.in +++ b/regress/win32/scripts/new-test-bacula-dir.conf.in @@ -5,7 +5,7 @@ # file or directory names in the Include directive of the # FileSet resource. # -# For Bacula release 1.33 +# For Bacula release 1.39 or later # # You might also want to change the default email address # from root to your address. See the "mail" and "operator" @@ -40,6 +40,20 @@ Job { SpoolData=yes } +Job { + Name = "Crypto" + Type = Backup + Client=@hostname@-fd + FileSet="SparseCompressedSet" + Storage = File + Messages = Standard + Pool = Default + Write Bootstrap = "@working_dir@/NightlySave.bsr" + Maximum Concurrent Jobs = 4 + SpoolData=yes +} + + Job { Name = "MonsterSave" Type = Backup @@ -163,6 +177,7 @@ FileSet { Include { Options { signature=MD5 compression=GZIP + sparse=yes } File = &1 >nul +bin\bextract -b working/restore.bsr -c bin/bacula-sd.conf %CD:\=/%/tmp %CD:\=/%/tmp/bacula-restores 2>&1 >nul SET rstat=%ERRORLEVEL% grep "^ Termination: *Backup OK" tmp\log1.out 2>&1 >nul SET bstat=%ERRORLEVEL% diff --git a/regress/win32/tests/bscan-test.cmd b/regress/win32/tests/bscan-test.cmd index 754305fdcc..5b71db8c1a 100644 --- a/regress/win32/tests/bscan-test.cmd +++ b/regress/win32/tests/bscan-test.cmd @@ -11,7 +11,7 @@ SET JobName=bscan CALL scripts\functions set_debug 0 CALL scripts\functions copy_test_confs -echo %CD:\=/%/build >\tmp\file-list +ECHO %CD:\=/%/build >\tmp\file-list CALL scripts\functions change_jobname NightlySave %JobName% CALL scripts\functions start_test @@ -22,7 +22,7 @@ CALL scripts\functions run_bacula CALL scripts\functions check_for_zombie_jobs storage=File1 CALL scripts\functions stop_bacula -echo volume=TestVolume001^|TestVolume002 >tmp\bscan.bsr +ECHO volume=TestVolume001^|TestVolume002 >tmp\bscan.bsr IF %debug% EQU 1 ( bin\bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf %CD:\=/%/tmp | tools\tee tmp\log.out diff --git a/regress/win32/tests/compressed-test.cmd b/regress/win32/tests/compressed-test.cmd index bff606925a..2097c6124f 100644 --- a/regress/win32/tests/compressed-test.cmd +++ b/regress/win32/tests/compressed-test.cmd @@ -8,7 +8,7 @@ SET JobName=compressed CALL scripts\functions set_debug 0 CALL scripts\functions copy_test_confs -echo %CD:\=/%/build >\tmp\file-list +ECHO %CD:\=/%/build >\tmp\file-list CALL scripts\functions change_jobname CompressedTest %JobName% CALL scripts\functions start_test diff --git a/regress/win32/tests/filed-crypto-test b/regress/win32/tests/filed-crypto-test deleted file mode 100644 index 0189624767..0000000000 --- a/regress/win32/tests/filed-crypto-test +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# Run a simple backup (with encryption) of the Bacula build directory -# then verify the signatures. -# -TestName="filed-crypto-test" -JobName=Crypto -. scripts/functions -set_debug 0 - -scripts/cleanup -scripts/copy-crypto-confs -echo "${cwd}/build" >/tmp/file-list - -change_jobname NightlySave $JobName -start_test - -cat <tmp/bconcmds -@$out /dev/null -messages -@$out tmp/log1.out -setdebug level=1 storage=File sd -label storage=File volume=TestVolume001 -run job=$JobName yes -wait -messages -@# -@# now do a restore -@# -@$out tmp/log2.out -restore where=${cwd}/tmp/bacula-restores storage=File -5 -mark * -done -yes -wait -messages -@$out -quit -END_OF_DATA - -run_bacula -sleep 2 -check_for_zombie_jobs storage=File -stop_bacula - -check_two_logs -check_restore_diff -end_test diff --git a/regress/win32/tests/migration-job-test b/regress/win32/tests/migration-job-test deleted file mode 100644 index d243c99712..0000000000 --- a/regress/win32/tests/migration-job-test +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# Run a simple backup of the Bacula build directory then migrate it -# to another device. -# -# This script uses the virtual disk autochanger -# -TestName="migration-job-test" -JobName=MigrationJobSave -. scripts/functions -set_debug 0 - -. config.out - -scripts/cleanup -scripts/copy-migration-confs -scripts/prepare-two-disks -echo "${cwd}/build" >/tmp/file-list - -change_jobname NightlySave $JobName -start_test - -# -# Note, we first backup into Pool Default, -# then Migrate into Pool Full. -# Pool Default uses Storage=File -# Pool Full uses Storage=DiskChanger - -# Write out bconsole commands -cat <tmp/bconcmds -@output -messages -@$out 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 -list volumes -@# should migrate two jobs -run job=migrate-job yes -list volumes -wait -messages -wait -@# -@# now do a restore -@# -@$out tmp/log2.out -restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger -unmark * -mark * -done -yes -wait -messages -@output -quit -END_OF_DATA - -run_bacula -check_for_zombie_jobs storage=File -stop_bacula - -check_two_logs -check_restore_diff -end_test diff --git a/regress/win32/tests/migration-job-test.cmd b/regress/win32/tests/migration-job-test.cmd new file mode 100644 index 0000000000..d851fdeea6 --- /dev/null +++ b/regress/win32/tests/migration-job-test.cmd @@ -0,0 +1,37 @@ +REM +REM Run a simple backup of the Bacula build directory then migrate it +REM to another device. +REM +REM This script uses the virtual disk autochanger +REM +SET TestName=migration-job-test +SET JobName=MigrationJobSave + +CALL scripts\functions set_debug 0 + +CALL config_out + +CALL scripts\cleanup +CALL scripts\copy-migration-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 +REM Note, we first backup into Pool Default, +REM then Migrate into Pool Full. +REM Pool Default uses Storage=File +REM Pool Full uses Storage=DiskChanger + +REM Write out bconsole commands +sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\migration-job-test.bscr >tmp\bconcmds + +CALL scripts\functions run_bacula +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 diff --git a/regress/win32/tests/migration-jobspan-test b/regress/win32/tests/migration-jobspan-test deleted file mode 100644 index 838cb00b28..0000000000 --- a/regress/win32/tests/migration-jobspan-test +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -# -# Run a simple backup of the Bacula build directory then migrate it -# to another device. -# -# Test migrating a job that spans two Volumes -# -# This script uses the virtual disk autochanger -# -TestName="migration-jobspan-test" -JobName=MigrationJobSpanSave -. scripts/functions -set_debug 0 - -. config.out - -scripts/cleanup -scripts/copy-migration-confs -scripts/prepare-two-disks -echo "${cwd}/build" >/tmp/file-list -cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1 -sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf - - -change_jobname NightlySave $JobName -start_test - -# -# Note, we first backup into Pool Default, -# then Migrate into Pool Full. -# Pool Default uses Storage=File -# Pool Full uses Storage=DiskChanger - -# Write out bconsole commands -cat <tmp/bconcmds -@output -messages -@$out tmp/log1.out -@#setdebug level=100 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 -@# should migrate both Volumes -run job=migrate-job yes -wait -list volumes -list jobs -messages -wait -@# -@# now do a restore -@# -@$out tmp/log2.out -restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger -unmark * -mark * -done -yes -wait -messages -@output -quit -END_OF_DATA - -run_bacula -check_for_zombie_jobs storage=File -stop_bacula - -check_two_logs -check_restore_diff -end_test diff --git a/regress/win32/tests/migration-jobspan-test.cmd b/regress/win32/tests/migration-jobspan-test.cmd new file mode 100644 index 0000000000..e21a19aaf2 --- /dev/null +++ b/regress/win32/tests/migration-jobspan-test.cmd @@ -0,0 +1,42 @@ +REM +REM Run a simple backup of the Bacula build directory then migrate it +REM to another device. +REM +REM Test migrating a job that spans two Volumes +REM +REM This script uses the virtual disk autochanger +REM +SET TestName=migration-jobspan-test +SET JobName=MigrationJobSpanSave + +CALL scripts\functions set_debug 0 + +CALL config_out + +CALL scripts\cleanup +CALL scripts\copy-migration-confs +CALL scripts\prepare-two-disks + +ECHO %CD:\=/%/build >\tmp\file-list + +COPY bin\bacula-sd.conf tmp\1 +sed "s;# Maximum File Size; Maximum File Size;" %CD%\tmp\1 >%CD%\bin\bacula-sd.conf + +CALL scripts\functions change_jobname NightlySave %JobName% +CALL scripts\functions start_test + +REM +REM Note, we first backup into Pool Default, +REM then Migrate into Pool Full. +REM Pool Default uses Storage=File +REM Pool Full uses Storage=DiskChanger + +sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\migration-jobspan-test.bscr >tmp\bconcmds + +CALL scripts\functions run_bacula +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 diff --git a/regress/win32/tests/migration-occupancy-test b/regress/win32/tests/migration-occupancy-test deleted file mode 100644 index e5c9e35f78..0000000000 --- a/regress/win32/tests/migration-occupancy-test +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh -# -# Run a simple backup of the Bacula build directory then migrate it -# to another device. -# -# This script uses the virtual disk autochanger -# -TestName="migration-occupancy-test" -JobName=MigrationJobSave -. scripts/functions -set_debug 0 - -. config.out - -scripts/cleanup -scripts/copy-migration-confs -scripts/prepare-two-disks -echo "${cwd}/build" >/tmp/file-list - -change_jobname NightlySave $JobName -start_test - -# -# Note, we first backup into Pool Default, -# then Migrate into Pool Full. -# Pool Default uses Storage=File -# Pool Full uses Storage=DiskChanger - -# Write out bconsole commands -cat <tmp/bconcmds -@output -messages -@$out 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 -wait -@# -@# now do a restore -@# -@$out tmp/log2.out -restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger -unmark * -mark * -done -yes -wait -messages -@output -quit -END_OF_DATA - -run_bacula -check_for_zombie_jobs storage=File -stop_bacula - -check_two_logs -check_restore_diff -end_test diff --git a/regress/win32/tests/migration-occupancy-test.cmd b/regress/win32/tests/migration-occupancy-test.cmd new file mode 100644 index 0000000000..d68dac563d --- /dev/null +++ b/regress/win32/tests/migration-occupancy-test.cmd @@ -0,0 +1,36 @@ +REM +REM Run a simple backup of the Bacula build directory then migrate it +REM to another device. +REM +REM This script uses the virtual disk autochanger +REM +SET TestName=migration-occupancy-test +SET JobName=MigrationJobSave + +CALL scripts\functions set_debug 0 + +CALL config_out + +CALL scripts\cleanup +CALL scripts\copy-migration-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 +REM Note, we first backup into Pool Default, +REM then Migrate into Pool Full. +REM Pool Default uses Storage=File +REM Pool Full uses Storage=DiskChanger + +sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\migration-occupancy-test.bscr >tmp\bconcmds + +CALL scripts\functions run_bacula +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 diff --git a/regress/win32/tests/migration-time-test b/regress/win32/tests/migration-time-test deleted file mode 100644 index 0b574264c1..0000000000 --- a/regress/win32/tests/migration-time-test +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh -# -# Run a simple backup of the Bacula build directory then migrate it -# to another device. -# -# This script uses the virtual disk autochanger -# -TestName="migration-time-test" -JobName=MigrationJobSave -. scripts/functions -set_debug 0 - -. config.out - -scripts/cleanup -scripts/copy-migration-confs -scripts/prepare-two-disks -echo "${cwd}/build" >/tmp/file-list - -change_jobname NightlySave $JobName -start_test - -# -# Note, we first backup into Pool Default, -# then Migrate into Pool Full. -# Pool Default uses Storage=File -# Pool Full uses Storage=DiskChanger - -# Write out bconsole commands -cat <tmp/bconcmds -@output -messages -@$out 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 -list jobs -list volumes -@# -@# now do a restore -@# -@$out tmp/log2.out -restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger -unmark * -mark * -done -yes -wait -messages -@output -quit -END_OF_DATA - -run_bacula -check_for_zombie_jobs storage=File -stop_bacula - -check_two_logs -check_restore_diff -end_test diff --git a/regress/win32/tests/migration-time-test.cmd b/regress/win32/tests/migration-time-test.cmd new file mode 100644 index 0000000000..473ebe6b5e --- /dev/null +++ b/regress/win32/tests/migration-time-test.cmd @@ -0,0 +1,37 @@ +REM +REM Run a simple backup of the Bacula build directory then migrate it +REM to another device. +REM +REM This script uses the virtual disk autochanger +REM +SET TestName=migration-time-test +SET JobName=MigrationJobSave + +CALL scripts\functions set_debug 0 + +CALL config_out + +CALL scripts\cleanup +CALL scripts\copy-migration-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 +REM Note, we first backup into Pool Default, +REM then Migrate into Pool Full. +REM Pool Default uses Storage=File +REM Pool Full uses Storage=DiskChanger + +sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\migration-time-test.bscr >tmp\bconcmds + +CALL scripts\functions run_bacula +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 diff --git a/regress/win32/tests/migration-volume-test b/regress/win32/tests/migration-volume-test deleted file mode 100644 index e2d66b60da..0000000000 --- a/regress/win32/tests/migration-volume-test +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Run a backup of the Bacula build directory on two Volumes -# then migrate it to another device. -# -# This script uses the virtual disk autochanger -# -TestName="migration-volume-test" -JobName=MigVolBackup -. scripts/functions -set_debug 0 - -. config.out - -scripts/cleanup -scripts/copy-migration-confs -scripts/prepare-two-disks -echo "${cwd}/build" >/tmp/file-list -#cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1 -#sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf - -change_jobname NightlySave $JobName -start_test - -# -# Note, we first backup into Pool Default, -# then Migrate into Pool Full. -# Pool Default uses Storage=File -# Pool Full uses Storage=DiskChanger - -# Write out bconsole commands -cat <tmp/bconcmds -@output -messages -@$out 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 -list volumes -@# -run job=$JobName yes -wait -run job=$JobName yes -wait -update volume=FileVolume001 VolStatus=Used -update volume=FileVolume002 VolStatus=Used -list volumes -@# should migrate two jobs -@# setdebug level=11 dir -run job=migrate-volume yes -list volumes -@sleep 3 -status storage=DiskChanger -@sleep 1 -status storage=DiskChanger -@sleep 1 -status storage=DiskChanger -wait -messages -@# -@# now do a restore -@# -@$out tmp/log2.out -restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger -unmark * -mark * -done -yes -wait -messages -@output -quit -END_OF_DATA - -run_bacula -check_for_zombie_jobs storage=File -stop_bacula - -check_two_logs -check_restore_diff -end_test diff --git a/regress/win32/tests/migration-volume-test.cmd b/regress/win32/tests/migration-volume-test.cmd new file mode 100644 index 0000000000..86505d46a6 --- /dev/null +++ b/regress/win32/tests/migration-volume-test.cmd @@ -0,0 +1,40 @@ +REM +REM Run a backup of the Bacula build directory on two Volumes +REM then migrate it to another device. +REM +REM This script uses the virtual disk autochanger +REM +SET TestName=migration-volume-test +SET JobName=MigVolBackup + +CALL scripts\functions set_debug 0 + +CALL config_out + +CALL scripts\cleanup +CALL scripts\copy-migration-confs +CALL scripts\prepare-two-disks + +ECHO %CD:\=/%/build >\tmp\file-list + +REM COPY bin\bacula-sd.conf tmp\1 +REM sed "s;# Maximum File Size; Maximum File Size;" tmp\1 >bin\bacula-sd.conf + +CALL scripts\functions change_jobname NightlySave %JobName% +CALL scripts\functions start_test + +REM +REM Note, we first backup into Pool Default, +REM then Migrate into Pool Full. +REM Pool Default uses Storage=File +REM Pool Full uses Storage=DiskChanger + +sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\migration-volume-test.bscr >tmp\bconcmds + +CALL scripts\functions run_bacula +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 diff --git a/regress/win32/tests/restore-disk-seek-test.cmd b/regress/win32/tests/restore-disk-seek-test.cmd index 9bdb24ff45..6fdfdbd60f 100644 --- a/regress/win32/tests/restore-disk-seek-test.cmd +++ b/regress/win32/tests/restore-disk-seek-test.cmd @@ -8,7 +8,7 @@ REM SET TestName=restore-disk-seek-test SET JobName=restore-disk-seek -CALL scripts\functions set_debug 0 +CALL scripts\functions set_debug 1 CALL scripts\functions copy_test_confs ECHO %CD:\=/%/tmp/build >\tmp\file-list @@ -17,7 +17,10 @@ IF EXIST tmp\build RD /s /q tmp\build MKDIR tmp\build REM Copy only the .c files (to be restored) -COPY build\src\dird\*.c tmp\build >nul 2>&1 +REM set files to "*.c" for all c files +SET files=ua_tree.c ua_update.c +REM SET files=*.c +FOR %%i in ( %files% ) DO COPY build\src\dird\%%i tmp\build >nul 2>&1 DIR /b tmp\build >tmp\1 sed -e "s;^;%CD:\=/%/tmp/build/;" tmp\1 >tmp\restore-list @@ -45,7 +48,7 @@ CALL scripts\functions stop_bacula REM Now setup a control directory of only what we *should* restore RD /s /q tmp\build MKDIR tmp\build -COPY build\src\dird\*.c tmp\build >nul 2>&1 +FOR %%i in ( %files% ) DO COPY build\src\dird\%%i tmp\build >nul 2>&1 CALL scripts\functions check_two_logs CALL scripts\functions check_restore_tmp_build_diff diff --git a/regress/win32/tests/span-vol-test.cmd b/regress/win32/tests/span-vol-test.cmd index cdc63aca85..52cbaffb77 100644 --- a/regress/win32/tests/span-vol-test.cmd +++ b/regress/win32/tests/span-vol-test.cmd @@ -10,7 +10,7 @@ SET JobName=SpanVol CALL scripts\functions set_debug 0 CALL scripts\functions copy_test_confs -echo %CD:\=/%/build >\tmp\file-list +ECHO %CD:\=/%/build >\tmp\file-list CALL scripts\functions change_jobname NightlySave %JobName% CALL scripts\functions start_test diff --git a/regress/win32/tests/sparse-compressed-test.cmd b/regress/win32/tests/sparse-compressed-test.cmd index f01e19aaed..e8b701dcf1 100644 --- a/regress/win32/tests/sparse-compressed-test.cmd +++ b/regress/win32/tests/sparse-compressed-test.cmd @@ -8,7 +8,7 @@ SET JobName=Sparse-conpressed CALL scripts\functions set_debug 0 CALL scripts\functions copy_test_confs -echo %CD:\=/%/build >\tmp\file-list +ECHO %CD:\=/%/build >\tmp\file-list CALL scripts\functions start_test diff --git a/regress/win32/tests/two-pool-test.cmd b/regress/win32/tests/two-pool-test.cmd index 54784e4f05..e2d9904c36 100644 --- a/regress/win32/tests/two-pool-test.cmd +++ b/regress/win32/tests/two-pool-test.cmd @@ -21,7 +21,7 @@ CALL scripts\prepare-two-disks REM Make a relatively large backup set 5 x source code directory REM Reduced to 1 for portable -echo %CD:\=/%/build >\tmp\file-list +ECHO %CD:\=/%/build >\tmp\file-list CALL scripts\functions start_test diff --git a/regress/win32/tests/two-vol-test.cmd b/regress/win32/tests/two-vol-test.cmd index a363fcccf8..ce59794572 100644 --- a/regress/win32/tests/two-vol-test.cmd +++ b/regress/win32/tests/two-vol-test.cmd @@ -8,7 +8,7 @@ SET JobName=TwoVol CALL scripts\functions set_debug 0 CALL scripts\functions copy_test_confs -echo %CD:\=/%/build >\tmp\file-list +ECHO %CD:\=/%/build >\tmp\file-list CALL scripts\functions change_jobname NightlySave %JobName% CALL scripts\functions start_test diff --git a/regress/win32/tests/two-volume-tape.cmd b/regress/win32/tests/two-volume-tape.cmd index 1528c5f26f..62e80ecaa9 100644 --- a/regress/win32/tests/two-volume-tape.cmd +++ b/regress/win32/tests/two-volume-tape.cmd @@ -18,7 +18,7 @@ CALL scripts\cleanup CALL scripts\copy-2tape-confs CALL scripts\prepare-two-tapes -ECHO "%CD:\=/%/build" >\tmp\file-list +ECHO %CD:\=/%/build >\tmp\file-list COPY bin\bacula-sd.conf tmp\1 sed -e "s%# Maximum File Size% Maximum File Size%g" >bin\bacula-sd.conf diff --git a/regress/win32/tests/two-volume-test.cmd b/regress/win32/tests/two-volume-test.cmd index cef3887c0d..9bfe9c88da 100644 --- a/regress/win32/tests/two-volume-test.cmd +++ b/regress/win32/tests/two-volume-test.cmd @@ -8,7 +8,7 @@ REM Note we use the viritual disk autochanger REM SET TestName=two-volume-test SET JobName=TwoVolume -CALL scripts\functions set_debug 0 +CALL scripts\functions set_debug 1 CALL config_out CALL scripts\cleanup -- 2.39.5