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