From 2d790e2a923b85dd552bcdd2625f1fd495b06f41 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 12 Jan 2011 15:14:08 +0100 Subject: [PATCH] Add restore replace=never test ticket 2317 --- regress/tests/restore-replace-never-test | 75 ++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100755 regress/tests/restore-replace-never-test 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 -- 2.39.5