]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/dev-test-root
Change test name
[bacula/bacula] / regress / tests / dev-test-root
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then restore it.
5 #
6 echo " "
7 echo " "
8 echo " === /dev save/restore test ==="
9 echo " "
10 echo " "
11 if [ $UID != 0 ] ; then
12    echo " "
13    echo "You must be root to run this test."
14    echo "  ===== dev test failed!!! ===== "
15    echo "  ===== dev test failed!!! ===== " >>test.out
16    echo " "
17    exit 1
18 fi
19 cwd=`pwd`
20 scripts/copy-test-confs
21 echo "/dev" >/tmp/file-list
22 rm -rf /tmp/TestVolume001 /tmp/bacula-restores
23 bin/bacula stop 
24 bin/drop_sqlite_tables
25 bin/make_sqlite_tables
26 bin/bacula start
27 bin/console -c bin/console.conf <<END_OF_DATA
28 @output /dev/null
29 messages
30 label storage=File
31 TestVolume001
32 run job=NightlySave
33 yes
34 wait
35 messages
36 @# 
37 @# now do a restore
38 @#
39 restore
40 5
41 done
42 yes
43 @sleep 1
44 wait
45 messages
46 @output
47 quit
48 END_OF_DATA
49 bin/bacula stop
50 cd /
51 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original
52 cd /tmp/bacula-restores
53 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored
54 diff /tmp/original /tmp/restored
55 if [ $? != 0 ] ; then
56    echo " "
57    echo " "
58    echo "  ===== dev test failed!!! ===== "
59    echo "  ===== dev test failed!!! ===== " >>test.out
60    echo " "
61 else
62    echo "  ===== dev test OK ===== "
63    echo "  ===== dev test OK ===== " >>test.out
64    rm -rf /tmp/bacula-restores ${cwd}/tmp/original ${cwd}/tmp/restored
65    rm -rf /tmp/file-list /tmp/job /tmp/TestVolume001
66 fi