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-root not run !!!! ===== "
11 echo " ===== !!!! dev-test-root not run !!!! ===== " >>test.out
16 scripts/copy-test-confs
18 echo "/dev" >/tmp/file-list
22 echo " === Starting dev-test-root test ==="
24 echo " === Note, this test can fail for trivial ==="
25 echo " === reasons on non-Linux systems. ==="
29 bin/bacula start 2>&1 >/dev/null
30 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
34 label storage=File volume=TestVolume001
35 run job=NightlySave yes
42 restore where=${cwd}/tmp/bacula-restores select all done
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
56 # Use sed to cut out parts that *always* change
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%
65 # strip file system change messages then sed and sort
66 grep -v "Skip: File system change prohibited." original >1
67 sed -f sed.scr 1 | sort >original
70 sed -f sed.scr 1 | sort >restored
74 diff tmp/original tmp/restored 2>&1 1>/dev/null
78 echo " ===== !!!! dev-test-root failed !!!! ===== "
79 echo " ===== !!!! dev-test-root failed !!!! ===== " >>test.out
82 echo " ===== dev-test-root OK ===== "
83 echo " ===== dev-test-root OK ===== " >>test.out