/
2drive-concurrent-test
executable file
·105 lines (97 loc) · 1.91 KB
/
2drive-concurrent-test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/sh
#
# Run four jobs at the same time, with two Volumes.
# Set max Vol bytes of first volume
# to less than total backup to force Bareos to use the second
# Volume.
#
TestName="2drive-concurrent-test"
JobName=Four-concurrent-jobs
. scripts/functions
scripts/cleanup
scripts/copy-2disk-drive-confs
scripts/prepare-disk-changer
CLIENT=2drive2disk
change_jobname NightlySave $JobName
start_test
# Directory to backup.
# This directory will be created by setup_data().
BackupDirectory="${tmp}/data"
# Use a tgz to setup data to be backed up.
# Data will be placed at "${tmp}/data/".
setup_data data/small.tgz
# the default fileset FS_TESTJOB backups all file and directories defined in "${tmp}/file-list".
echo "${BackupDirectory}" >${tmp}/file-list
cat <<END_OF_DATA >${cwd}/tmp/bconcmds
@$out /dev/null
messages
@$out ${cwd}/tmp/log1.out
label pool=Default storage=tape volume=TestVolume001 slot=1 drive=0
label pool=Default storage=tape volume=TestVolume002 slot=2 drive=1
update Volume=TestVolume001 MaxVolBytes=100000000
@#50000000
@#12
@#ssetdebug level=200 Storage=tape
status storage=tape
list jobs
list volumes
run job=$JobName level=Full Storage=tape
yes
@#reload
list jobs
list volumes
run job=$JobName level=Full Storage=tape
yes
@#reload
list jobs
list volumes
run job=$JobName level=Full Storage=tape
yes
@#reload
list jobs
list volumes
status storage=tape
run job=$JobName level=Full Storage=tape
yes
status storage=tape
@#reload
@#reload
@#reload
@#reload
@sleep 2
status dir
status storage=tape
@#reload
@sleep 5
list jobs
list volumes
messages
@#reload
@#reload
wait
status storage=tape
@#reload
messages
@#
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
status storage=tape
restore where=${cwd}/tmp/bareos-restores select storage=tape
unmark *
mark *
done
yes
wait
@#reload
@#reload
messages
@output
quit
END_OF_DATA
run_bareos
check_for_zombie_jobs storage=tape
stop_bareos
check_two_logs
check_restore_diff
end_test