3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Author: Eric Bollengier, 2010
11 # This script will test prune algo
14 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
15 echo " This test is will fail because of the workaround for the bug #5507"
16 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
20 TestName="prune-config-test"
24 scripts/copy-test-confs
28 echo $PWD/build/po > tmp/file-list
30 # We want to have pruning only when doing prune command
31 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "AutoPrune", "No", "Client")'
32 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Job Retention", "1s", "Client")'
34 # Add a new job with a different fileset
35 $bperl -e 'print get_resource("$conf/bacula-dir.conf", "Job", "NightlySave")' | \
36 sed s/NightlySave/DailySave/ | sed 's/Full Set/CompressedSet/' > $tmp/1
38 cat $tmp/1 >> $conf/bacula-dir.conf
40 cat <<EOF > ${cwd}/tmp/bconcmds
44 label storage=File volume=TestVolume001
45 run job=$JobName level=full yes
48 @exec "touch $cwd/build/po/fr.po"
49 run job=$JobName level=incremental yes
52 @exec "touch $cwd/build/po/de.po"
53 run job=$JobName level=incremental yes
56 @# run a second set of backup
57 run job=DailySave level=full yes
60 @exec "touch $cwd/build/po/fr.po"
61 run job=DailySave level=incremental yes
64 @exec "touch $cwd/build/po/de.po"
65 run job=DailySave level=incremental yes
70 @# should prune nothing
79 # should find nothing to prune
80 $bperl -e "check_prune_list('$tmp/log10.out')"
82 # rename the job to see if it's pruned
83 sed s/DailySave/DisabledBackup/ $conf/bacula-dir.conf > $tmp/1
84 mv $tmp/1 $conf/bacula-dir.conf
86 cat <<EOF > ${cwd}/tmp/bconcmds
90 @# should prune jobs using DailySave
98 $bperl -e "check_prune_list('$tmp/log11.out', 4, 5, 6)"
99 estat=$(($estat + $?))
101 # rename Full Set fileset to see if it will be pruned the next time
102 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "FileSet", "CompressedSet", "Job", "NightlySave")'
103 sed "s/Full Set/DisFullSet/g" $conf/bacula-dir.conf > $tmp/1
104 mv $tmp/1 $conf/bacula-dir.conf
106 cat <<EOF > ${cwd}/tmp/bconcmds
110 @# should prune jobs using Full Set
118 $bperl -e "check_prune_list('$tmp/log12.out', 1, 2, 3)"
119 estat=$(($estat + $?))
121 check_for_zombie_jobs storage=File