From 227bf2701a9b834d387a3754816f55fa30ccd0f0 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 17 Oct 2008 11:48:39 +0000 Subject: [PATCH] ebl Add an other test for Copy feature git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7828 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/tests/copy-jobspan-test | 82 +++++++++++++++++++++++++++++++++ regress/tests/copy-volume-test | 4 +- 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100755 regress/tests/copy-jobspan-test diff --git a/regress/tests/copy-jobspan-test b/regress/tests/copy-jobspan-test new file mode 100755 index 0000000000..78025fd2af --- /dev/null +++ b/regress/tests/copy-jobspan-test @@ -0,0 +1,82 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory then migrate it +# to another device. +# +# Test copy a job that spans two Volumes +# +# This script uses the virtual disk autochanger +# +TestName="copy-jobspan-test" +JobName=CopyJobSpanSave +. scripts/functions + + +scripts/cleanup +scripts/copy-migration-confs +scripts/prepare-disk-changer +echo "${cwd}/build" >${cwd}/tmp/file-list +cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1 +sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf +sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1 +sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf + +change_jobname NightlySave $JobName +start_test + +# +# Note, we first backup into Pool Default, +# then Copy into Pool Full. +# Pool Default uses Storage=File +# Pool Full uses Storage=DiskChanger + +# Write out bconsole commands +cat <${cwd}/tmp/bconcmds +@output +messages +@$out ${cwd}/tmp/log1.out +@#setdebug level=10 dir +@#setdebug level=100 storage=File +label storage=File volume=FileVolume001 Pool=Default +label storage=File volume=FileVolume002 Pool=Default +update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default +label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0 +label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0 +list volumes +@# +run job=$JobName yes +@#run job=$JobName yes +wait +list volumes +@#setdebug level=200 dir +@# should migrate both Volumes +run job=copy-job yes +wait +purge volume=FileVolume001 +purge volume=FileVolume002 +list volumes +list jobs +messages +wait +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger +unmark * +mark * +done +yes +wait +messages +@output +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=File +stop_bacula + +check_two_logs +check_restore_diff +end_test diff --git a/regress/tests/copy-volume-test b/regress/tests/copy-volume-test index dee1f8fdb1..f018d8e5c4 100755 --- a/regress/tests/copy-volume-test +++ b/regress/tests/copy-volume-test @@ -18,8 +18,8 @@ echo "${cwd}/build" >${cwd}/tmp/file-list #sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf change_jobname NightlySave $JobName -sed -i 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf -sed -i 's/Migrate/Copy/g' ${cwd}/bin/bacula-dir.conf +sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1 +sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf rm -f ${cwd}/build/po/test.po >/dev/null start_test -- 2.39.5