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