]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/usr-tape-root
ebl tweak regress scripts to be able to change binary location
[bacula/bacula] / regress / tests / usr-tape-root
1 #!/bin/sh
2 #
3 # Run a simple backup of the /usr directory
4 #   then restore it.
5 #
6 cwd=`pwd`
7 . scripts/functions
8 scripts/copy-tape-confs
9 scripts/cleanup-tape
10 echo "/usr" >${cwd}/tmp/file-list
11
12 echo " "
13 echo " "
14 echo " === Starting usr-tape-root test ==="
15 echo " "
16 echo " "
17
18 cat <<END_OF_DATA > ${cwd}/tmp/bconcmds
19 @output /dev/null
20 messages
21 @output 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 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 run_bacula
38 stop_bacula
39
40 cd /
41 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original
42 cd ${cwd}/tmp/bacula-restores
43 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/restored
44 cd ${cwd}/tmp
45 sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
46 sort <1 >original
47 #
48 sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
49 sort <1 >restored
50 rm -f 1
51 #
52 cd ${cwd}
53 diff tmp/original tmp/restored 2>&1 1>/dev/nul
54 if [ $? != 0 ] ; then
55    echo " "
56    echo " "
57    echo "  ===== !!!! usr-tape-root failed !!!! ===== "
58    echo "  ===== !!!! usr-tape-root failed !!!! ===== " >>test.out
59    echo " "
60 else
61    echo "  ===== usr-tape-root OK ===== "
62    echo "  ===== usr-tape-root OK ===== " >>test.out
63    scripts/cleanup
64 fi