From: Kern Sibbald Date: Wed, 12 Jan 2011 14:14:08 +0000 (+0100) Subject: Add restore replace=never test ticket 2317 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a5eaa8a9acd5bed5ed907e839023aa966d3bf13b;p=bacula%2Fbacula Add restore replace=never test ticket 2317 --- diff --git a/regress/tests/restore-replace-never-test b/regress/tests/restore-replace-never-test new file mode 100755 index 0000000000..d5542cec86 --- /dev/null +++ b/regress/tests/restore-replace-never-test @@ -0,0 +1,75 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory using the compressed option +# then restore it. +# + +TestName="restore-replace-never" +JobName=restore-replace-never +. scripts/functions + +scripts/cleanup +scripts/copy-test-confs +mkdir -p ${cwd}/tmp/dir/dir1 +touch ${cwd}/tmp/dir/dir1/file1 +touch ${cwd}/tmp/dir/dir1/file2 +echo ${cwd}/tmp/dir >${cwd}/tmp/file-list + +stat ${cwd}/tmp/dir >${cwd}/tmp/1 +stat ${cwd}/tmp/dir/dir1 >>${cwd}/tmp/1 +stat ${cwd}/tmp/dir/dir1/file1 >>${cwd}/tmp/1 +stat ${cwd}/tmp/dir/dir1/file2 >>${cwd}/tmp/1 +# Strip Change: lines +grep -v "Change:" ${cwd}/tmp/1 >${cwd}/tmp/stat-before + +change_jobname CompressedTest $JobName +start_test + +cat <${cwd}/tmp/bconcmds +@$out /dev/null +messages +@$out ${cwd}/tmp/log1.out +label storage=File volume=TestVolume001 +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bacula + +rm -rf ${cwd}/tmp/dir + +cat <${cwd}/tmp/bconcmds +@$out /dev/null +messages +@$out ${cwd}/tmp/log2.out +restore where=/ storage=File replace=never select all done yes +@#restore where=/ storage=File select all done yes +wait +messages +quit +END_OF_DATA + +run_bconsole + +stat ${cwd}/tmp/dir >${cwd}/tmp/1 +stat ${cwd}/tmp/dir/dir1 >>${cwd}/tmp/1 +stat ${cwd}/tmp/dir/dir1/file1 >>${cwd}/tmp/1 +stat ${cwd}/tmp/dir/dir1/file2 >>${cwd}/tmp/1 +# Strip Change: lines +grep -v "Change:" ${cwd}/tmp/1 >${cwd}/tmp/stat-after + +check_for_zombie_jobs storage=File +stop_bacula + +check_two_logs +if test "$debug" -eq 1 ; then + diff -u ${cwd}/tmp/stat-before ${cwd}/tmp/stat-after +else + diff -u ${cwd}/tmp/stat-before ${cwd}/tmp/stat-after 2>&1 >/dev/null +fi +if [ $? != 0 ]; then + dstat=1 +fi +end_test