]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/usr-tape-root
Add new tape tests
[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 bin/bacula stop 2>&1 >/dev/null
8 bin/drop_sqlite_tables
9 bin/make_sqlite_tables
10
11 scripts/copy-tape-confs
12 scripts/cleanup-tape
13 echo "/usr" >/tmp/file-list
14 echo " "
15 echo " "
16 echo " === Starting usr-tape-root test ==="
17 echo " "
18 echo " "
19 bin/bacula start 2>&1 >/dev/null
20 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
21 @tee /dev/null
22 messages
23 @tee tmp/log1.out
24 label storage=DDS-4 Volume=TestVolume001 slot=0
25 run job=NightlySave yes
26 wait
27 messages
28 @# 
29 @# now do a restore
30 @#
31 @tee tmp/log2.out
32 restore where=${cwd}/tmp/bacula-restores select all
33 yes
34 wait
35 messages
36 @tee
37 quit
38 END_OF_DATA
39 bin/bacula stop 2>&1 >/dev/null
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