Skip to content

Commit

Permalink
systemtest: added test for truncating in multiplied-device test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alaaeddineelamri authored and pstorz committed Jun 9, 2021
1 parent 42b42e0 commit ed3d95a
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions systemtests/tests/multiplied-device/testrunner
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit ed3d95a

Please sign in to comment.