]> git.sur5r.net Git - bacula/bacula/blob - regress/regress/tests/lib-tape-root
Copy trunk regress into Branch-2.2
[bacula/bacula] / regress / regress / tests / lib-tape-root
1 #!/bin/sh
2 #
3 # Run a simple backup of the /lib directory
4 #   then restore it.
5 #
6 cwd=`pwd`
7 . scripts/functions
8 bin/bacula stop 2>&1 >/dev/null
9 cd bin
10 ./drop_bacula_tables >/dev/null 2>&1
11 ./make_bacula_tables >/dev/null 2>&1
12 ./grant_bacula_privileges 2>&1 >/dev/null
13 cd ..
14
15 scripts/cleanup-tape
16 scripts/copy-tape-confs
17 echo "/lib" >${cwd}/tmp/file-list
18 echo " "
19 echo " "
20 echo " === Starting lib-tape-root test ==="
21 echo " "
22 echo " "
23 bin/bacula start 2>&1 >/dev/null
24 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
25 @output /dev/null
26 messages
27 @output ${cwd}/tmp/log1.out
28 label storage=DDS-4 Volume=TestVolume001 slot=0
29 run job=NightlySave yes
30 wait
31 messages
32 @# 
33 @# now do a restore
34 @#
35 @output ${cwd}/tmp/log2.out
36 restore where=${cwd}/tmp/bacula-restores select all done
37 yes
38 wait
39 messages
40 @output
41 quit
42 END_OF_DATA
43 bin/bacula stop 2>&1 >/dev/null
44 cd /
45 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original
46 cd ${cwd}/tmp/bacula-restores
47 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/restored
48 cd ${cwd}/tmp
49 sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
50 sort <1 >original
51 #
52 sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
53 sort <1 >restored
54 rm -f 1
55 #
56 cd ${cwd}
57 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 1>/dev/nul
58 if [ $? != 0 ] ; then
59    echo " "
60    echo " "
61    echo "  ===== lib-tape-root failed!!! ===== "
62    echo "  ===== lib-tape-root failed!!! ===== " >>test.out
63    echo " "
64 else
65    echo "  ===== lib-tape-root OK ===== "
66    echo "  ===== lib-tape-root OK ===== " >>test.out
67    scripts/cleanup
68 fi