From ed3d95a3ca1cf1bdd788f53558aa96d0b1a76403 Mon Sep 17 00:00:00 2001 From: Alaa Eddine Elamri Date: Wed, 26 May 2021 16:57:55 +0100 Subject: [PATCH] systemtest: added test for truncating in multiplied-device test The extra lines in the test make sure first that the volumes are purged, and then makes sure they get truncated correctly with the right choice of drive --- .../tests/multiplied-device/testrunner | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/systemtests/tests/multiplied-device/testrunner b/systemtests/tests/multiplied-device/testrunner index 756584d5640..0ddba2d92c7 100755 --- a/systemtests/tests/multiplied-device/testrunner +++ b/systemtests/tests/multiplied-device/testrunner @@ -54,6 +54,17 @@ restore client=bareos-fd fileset=SelfTest where=$tmp/bareos-restores select all yes wait messages +@# +@# now purge and truncate +@# +@$out $tmp/log3.out +purge volume=Full-0001 +truncate volstatus=Purged drive=0 yes +purge volume=Full-0002 +truncate volstatus=Purged drive=1 yes +purge volume=Full-0003 +truncate volstatus=Purged drive=2 yes +messages quit END_OF_DATA @@ -84,4 +95,26 @@ if test $estat -ne 1 ; then fi fi +#make sure all volumes are purged +grep "There are no more Jobs associated with Volume \"Full-0001\". Marking it purged." "${tmp}"/log3.out >/dev/null 2>&1 && +grep "There are no more Jobs associated with Volume \"Full-0002\". Marking it purged." "${tmp}"/log3.out >/dev/null 2>&1 && +grep "There are no more Jobs associated with Volume \"Full-0003\". Marking it purged." "${tmp}"/log3.out >/dev/null 2>&1 +if test $? -ne 0 ; then + echo "The Purge command failed for a MultiFileStorage." + estat=1; +fi + + +#make sure all volumes are correctly truncated with the correct drive +grep "3000 OK label. VolBytes=223 Volume=\"Full-0001\" Device=\"MultiFileStorage0001\" (storage)" "${tmp}"/log3.out >/dev/null 2>&1 && +grep "3000 OK label. VolBytes=223 Volume=\"Full-0002\" Device=\"MultiFileStorage0002\" (storage)" "${tmp}"/log3.out >/dev/null 2>&1 && +grep "3000 OK label. VolBytes=223 Volume=\"Full-0003\" Device=\"MultiFileStorage0003\" (storage)" "${tmp}"/log3.out >/dev/null 2>&1 && +grep "The volume 'Full-0001' has been truncated." "${tmp}"/log3.out >/dev/null 2>&1 && +grep "The volume 'Full-0002' has been truncated." "${tmp}"/log3.out >/dev/null 2>&1 && +grep "The volume 'Full-0003' has been truncated." "${tmp}"/log3.out >/dev/null 2>&1 +if test $? -ne 0 ; then + echo "The Truncate command failed for a MultiFileStorage." + estat=1; +fi + end_test