]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-jobs-test
Change test name
[bacula/bacula] / regress / tests / two-jobs-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory using the compressed option
4 #   then backup a second time and finally restore it
5 #
6 cwd=`pwd`
7 scripts/copy-test-confs
8 scripts/cleanup
9 echo "${cwd}/build" >/tmp/file-list
10 bin/bacula stop 2>&1 >/dev/null
11 bin/drop_sqlite_tables
12 bin/make_sqlite_tables
13
14 echo " "
15 echo " "
16 echo " === Starting two-jobs-test  ==="
17 echo " === Starting two-jobs-test  ===" >>working/log
18 echo " "
19
20 bin/bacula start 2>&1 >/dev/null
21 bin/console -c bin/console.conf <<END_OF_DATA
22 @output /dev/null
23 estimate job=CompressedTest listing
24 estimate job=CompressedTest listing
25 estimate job=CompressedTest listing
26 messages
27 @output tmp/log1.out
28 label storage=File
29 TestVolume001
30 run job=CompressedTest
31 yes
32 wait
33 messages
34 quit
35 END_OF_DATA
36 echo "Backup 1 done"
37 touch ${cwd}/build/src/dird/*.c
38 #
39 # run a second job
40 #
41 bin/console -c bin/console.conf <<END_OF_DATA
42 @output /dev/null
43 messages
44 @output tmp/log1.out
45 run job=CompressedTest
46 yes
47 wait
48 messages
49 @# 
50 @# now do several restores to ensure we cleanup between jobs
51 @#
52 @output /dev/null
53 restore current all
54 yes
55 wait
56 restore current all    
57 yes
58 wait
59 @output tmp/log2.out
60 restore current all    
61 yes
62 wait
63 messages
64 @output
65 quit
66 END_OF_DATA
67 bin/bacula stop 2>&1 >/dev/null
68 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
69 bstat=$?
70 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
71 rstat=$?
72 diff -r build /tmp/bacula-restores${cwd}/build
73 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
74    echo " "
75    echo " "
76    echo "  !!!!! two-jobs-test Bacula source failed!!! !!!!! "
77    echo "  !!!!! two-jobs-test failed!!! !!!!! " >>test.out
78    echo " "
79 else
80    echo "  ===== two-jobs-test Bacula source OK ===== "
81    echo "  ===== two-jobs-test OK ===== " >>test.out
82    scripts/cleanup
83 fi