]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/concurrent-jobs-test
Make verify job log same as other logs -- fixes bug #2328
[bacula/bacula] / regress / tests / concurrent-jobs-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 # Run two jobs at the same time
7 #
8
9 TestName="concurrent-jobs-test"
10 JobName=concurrent-jobs
11 . scripts/functions
12
13 copy_test_confs
14
15 echo "${cwd}/tmp/largefile" >${cwd}/tmp/file-list
16 if test -c /dev/urandom ; then
17 # Create 56MB file with random data
18 #  echo "Creating a 56MB file with random data ..."
19    dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000 2>&1 1>/dev/null
20 else
21 #  echo "Creating a 56MB file with bacula-dir data ..."
22    dd if=$bin/bacula-dir of=${cwd}/tmp/1 bs=1024 count=1000 2>&1 1>/dev/null
23    cat ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 >${cwd}/tmp/2
24    rm -f ${cwd}/tmp/1
25    cat ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 >>${cwd}/tmp/3
26    rm -f ${cwd}/tmp/2
27    cat ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 >${cwd}/tmp/largefile
28    rm -f ${cwd}/tmp/3
29 fi 
30
31 #echo "largefile created"
32
33 change_jobname CompressedTest $JobName
34 start_test
35      
36 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
37 @$out /dev/null
38 messages
39 @$out  ${cwd}/tmp/log1.out
40 label storage=File volume=TestVolume001
41 run job=$JobName level=Full yes
42 run job=$JobName level=Full yes
43 run job=$JobName level=Full yes
44 run job=$JobName level=Full yes
45 wait
46 messages
47 @# 
48 @# now do a restore
49 @#
50 @$out   ${cwd}/tmp/log2.out
51 restore where=${cwd}/tmp/bacula-restores select storage=File
52 unmark *
53 mark *
54 done
55 yes
56 wait
57 messages
58 @output
59 quit
60 END_OF_DATA
61
62 run_bacula
63 check_for_zombie_jobs storage=File
64 stop_bacula
65
66 check_two_logs
67 diff ${cwd}/tmp/largefile  ${cwd}/tmp/bacula-restores${cwd}/tmp/largefile 2>&1 >/dev/null
68 dstat=$?
69 end_test