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