1#!/bin/sh
2#
3# Run four jobs at the same time, with four Volumes, but set
4#   Maximum Job Volumes = 1 on each of the Volumes.  Note,
5#   Volume 2 will probably have two jobs on it.  Something to
6#   be fixed in a later version.
7#
8TestName="maxvol-test"
9JobName=maxvol
10. scripts/functions
11
12scripts/cleanup
13scripts/copy-test-confs
14
15cp -f ${conf}/bareos-dir.conf ${cwd}/tmp/1
16sed "s%# Maximum Volume Jobs%  Maximum Volume Jobs%" ${cwd}/tmp/1 >${conf}/bareos-dir.conf
17
18
19change_jobname NightlySave $JobName
20
21
22# Directory to backup.
23# This directory will be created by setup_data().
24BackupDirectory="${tmp}/data"
25
26# Use a tgz to setup data to be backuped.
27# Data will be placed at "${tmp}/data/".
28setup_data data/small.tgz
29
30# the default fileset FS_TESTJOB backups all file and directories defined in "${tmp}/file-list".
31echo "${BackupDirectory}" >${tmp}/file-list
32
33
34start_test
35
36cat <<END_OF_DATA >${cwd}/tmp/bconcmds
37@$out /dev/null
38messages
39@$out   ${cwd}/tmp/log1.out
40label storage=File1 volume=TestVolume001
41label storage=File1 volume=TestVolume002
42label storage=File1 volume=TestVolume003
43label storage=File1 volume=TestVolume004
44update Volume=TestVolume001 MaxVolBytes=100000000
45@#50000000
46@#12
47setdebug level=100 Storage=File1
48llist volume=TestVolume001
49llist volume=TestVolume002
50run job=$JobName level=Full Storage=File1 yes
51run job=$JobName level=Full Storage=File1 yes
52run job=$JobName level=Full Storage=File1 yes
53wait
54list volumes
55llist volume=TestVolume001
56llist volume=TestVolume002
57messages
58@#
59@# now do a restore
60@#
61@$out   ${cwd}/tmp/log2.out
62restore where=${cwd}/tmp/bareos-restores select storage=File1
63unmark *
64mark *
65done
66yes
67wait
68@#reload
69@#reload
70messages
71quit
72END_OF_DATA
73
74run_bareos
75check_for_zombie_jobs storage=File1
76stop_bareos
77
78check_two_logs
79check_restore_diff
80end_test
81