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