]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/concurrent-jobs-test
1cb0580ce9df08f174ef025b0b140ff62e988b81
[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 copy_test_confs
12
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 change_jobname CompressedTest $JobName
32 start_test
33      
34 cat <<END_OF_DATA >tmp/bconcmds
35 @output /dev/null
36 messages
37 @$out  tmp/log1.out
38 label storage=File volume=TestVolume001
39 run job=$JobName level=Full yes
40 run job=$JobName level=Full yes
41 run job=$JobName level=Full yes
42 run job=$JobName level=Full yes
43 wait
44 messages
45 @# 
46 @# now do a restore
47 @#
48 @$out   tmp/log2.out
49 restore where=${cwd}/tmp/bacula-restores select storage=File
50 unmark *
51 mark *
52 done
53 yes
54 wait
55 messages
56 @output
57 quit
58 END_OF_DATA
59
60 run_bacula
61 check_for_zombie_jobs storage=File
62 stop_bacula
63
64 check_two_logs
65 diff tmp/largefile  tmp/bacula-restores${cwd}/tmp/largefile 2>&1 >/dev/null
66 dstat=$?
67 end_test