]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/etc-test-root
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / etc-test-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 Bacula build directory
9 #   then restore it.
10 #
11 TestName="etc-test-root"
12 . scripts/functions
13
14 scripts/cleanup
15 scripts/copy-test-confs
16 echo "/etc" >${cwd}/tmp/file-list
17
18 start_test
19
20 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
21 @$out /dev/null
22 messages
23 @$out ${cwd}/tmp/log1.out
24 label storage=File
25 TestVolume001
26 run job=NightlySave
27 yes
28 wait
29 messages
30 @# 
31 @# now do a restore
32 @#
33 @$out ${cwd}/tmp/log2.out
34 restore where=${cwd}/tmp/bacula-restores select    
35 unmark *
36 mark *
37 done
38 yes
39 wait
40 messages
41 quit
42 END_OF_DATA
43
44 run_bacula
45 check_for_zombie_jobs storage=File
46 stop_bacula
47
48 # more cleanup needed below
49
50 cd /
51 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1       
52 cd ${cwd}/tmp/bacula-restores
53 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/2
54 sort <${cwd}/tmp/1 >${cwd}/tmp/original
55 sort <${cwd}/tmp/2 >${cwd}/tmp/restored
56 rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
57 cd ${cwd}
58 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 1>/dev/null
59 if [ $? != 0 ] ; then
60    echo " "
61    echo " "
62    echo "  ===== !!!! etc-test-root failed !!!! ===== "
63    echo "  ===== !!!! etc-test-root failed !!!! ===== " >>test.out
64    echo " "
65 else
66    echo "  ===== etc-test-root OK ===== "
67    echo "  ===== etc-test-root OK ===== " >>test.out
68    scripts/cleanup
69 fi