From 6e186a8310935ca89f1c83f3e804c868524d1ed8 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 4 Apr 2008 06:31:17 +0000 Subject: [PATCH] Add swap test git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6738 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/DartTestfile.txt.in | 1 + regress/tests/2drive-2job-test | 82 ++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100755 regress/tests/2drive-2job-test diff --git a/regress/DartTestfile.txt.in b/regress/DartTestfile.txt.in index 078bf717de..6999985180 100644 --- a/regress/DartTestfile.txt.in +++ b/regress/DartTestfile.txt.in @@ -43,6 +43,7 @@ ADD_TEST(disk:sparse-test "@regressdir@/tests/sparse-test") ADD_TEST(disk:2drive-3pool-test "@regressdir@/tests/2drive-3pool-test") ADD_TEST(disk:2drive-concurrent-test "@regressdir@/tests/2drive-concurrent-test") ADD_TEST(disk:2drive-incremental-2disk "@regressdir@/tests/2drive-incremental-2disk") +ADD_TEST(disk:2drive-2job-test "@regressdir@/tests/2drive-2job-test") ADD_TEST(disk:three-pool-test "@regressdir@/tests/three-pool-test") ADD_TEST(disk:tls-test "@regressdir@/tests/tls-test") ADD_TEST(disk:two-jobs-test "@regressdir@/tests/two-jobs-test") diff --git a/regress/tests/2drive-2job-test b/regress/tests/2drive-2job-test new file mode 100755 index 0000000000..0b4e068423 --- /dev/null +++ b/regress/tests/2drive-2job-test @@ -0,0 +1,82 @@ +#!/bin/sh +# +# Set prefer mounted volumes to no to try to force use of +# the drive swap code. +# +# This script uses the virtual disk autochanger and two drives +# +TestName="2drive-2job" +JobName="2drive2job" +. scripts/functions + +scripts/cleanup +scripts/copy-2disk-drive-confs +scripts/prepare-two-disks + +change_jobname NightlySave $JobName +start_test + +echo "${cwd}/build" >${cwd}/tmp/file-list + +# Turn off Prefer Mounted Volumes so we use 2 drives +outf="${cwd}/tmp/sed_tmp" +echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf} +cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1 +# Comment the next line out to write everything to one drive +# otherwise, it writes the two jobs to different drives +sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf + +# Write out bconsole commands +cat <${cwd}/tmp/bconcmds +@output /dev/null +messages +@$out ${cwd}/tmp/log1.out +label storage=DDS-4 volume=TestVolume001 slot=2 Pool=Default drive=0 +label storage=DDS-4 volume=TestVolume002 slot=1 Pool=Default drive=1 +status storage=DDS-4 +@#unmount storage=DDS-4 drive=0 +@#unmount storage=DDS-4 drive=1 +@#mount storage=DDS-4 slot=2 drive=0 +@#mount storage=DDS-4 slot=1 drive=1 +status storage=DDS-4 +setdebug level=120 storage=DDS-4 +run job=$JobName level=Full yes +@sleep 2 +run job=$JobName level=Full yes +status storage=DDS-4 +wait +list volumes +list jobs +status storage=DDS-4 +messages +quit +END_OF_DATA + +run_bacula + +cat <${cwd}/tmp/bconcmds +@$out /dev/null +messages +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +@#unmount storage=DDS-4 drive=0 +@#unmount storage=DDS-4 drive=1 +@#mount storage=DDS-4 slot=1 drive=0 +@#mount storage=DDS-4 slot=2 drive=1 +restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done +yes +wait +messages +@$out +quit +END_OF_DATA + +run_bconsole +check_for_zombie_jobs storage=DDS-4 +stop_bacula + +check_two_logs +check_restore_diff + +end_test -- 2.39.5