]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-jobs-test
fc66da77e98db99c90a773a139fade022861662b
[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  ===" >>tmp/log
18 echo " "
19
20 bin/bacula start
21 bin/console -c bin/console.conf <<END_OF_DATA
22 @output /dev/null
23 messages
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 run job=CompressedTest
39 yes
40 wait
41 messages
42 @output
43 @# 
44 @# now do a restore
45 @#
46 restore
47 5
48 done
49 yes
50 wait
51 @output /dev/null
52 messages
53 quit
54 END_OF_DATA
55 bin/bacula stop
56 diff -ur build /tmp/bacula-restores${cwd}/build
57 if [ $? != 0 ] ; then
58    echo " "
59    echo " "
60    echo "  ===== two-jobs-test Bacula source failed!!! ===== "
61    echo "  ===== two-jobs-test failed!!! ===== " >>test.out
62    echo " "
63 else
64    echo "  ===== two-jobs-test Bacula source OK ===== "
65    echo "  ===== two-jobs-test OK ===== " >>test.out
66    scripts/cleanup
67 fi