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