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