]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/concurrent-jobs-test
Clean up for Solaris
[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
41 TestVolume001
42 run job=CompressedTest level=Full
43 yes
44 run job=CompressedTest level=Full
45 yes
46 run job=CompressedTest level=Full
47 yes
48 run job=CompressedTest level=Full
49 yes
50 wait
51 messages
52 @# 
53 @# now do a restore
54 @#
55 @output tmp/log2.out
56 restore where=${cwd}/tmp/bacula-restores
57 5
58 done
59 yes
60 wait
61 messages
62 @output
63 quit
64 END_OF_DATA
65
66 bin/bacula stop 2>&1 >/dev/null
67 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
68 bstat=$?
69 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
70 rstat=$?
71 diff tmp/largefile  tmp/bacula-restores${cwd}/tmp/largefile
72 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
73    echo " "
74    echo " "
75    echo "  !!!!! concurrent-jobs-test Bacula source failed!!! !!!!! "
76    echo "  !!!!! concurrent-jobs-test failed!!! !!!!! " >>test.out
77    echo " "
78 else
79    echo "  ===== concurrent-jobs-test Bacula source OK ===== "
80    echo "  ===== concurrent-jobs-test OK ===== " >>test.out
81    scripts/cleanup
82 fi