]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/concurrent-jobs-test
FreeBSD fixes; manual updates
[bacula/bacula] / regress / tests / concurrent-jobs-test
1 #!/bin/sh
2 #
3 # Run two jobs at the same time
4 #
5 cwd=`pwd`
6 scripts/copy-test-confs
7 scripts/cleanup
8 echo "${cwd}/tmp/largefile" >/tmp/file-list
9 if test -c /dev/urandom ; then
10 # Create 56MB file with random data
11    echo "Creating a 56MB file with random data ..."
12    dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000
13 else
14    echo "Creating a 56MB file with bacula-dir data ..."
15    dd if=bin/bacula-dir of=${cwd}/tmp/1 bs=1024 count=1000
16    cat ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 >${cwd}/tmp/2
17    rm -f ${cwd}/tmp/1
18    cat ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 >>${cwd}/tmp/3
19    rm -f ${cwd}/tmp/2
20    cat ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 >${cwd}/tmp/largefile
21    rm -f ${cwd}/tmp/3
22 fi 
23
24 echo "largefile created"
25 bin/bacula stop 2>&1 >/dev/null
26 bin/drop_sqlite_tables
27 bin/make_sqlite_tables
28
29 echo " "
30 echo " "
31 echo " === Starting concurrent-jobs-test  ==="
32 echo " === Starting concurrent-jobs-test  ===" >>working/log
33 echo " "
34
35 bin/bacula start 2>&1 >/dev/null
36 bin/console -c bin/console.conf <<END_OF_DATA
37 @output /dev/null
38 messages
39 @output tmp/log1.out
40 label storage=File volume=TestVolume001
41 run job=CompressedTest level=Full yes
42 run job=CompressedTest level=Full yes
43 run job=CompressedTest level=Full yes
44 run job=CompressedTest level=Full yes
45 wait
46 messages
47 @# 
48 @# now do a restore
49 @#
50 @output tmp/log2.out
51 restore where=${cwd}/tmp/bacula-restores
52 5
53 done
54 yes
55 wait
56 messages
57 @output
58 quit
59 END_OF_DATA
60
61 bin/bacula stop 2>&1 >/dev/null
62 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
63 bstat=$?
64 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
65 rstat=$?
66 diff tmp/largefile  tmp/bacula-restores${cwd}/tmp/largefile 2>&1 >/dev/null
67 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
68    echo " "
69    echo " "
70    echo "  !!!!! concurrent-jobs-test Bacula source failed!!! !!!!! "
71    echo "  !!!!! concurrent-jobs-test failed!!! !!!!! " >>test.out
72    echo " "
73 else
74    echo "  ===== concurrent-jobs-test Bacula source OK ===== "
75    echo "  ===== concurrent-jobs-test OK ===== " >>test.out
76    scripts/cleanup
77 fi