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=$?
}
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=$?
}
# 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
${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
# 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 <<END_OF_DATA >${tmp}/bconcmds
@output /dev/null
run_bconsole
sleep 1
-touch ${tmp}/build/ficheriro1.txt
-touch ${tmp}/build/ficheriro2.txt
+touch ${tmpsrc}/ficheriro1.txt
+touch ${tmpsrc}/ficheriro2.txt
cat <<END_OF_DATA >${tmp}/bconcmds
@output /dev/null
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
run_bconsole
sleep 1
-touch ${tmp}/build/ficheriro1.txt
-touch ${tmp}/build/ficheriro2.txt
+touch ${tmpsrc}/ficheriro1.txt
+touch ${tmpsrc}/ficheriro2.txt
cat <<END_OF_DATA >${tmp}/bconcmds
@output /dev/null
messages
run_bconsole
sleep 1
-touch ${tmp}/build/ficheriro1.txt
-touch ${tmp}/build/ficheriro2.txt
+touch ${tmpsrc}/ficheriro1.txt
+touch ${tmpsrc}/ficheriro2.txt
cat <<END_OF_DATA >${tmp}/bconcmds
@output /dev/null
messages
run_bconsole
sleep 1
-touch ${tmp}/build/ficheriro1.txt
-touch ${tmp}/build/ficheriro2.txt
+touch ${tmpsrc}/ficheriro1.txt
+touch ${tmpsrc}/ficheriro2.txt
cat <<END_OF_DATA >${tmp}/bconcmds
@output /dev/null
messages
run_bconsole
sleep 1
-touch ${tmp}/build/ficheriro1.txt
-touch ${tmp}/build/ficheriro2.txt
+touch ${tmpsrc}/ficheriro1.txt
+touch ${tmpsrc}/ficheriro2.txt
cat <<END_OF_DATA >${tmp}/bconcmds
@output /dev/null
#
# 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