3 # Run a simple backup of the Bacula build directory
7 if [ $MUID != 0 ] ; then
9 echo "You must be root to run this test."
10 echo " ===== dev test failed!!! ===== "
11 echo " ===== dev test failed!!! ===== " >>test.out
16 scripts/copy-test-confs
18 echo "/dev" >/tmp/file-list
19 bin/bacula stop 2>&1 >/dev/null
21 ./drop_bacula_tables >/dev/null 2>&1
22 ./make_bacula_tables >/dev/null 2>&1
23 ./grant_bacula_privileges 2>&1 >/dev/null
27 echo " === Starting /dev save/restore test ==="
30 bin/bacula start 2>&1 >/dev/null
31 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
45 restore where=${cwd}/tmp/bacula-restores select all done
52 bin/bacula stop 2>&1 >/dev/null
54 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original
55 cd ${cwd}/tmp/bacula-restores
56 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored
58 cat >sed.scr <<END_OF_DATA
60 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ptmx%dev/ptmx%
61 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ttyp1%dev/ttyp1%
62 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/null%dev/null%
64 sed -f sed.scr original | sort >original
66 sed -f sed.scr restored | sort >restored
70 diff tmp/original tmp/restored 2>&1 1>/dev/null 2>&1 1>/dev/null
74 echo " ===== dev test failed!!! ===== "
75 echo " ===== dev test failed!!! ===== " >>test.out
78 echo " ===== dev test OK ===== "
79 echo " ===== dev test OK ===== " >>test.out