]> git.sur5r.net Git - bacula/bacula/blob - regress/win32/tests/usr-tape-root
Copy trunk regress into Branch
[bacula/bacula] / regress / win32 / 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/copy-tape-confs
8 scripts/cleanup-tape
9 echo "/usr" >${cwd}/tmp/file-list
10
11 echo " "
12 echo " "
13 echo " === Starting usr-tape-root test ==="
14 echo " "
15 echo " "
16
17 bin/bacula start 2>&1 >/dev/null
18 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
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 bin/bacula stop 2>&1 >/dev/null
38 cd /
39 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original
40 cd ${cwd}/tmp/bacula-restores
41 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/restored
42 cd ${cwd}/tmp
43 sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
44 sort <1 >original
45 #
46 sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
47 sort <1 >restored
48 rm -f 1
49 #
50 cd ${cwd}
51 diff tmp/original tmp/restored 2>&1 1>/dev/nul
52 if [ $? != 0 ] ; then
53    echo " "
54    echo " "
55    echo "  ===== !!!! usr-tape-root failed !!!! ===== "
56    echo "  ===== !!!! usr-tape-root failed !!!! ===== " >>test.out
57    echo " "
58 else
59    echo "  ===== usr-tape-root OK ===== "
60    echo "  ===== usr-tape-root OK ===== " >>test.out
61    scripts/cleanup
62 fi