From bbc6d5338ba32469e6200c9759dcfb3f7f9dc20d Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 26 Jan 2010 11:04:48 +0100 Subject: [PATCH] regress: Add test for comment field --- regress/tests/comment-test | 102 +++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100755 regress/tests/comment-test diff --git a/regress/tests/comment-test b/regress/tests/comment-test new file mode 100755 index 0000000000..9f266a3573 --- /dev/null +++ b/regress/tests/comment-test @@ -0,0 +1,102 @@ +#!/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="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 +run comment="This is a comment for $JobName" job=$JobName yes +status client +@sleep 5 +status dir +label storage=File volume=TestVolume001 +mount storage=File +wait +messages +@$out $tmp/log3.out +sql +SELECT Comment FROM Job WHERE JobId=1; + +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 comment="This is the incremental job" level=Differential job=$JobName yes +@sleep 5 +status dir +label storage=File volume=TestVolume002 +mount storage=File +wait +messages +@$out $tmp/log3.out +sql +SELECT Comment FROM Job WHERE JobId=2; + +quit +END_OF_DATA + +run_bconsole + +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log2.out +@# +@# now do a restore +@# +restore comment="Ticket #1220 requested by toto@bacula.org" where=${tmp}/bacula-restores storage=File file=<${tmp}/restore-list +yes +status dir +wait +messages +@$out $tmp/log3.out +sql +SELECT Comment FROM Job WHERE JobId=3; + +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