From: Eric Bollengier Date: Thu, 15 Aug 2024 14:33:27 +0000 (+0200) Subject: regress: Add prune-many-jobs-test X-Git-Tag: Release-15.0.3~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40a373311fbc5e0d3dbc3d419da5eef9ee584e60;p=thirdparty%2Fbacula.git regress: Add prune-many-jobs-test --- diff --git a/regress/tests/prune-many-jobs-test b/regress/tests/prune-many-jobs-test new file mode 100755 index 000000000..a4bd3f608 --- /dev/null +++ b/regress/tests/prune-many-jobs-test @@ -0,0 +1,79 @@ +#!/bin/sh +# +# Copyright (C) 2000-2021 Kern Sibbald +# Copyright (C) 2021-2024 Bacula Systems SA +# License: BSD 2-Clause; see file LICENSE-FOSS +# +# This script will test prune algo +# +. scripts/functions + +TestName="prune-many-jobs-test" +JobName=NightlySave + +scripts/cleanup +scripts/copy-test-confs + +setup_shstore # simulate shared storage if enabled + +start_test + +echo $PWD/build/po > tmp/file-list + +# We want to have pruning only when doing prune command +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "AutoPrune", "No", "Client")' +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "Job Retention", "1s", "Client")' +$bperl -e 'set_global_maximum_concurrent_jobs(100)' + +cat < ${cwd}/tmp/bconcmds +@output /dev/null +messages +@$out $tmp/log1.out +label storage=File volume=TestVolume001 +run job=$JobName level=full yes +wait +messages +@exec "touch $build/po/fr.po" +EOF + +for i in `seq 1 3000`; do + echo "run job=$JobName yes" >> $tmp/bconcmds +done + +cat <> $tmp/bconcmds +wait +messages +quit +EOF + +run_bacula + +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "AutoPrune", "Yes", "Client")' + +cat < $tmp/bconcmds +@$out $tmp/log1.out +reload +run job=$JobName level=full yes +wait +messages +@$out $tmp/log2.out +restore select all done yes where=$tmp/bacula-restores +wait +messages +quit +EOF + +run_bconsole + + +check_for_zombie_jobs storage=File +check_two_logs +stop_bacula + +grep "Pruned 3001 Jobs for client" $tmp/log1.out > /dev/null +if [ $? -ne 0 ]; then + print_debug "ERROR: Should find a large pruning list in $tmp/log1.out" + estat=1 +fi + +end_test