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
20 bin/drop_sqlite_tables
21 bin/make_sqlite_tables
24 echo " === Starting /dev save/restore test ==="
27 bin/bacula start 2>&1 >/dev/null
28 bin/console -c bin/console.conf <<END_OF_DATA
42 restore where=${cwd}/tmp/bacula-restores select all
49 bin/bacula stop 2>&1 >/dev/null
51 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original
52 cd ${cwd}/tmp/bacula-restores
53 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored
55 cat >sed.scr <<END_OF_DATA
57 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ptmx%dev/ptmx%
58 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ttyp1%dev/ttyp1%
59 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/null%dev/null%
61 sed -f sed.scr original | sort >original
63 sed -f sed.scr restored | sort >restored
67 diff tmp/original tmp/restored 2>&1 1>/dev/null 2>&1 1>/dev/null
71 echo " ===== dev test failed!!! ===== "
72 echo " ===== dev test failed!!! ===== " >>test.out
75 echo " ===== dev test OK ===== "
76 echo " ===== dev test OK ===== " >>test.out