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