]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/lib-tape-root
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / lib-tape-root
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # Run a simple backup of the /lib directory
9 #   then restore it.
10 #
11 cwd=`pwd`
12 . scripts/functions
13 scripts/cleanup
14 scripts/cleanup-tape
15 scripts/copy-tape-confs
16 echo "/lib" >${cwd}/tmp/file-list
17 echo " "
18 echo " "
19 echo " === Starting lib-tape-root test ==="
20 echo " "
21 echo " "
22
23 cat <<END_OF_DATA > >${cwd}/tmp/bconcmds
24 @$out /dev/null
25 messages
26 @$out ${cwd}/tmp/log1.out
27 label storage=tape Volume=TestVolume001 slot=0
28 run job=NightlySave yes
29 wait
30 messages
31 @# 
32 @# now do a restore
33 @#
34 @$out ${cwd}/tmp/log2.out
35 restore where=${cwd}/tmp/bacula-restores select all done
36 yes
37 wait
38 messages
39 quit
40 END_OF_DATA
41
42 run_bacula
43 stop_bacula
44
45 cd /
46 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original
47 cd ${cwd}/tmp/bacula-restores
48 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/restored
49 cd ${cwd}/tmp
50 sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
51 sort <1 >original
52 #
53 sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
54 sort <1 >restored
55 rm -f 1
56 #
57 cd ${cwd}
58 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 1>/dev/nul
59 if [ $? != 0 ] ; then
60    echo " "
61    echo " "
62    echo "  ===== lib-tape-root failed!!! ===== "
63    echo "  ===== lib-tape-root failed!!! ===== " >>test.out
64    echo " "
65 else
66    echo "  ===== lib-tape-root OK ===== "
67    echo "  ===== lib-tape-root OK ===== " >>test.out
68    scripts/cleanup
69 fi