#!/bin/sh # # Run a simple backup of the Bacula build directory # then restore it. # MUID=`/usr/bin/id -u` if [ $MUID != 0 ] ; then echo " " echo "You must be root to run this test." echo " ===== !!!! dev-test-root not run !!!! ===== " echo " ===== !!!! dev-test-root not run !!!! ===== " >>test.out echo " " exit 1 fi cwd=`pwd` scripts/copy-test-confs scripts/cleanup echo "/dev" >/tmp/file-list echo " " echo " " echo " === Starting dev-test-root test ===" echo " " echo " === Note, this test can fail for trivial ===" echo " === reasons on non-Linux systems. ===" echo " " echo " " bin/bacula start 2>&1 >/dev/null bin/bconsole -c bin/bconsole.conf <&1 >/dev/null cd / ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original cd ${cwd}/tmp/bacula-restores ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored cd ${cwd}/tmp # # Use sed to cut out parts that *always* change # cat >sed.scr <1 sed -f sed.scr 1 | sort >original # mv -f restored 1 sed -f sed.scr 1 | sort >restored rm -f sed.scr # cd ${cwd} diff tmp/original tmp/restored 2>&1 1>/dev/null if [ $? != 0 ] ; then echo " " echo " " echo " ===== !!!! dev-test-root failed !!!! ===== " echo " ===== !!!! dev-test-root failed !!!! ===== " >>test.out echo " " else echo " ===== dev-test-root OK ===== " echo " ===== dev-test-root OK ===== " >>test.out scripts/cleanup fi