]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-jobs-test
a6e576731d6bcb768c4cb9acd455c088d4c954be
[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 messages
24 @output tmp/log1.out
25 label storage=File
26 TestVolume001
27 run job=CompressedTest
28 yes
29 wait
30 messages
31 quit
32 END_OF_DATA
33 echo "Backup 1 done"
34 touch ${cwd}/build/src/dird/*.c
35 #
36 # run a second job
37 #
38 bin/console -c bin/console.conf <<END_OF_DATA
39 messages
40 @output tmp/log1.out
41 run job=CompressedTest
42 yes
43 wait
44 messages
45 @# 
46 @# now do a restore
47 @#
48 @output tmp/log2.out
49 restore
50 5
51 done
52 yes
53 wait
54 messages
55 @output
56 quit
57 END_OF_DATA
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
64 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
65    echo " "
66    echo " "
67    echo "  ===== two-jobs-test Bacula source failed!!! ===== "
68    echo "  ===== two-jobs-test failed!!! ===== " >>test.out
69    echo " "
70 else
71    echo "  ===== two-jobs-test Bacula source OK ===== "
72    echo "  ===== two-jobs-test OK ===== " >>test.out
73    scripts/cleanup
74 fi