ADD_TEST(disk:two-volume-test "@regressdir@/tests/two-volume-test")
ADD_TEST(disk:verify-cat-test "@regressdir@/tests/verify-cat-test")
ADD_TEST(disk:verify-vol-test "@regressdir@/tests/verify-vol-test")
+ADD_TEST(disk:virtual-changer-test "@regressdir@/tests/virtual-changer-test")
ADD_TEST(disk:weird-files2-test "@regressdir@/tests/weird-files2-test")
ADD_TEST(disk:weird-files-test "@regressdir@/tests/weird-files-test")
# Prefer Mounted Volumes = no
}
+Job {
+ Name = "Virtual"
+ Type = Backup
+ Client=@hostname@-fd
+ FileSet="Full Set"
+ Storage = Virtual
+ Messages = Standard
+ Pool = Default
+ Write Bootstrap = "@working_dir@/NightlySave.bsr"
+ Maximum Concurrent Jobs = 4
+ SpoolData = yes
+# Prefer Mounted Volumes = no
+}
Maximum Concurrent Jobs = 4
}
+# Definition of Virtual storage device
+Storage {
+ Name = Virtual
+ Address = @hostname@ # N.B. Use a fully qualified name here
+ SDPort = @sdport@
+ Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" # password for Storage daemon
+ Device = Virtual # must be same as Device in Storage daemon
+ Media Type = Disk # must be same as MediaType in Storage daemon
+ Maximum Concurrent Jobs = 4
+}
+
+
# Generic catalog service
# Maximum File Size = 1000000
}
+Autochanger {
+ Name = Virtual
+ Changer Device = /dev/null
+ Changer Command =""
+ Device = Virtual-1, Virtual-2
+}
+
+Device {
+ Name = Virtual-1
+ Device Type = File
+ Media Type = Disk
+ Archive Device = tmp
+ AutomaticMount = yes; # when device opened, read it
+ Autochanger = yes
+ Drive Index = 0
+ AlwaysOpen = yes;
+ RemovableMedia = yes;
+# Maximum File Size = 1000000
+}
+
+Device {
+ Name = Virtual-2
+ Device Type = File
+ Media Type = Disk
+ Archive Device = tmp
+ 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,
Name = DDS-4
Changer Device = @disk_drive@/conf
Changer Command ="@scriptdir@/disk-changer %c %o %S %a %d"
- Device = Drive-0
+ Device = Drive-0, Drive-1
}
Device {
}
Device {
- Name = FileStorage
- Media Type = FileMedia
- Archive Device = @tmpdir@
- LabelMedia = yes; # lets Bacula label unlabeled media
- Random Access = Yes;
+ Name = Drive-1 #
+ Device Type = File
+ Media Type = DDS-4
+ Archive Device = @disk_drive@/drive0
AutomaticMount = yes; # when device opened, read it
- RemovableMedia = no;
- AlwaysOpen = no;
+ Autochanger = yes
+ Drive Index = 1
+ AlwaysOpen = yes;
+ RemovableMedia = yes;
+# Maximum File Size = 1000000
+}
+
+
+Autochanger {
+ Name = Virtual
+ Changer Device = /dev/null
+ Changer Command =""
+ Device = Virtual-1, Virtual-2
}
+Device {
+ Name = Virtual-1
+ Device Type = File
+ Media Type = Disk
+ Archive Device = @disk_drive@/drive0
+ AutomaticMount = yes; # when device opened, read it
+ Autochanger = yes
+ Drive Index = 0
+ AlwaysOpen = yes;
+ RemovableMedia = yes;
+# Maximum File Size = 1000000
+}
+
+Device {
+ Name = Virtual-2
+ Device Type = File
+ Media Type = Disk
+ Archive Device = @disk_drive@/drive0
+ 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,
label storage=File1 volume=TestVolume001
label storage=File1 volume=TestVolume002
label storage=File1 volume=TestVolume003
+label storage=File1 volume=TestVolume004
+@# Note, this is going to fail if the pruning gets
+@# to tight because the saved volume is too large.
+@# In that case, either add another volume, or
+@# increase the volume capacity a bit.
update Volume=TestVolume001 volretention=10s
update Volume=TestVolume001 maxvolbytes=200000000
update Volume=TestVolume002 volretention=10s
update Volume=TestVolume002 maxvolbytes=200000000
update Volume=TestVolume003 volretention=10s
update Volume=TestVolume003 maxvolbytes=200000000
+update Volume=TestVolume004 volretention=10s
+update Volume=TestVolume004 maxvolbytes=200000000
list volumes
-@#setdebug level=100 storage=File1
+setdebug level=150 storage=File1
run job=$JobName storage=File1 level=full yes
run job=$JobName storage=File1 level=full yes
run job=$JobName storage=File1 level=full yes
@output /dev/null
messages
@$out tmp/log1.out
-@#setdebug level=150 storage=DDS-4
+setdebug level=150 storage=DDS-4
label storage=DDS-4 volume=TestVolume001 slot=1 pool=Full drive=0
label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default drive=0
list volumes
--- /dev/null
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory. Create three
+# tapes, each in a different pool, then run two jobs both of which
+# want the disk that is not loaded. Note, they both have
+# prefers non-mounted tapes. This should expose bug #801
+#
+# This script uses the virtual disk autochanger and two drives
+#
+TestName="virtual-changer-disk"
+JobName="virtualchangerdisk"
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-2disk-drive-confs
+scripts/prepare-two-disks
+
+echo "${cwd}/build" >${cwd}/tmp/file-list
+#change_jobname Virtual $JobName
+start_test
+
+# Turn off Prefer Mounted Volumes so we use 2 drives
+outf="${cwd}/tmp/sed_tmp"
+echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
+cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
+# Comment the next line out to write everything to one drive
+# otherwise, it writes the two jobs to different drives
+sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
+
+# Write out bconsole commands
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+@#setdebug level=200 storage=Virtual
+@#setdebug level=200 client
+label storage=Virtual volume=TestVolume001 slot=1 Pool=Default drive=0
+label storage=Virtual volume=TestVolume002 slot=2 Pool=Full drive=0
+label storage=Virtual volume=TestVolume003 slot=3 Pool=Inc drive=1
+status storage=Virtual
+run job=Virtual level=Full Pool=Default yes
+run job=Virtual level=Full Pool=Default yes
+run job=Virtual level=Full Pool=Default yes
+run job=Virtual level=Full Pool=Default yes
+run job=Virtual level=Full Pool=Default yes
+@sleep 10
+status storage=Virtual
+list volumes
+wait
+list volumes
+list jobs
+status storage=Virtual
+messages
+quit
+END_OF_DATA
+
+# exit
+
+run_bacula
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
+messages
+@#
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select all storage=Virtual done
+yes
+wait
+messages
+@$out
+quit
+END_OF_DATA
+
+run_bconsole
+
+check_for_zombie_jobs storage=Virtual
+stop_bacula
+
+check_two_logs
+check_restore_diff
+
+end_test