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