From ec2cca7217a896cfad3d2a59e51ed0f2cc4989a6 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 9 May 2009 15:41:27 +0000 Subject: [PATCH] More parameterization of scripts git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8817 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/scripts/functions | 12 ++++++---- regress/tests/incremental-test | 40 +++++++++++++++++----------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/regress/scripts/functions b/regress/scripts/functions index 38033a99c7..15aea13106 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -272,9 +272,9 @@ check_two_logs() check_restore_diff() { if test "$debug" -eq 1 ; then - diff -ur build ${tmp}/bacula-restores${cwd}/build + diff -ur ${src} ${tmp}/bacula-restores${src} else - diff -ur build ${tmp}/bacula-restores${cwd}/build 2>&1 >/dev/null + diff -ur ${src} ${tmp}/bacula-restores${src} 2>&1 >/dev/null fi dstat=$? } @@ -282,9 +282,9 @@ check_restore_diff() check_restore_tmp_build_diff() { if test "$debug" -eq 1 ; then - diff -ur ${tmp}/build ${tmp}/bacula-restores${cwd}/tmp/build + diff -ur ${tmpsrc} ${tmp}/bacula-restores${tmpsrc} else - diff -ur ${tmp}/build ${tmp}/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null + diff -ur ${tmpsrc} ${tmp}/bacula-restores${tmpsrc} 2>&1 >/dev/null fi dstat=$? } @@ -447,12 +447,16 @@ scripts=${scripts:-"$bin"} # Regress scripts rscripts=${rscripts:-"$cwd/scripts"} tmp=${tmp:-"$cwd/tmp"} +src=${src:-"$cwd/build"} +tmpsrc=${tmpsrc:-"$cwd/tmp/build"} export bin export working export scripts export rscripts export tmp +export src +export tmpsrc touch ${tmp}/dir.out ${tmp}/fd.out ${tmp}/sd.out diff --git a/regress/tests/incremental-test b/regress/tests/incremental-test index 0d8afba264..b0015674d5 100755 --- a/regress/tests/incremental-test +++ b/regress/tests/incremental-test @@ -9,12 +9,12 @@ JobName=Incremental ${rscripts}/cleanup ${rscripts}/copy-test-confs -echo "${tmp}/build" >${tmp}/file-list -mkdir ${tmp}/build -cp -p ${cwd}/build/src/dird/*.c ${tmp}/build -cd ${cwd}/tmp -echo "${tmp}/build/ficheriro1.txt" >restore-list -echo "${tmp}/build/ficheriro2.txt" >>restore-list +echo "${tmpsrc}" >${tmp}/file-list +mkdir -p ${tmpsrc} +cp -p ${src}/src/dird/*.c ${tmpsrc} +cd ${tmp} +echo "${tmpsrc}/ficheriro1.txt" >restore-list +echo "${tmpsrc}/ficheriro2.txt" >>restore-list cd ${cwd} change_jobname CompressedTest $JobName @@ -39,8 +39,8 @@ check_for_zombie_jobs storage=File # Now create two new files to be restored later # sleep 1 -echo "ficheriro1.txt" >${tmp}/build/ficheriro1.txt -cp -f ${tmp}/build/dird.c ${tmp}/build/ficheriro2.txt +echo "ficheriro1.txt" >${tmpsrc}/ficheriro1.txt +cp -f ${tmpsrc}/dird.c ${tmpsrc}/ficheriro2.txt cat <${tmp}/bconcmds @output /dev/null @@ -57,8 +57,8 @@ END_OF_DATA run_bconsole sleep 1 -touch ${tmp}/build/ficheriro1.txt -touch ${tmp}/build/ficheriro2.txt +touch ${tmpsrc}/ficheriro1.txt +touch ${tmpsrc}/ficheriro2.txt cat <${tmp}/bconcmds @output /dev/null @@ -73,7 +73,7 @@ END_OF_DATA run_bconsole sleep 1 -cd ${tmp}/build +cd ${tmpsrc} cp -f ficheriro2.txt 1 sed "s%a%b%g" 1 >ficheriro2.txt rm -f 1 @@ -91,8 +91,8 @@ END_OF_DATA run_bconsole sleep 1 -touch ${tmp}/build/ficheriro1.txt -touch ${tmp}/build/ficheriro2.txt +touch ${tmpsrc}/ficheriro1.txt +touch ${tmpsrc}/ficheriro2.txt cat <${tmp}/bconcmds @output /dev/null messages @@ -106,8 +106,8 @@ END_OF_DATA run_bconsole sleep 1 -touch ${tmp}/build/ficheriro1.txt -touch ${tmp}/build/ficheriro2.txt +touch ${tmpsrc}/ficheriro1.txt +touch ${tmpsrc}/ficheriro2.txt cat <${tmp}/bconcmds @output /dev/null messages @@ -121,8 +121,8 @@ END_OF_DATA run_bconsole sleep 1 -touch ${tmp}/build/ficheriro1.txt -touch ${tmp}/build/ficheriro2.txt +touch ${tmpsrc}/ficheriro1.txt +touch ${tmpsrc}/ficheriro2.txt cat <${tmp}/bconcmds @output /dev/null messages @@ -135,8 +135,8 @@ END_OF_DATA run_bconsole sleep 1 -touch ${tmp}/build/ficheriro1.txt -touch ${tmp}/build/ficheriro2.txt +touch ${tmpsrc}/ficheriro1.txt +touch ${tmpsrc}/ficheriro2.txt cat <${tmp}/bconcmds @output /dev/null @@ -168,6 +168,6 @@ check_two_logs # # Delete .c files because we will only restored the txt files # -rm -f ${tmp}/build/*.c +rm -f ${tmpsrc}/*.c check_restore_tmp_build_diff end_test -- 2.39.5