#!/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 " ===== lib-test-root failed!!! ===== " echo " ===== lib-test-root failed!!! ===== " >>test.out echo " " exit 1 fi cwd=`pwd` scripts/copy-test-confs scripts/cleanup echo "/lib" >/tmp/file-list bin/bacula stop 2>&1 >/dev/null bin/drop_sqlite_tables bin/make_sqlite_tables echo " " echo " " echo " === Starting /lib save/restore test ===" echo " " echo " " bin/bacula start 2>&1 >/dev/null bin/console -c bin/console.conf <&1 >/dev/null cd / ${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/original cd ${cwd}/tmp/bacula-restores ${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/restored cd ${cwd}/tmp sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1 sort <1 >original # sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1 sort <1 >restored rm -f 1 # cd ${cwd} diff tmp/original tmp/restored 2>&1 1>/dev/nul if [ $? != 0 ] ; then echo " " echo " " echo " ===== lib-test-root failed!!! ===== " echo " ===== lib-test-root failed!!! ===== " >>test.out echo " " else echo " ===== lib-test-root OK ===== " echo " ===== lib-test-root OK ===== " >>test.out scripts/cleanup fi