]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/concurrent-jobs-test
5231c09674db6f62fd2a0b3db2145cd2a2792777
[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 set_debug 0
10
11 scripts/copy-test-confs
12 scripts/cleanup
13 echo "${cwd}/tmp/largefile" >/tmp/file-list
14 if test -c /dev/urandom ; then
15 # Create 56MB file with random data
16    echo "Creating a 56MB file with random data ..."
17    dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000
18 else
19    echo "Creating a 56MB file with bacula-dir data ..."
20    dd if=bin/bacula-dir of=${cwd}/tmp/1 bs=1024 count=1000
21    cat ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 >${cwd}/tmp/2
22    rm -f ${cwd}/tmp/1
23    cat ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 >>${cwd}/tmp/3
24    rm -f ${cwd}/tmp/2
25    cat ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 >${cwd}/tmp/largefile
26    rm -f ${cwd}/tmp/3
27 fi 
28
29 echo "largefile created"
30
31 start_test
32      
33 cat <<END_OF_DATA >tmp/bconcmds
34 @output /dev/null
35 messages
36 @$out  tmp/log1.out
37 label storage=File volume=TestVolume001
38 run job=CompressedTest level=Full yes
39 run job=CompressedTest level=Full yes
40 run job=CompressedTest level=Full yes
41 run job=CompressedTest level=Full yes
42 wait
43 messages
44 @# 
45 @# now do a restore
46 @#
47 @$out   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 check_restore_diff
65 end_test