#!/bin/sh # # Copyright (C) 2000-2015 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # # # Run a simple backup of the Bacula build directory # then restore it. # TestName="weird-files2-test" JobName=weird-files2 . scripts/functions if test ! -d weird-files ; then echo " " echo "weird files not configured. Test not run." exit 0 fi cwd=`pwd` scripts/cleanup scripts/copy-test-confs rm -rf weird-files2 cp -Rp weird-files weird-files2 echo "${cwd}/weird-files2" >${cwd}/tmp/file-list cd weird-files2 #perl socket.pl # we no longer restore sockets cd .. change_jobname NightlySave $JobName start_test #bin/testls weird-files2 | grep -v sock-file >${cwd}/tmp/original bin/testls weird-files2 >${cwd}/tmp/original cat <tmp/bconcmds @output /dev/null messages @$out tmp/log1.out label storage=File volume=TestVolume001 run job=$JobName yes wait messages @output quit END_OF_DATA run_bacula check_for_zombie_jobs storage=File # # Now mess up the a hard link, and a soft link # cd weird-files2 rm -f hard-file2 ln hard-file3 hard-file2 rm -f soft-file2 ln -s soft-file3 soft-file2 cd ${cwd} cat <tmp/bconcmds @output /dev/null messages @# @# now do a restore @# @$out tmp/log2.out restore where= storage=File 5 unmark * mark * done yes wait messages quit END_OF_DATA run_bconsole check_for_zombie_jobs storage=File stop_bacula bin/testls weird-files2 >${cwd}/tmp/restored check_two_logs diff -u ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null #diff -u ${cwd}/tmp/original ${cwd}/tmp/restored dstat=$? if test $dstat -ne 0; then diff -u ${cwd}/tmp/original ${cwd}/tmp/restored fi end_test