From 3a01885b0bcb3b1bc6b542926fc85491af86c5cf Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 13 Dec 2010 03:41:14 +0100 Subject: [PATCH] Add short-incremental regression test --- regress/tests/short-incremental-test | 94 ++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 regress/tests/short-incremental-test diff --git a/regress/tests/short-incremental-test b/regress/tests/short-incremental-test new file mode 100755 index 0000000000..2fe51dd101 --- /dev/null +++ b/regress/tests/short-incremental-test @@ -0,0 +1,94 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory then create some +# new files, do an Incremental and restore those two files. +# +TestName="short-incremental-test" +JobName=Incremental +. scripts/functions + +${rscripts}/cleanup +${rscripts}/copy-test-confs +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 +start_test + +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +@#setdebug level=100 storage=File +@#setdebug level=200 client +@#setdebug level=100 director +label storage=File volume=TestVolume001 +label storage=File volume=TestVolume002 +run job=$JobName yes +status client +wait +messages +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=File +# +# Now create two new files to be restored later +# +sleep 1 +echo "ficheriro1.txt" >${tmpsrc}/ficheriro1.txt +cp -f ${tmpsrc}/dird.c ${tmpsrc}/ficheriro2.txt + +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +@# Force Incremental on the second Volume +update volume=TestVolume001 VolStatus=Used +run level=Differential job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bconsole + +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +setdebug level=200 storage=File +run level=Incremental job=$JobName yes +wait +messages +@# +@# now do a restore +@# +@$out ${tmp}/log2.out +setdebug level=10 storage=File +restore where=${tmp}/bacula-restores storage=File file=<${tmp}/restore-list +yes +wait +status client +status storage=File +messages +quit +END_OF_DATA + +run_bconsole +check_for_zombie_jobs storage=File +stop_bacula + +check_two_logs +# +# Delete .c files because we will only restored the txt files +# +rm -f ${tmpsrc}/*.c +check_restore_tmp_build_diff +end_test -- 2.39.5