]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-concurrent-jobs-test
Change test name
[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/console -c bin/console.conf <<END_OF_DATA
21 @output /dev/null
22 messages
23 @output tmp/log1.out
24 label storage=File1
25 TestVolume001
26 label storage=File1
27 TestVolume002
28 update Volume=TestVolume001
29 6
30 100000000
31 @#50000000
32 10
33 run job=NightlySave level=Full Storage=File1
34 yes
35 run job=NightlySave level=Full Storage=File1
36 yes
37 run job=NightlySave level=Full Storage=File1
38 yes
39 run job=NightlySave level=Full Storage=File1
40 yes
41 @sleep 2
42 status dir
43 @sleep 5
44 messages
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 -r build tmp/bacula-restores${cwd}/build
67 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
68    echo " "
69    echo " "
70    echo "  !!!!! four-concurrent-jobs-test Bacula source failed!!! !!!!! "
71    echo "  !!!!! four-concurrent-jobs-test failed!!! !!!!! " >>test.out
72    echo " "
73    exit 1
74 else
75    echo "  ===== four-concurrent-jobs-test Bacula source OK ===== "
76    echo "  ===== four-concurrent-jobs-test OK ===== " >>test.out
77    scripts/cleanup
78    exit 0
79 fi