]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-concurrent-jobs-test
8a0281d8112b0f6babbfd2cd48fbb7bcc7ac7ffc
[bacula/bacula] / regress / tests / four-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}/build" >/tmp/file-list
9 bin/bacula stop 2>&1 >/dev/null
10 bin/drop_sqlite_tables
11 bin/make_sqlite_tables
12
13 echo " "
14 echo " "
15 echo " === Starting four-concurrent-jobs-test  ==="
16 echo " === Starting four-concurrent-jobs-test  ===" >>working/log
17 echo " "
18
19 #bin/bacula start 2>&1 >/dev/null
20 bin/bacula start
21 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
22 @output /dev/null
23 messages
24 @output tmp/log1.out
25 label storage=File1
26 TestVolume001
27 label storage=File1
28 TestVolume002
29 update Volume=TestVolume001 MaxVolBytes=100000000
30 @#50000000
31 12
32 run job=NightlySave level=Full Storage=File1
33 yes
34 run job=NightlySave level=Full Storage=File1
35 yes
36 run job=NightlySave level=Full Storage=File1
37 yes
38 run job=NightlySave level=Full Storage=File1
39 yes
40 @sleep 2
41 status dir
42 @sleep 5
43 messages
44 wait
45 messages
46 @# 
47 @# now do a restore
48 @#
49 @output tmp/log2.out
50 restore where=${cwd}/tmp/bacula-restores select all
51 yes
52 wait
53 messages
54 @output
55 quit
56 END_OF_DATA
57
58 bin/bacula stop 2>&1 >/dev/null
59 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
60 bstat=$?
61 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
62 rstat=$?
63 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
64 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
65    echo " "
66    echo " "
67    echo "  !!!!! four-concurrent-jobs-test Bacula source failed!!! !!!!! "
68    echo "  !!!!! four-concurrent-jobs-test failed!!! !!!!! " >>test.out
69    echo " "
70    exit 1
71 else
72    echo "  ===== four-concurrent-jobs-test Bacula source OK ===== "
73    echo "  ===== four-concurrent-jobs-test OK ===== " >>test.out
74    scripts/cleanup
75    exit 0
76 fi