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