3 # Author: Eric Bollengier, 2010
6 # This script will test prune algo
9 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
10 echo " This test is will fail because of the workaround for the bug #5507"
11 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
15 TestName="prune-config-test"
19 scripts/copy-test-confs
23 echo $PWD/build/po > tmp/file-list
25 # We want to have pruning only when doing prune command
26 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "AutoPrune", "No", "Client")'
27 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Job Retention", "1s", "Client")'
29 # Add a new job with a different fileset
30 $bperl -e 'print get_resource("$conf/bacula-dir.conf", "Job", "NightlySave")' | \
31 sed s/NightlySave/DailySave/ | sed 's/Full Set/CompressedSet/' > $tmp/1
33 cat $tmp/1 >> $conf/bacula-dir.conf
35 cat <<EOF > ${cwd}/tmp/bconcmds
39 label storage=File volume=TestVolume001
40 run job=$JobName level=full yes
43 @exec "touch $cwd/build/po/fr.po"
44 run job=$JobName level=incremental yes
47 @exec "touch $cwd/build/po/de.po"
48 run job=$JobName level=incremental yes
51 @# run a second set of backup
52 run job=DailySave level=full yes
55 @exec "touch $cwd/build/po/fr.po"
56 run job=DailySave level=incremental yes
59 @exec "touch $cwd/build/po/de.po"
60 run job=DailySave level=incremental yes
65 @# should prune nothing
74 # should find nothing to prune
75 $bperl -e "check_prune_list('$tmp/log10.out')"
77 # rename the job to see if it's pruned
78 sed s/DailySave/DisabledBackup/ $conf/bacula-dir.conf > $tmp/1
79 mv $tmp/1 $conf/bacula-dir.conf
81 cat <<EOF > ${cwd}/tmp/bconcmds
85 @# should prune jobs using DailySave
93 $bperl -e "check_prune_list('$tmp/log11.out', 4, 5, 6)"
94 estat=$(($estat + $?))
96 # rename Full Set fileset to see if it will be pruned the next time
97 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "FileSet", "CompressedSet", "Job", "NightlySave")'
98 sed "s/Full Set/DisFullSet/g" $conf/bacula-dir.conf > $tmp/1
99 mv $tmp/1 $conf/bacula-dir.conf
101 cat <<EOF > ${cwd}/tmp/bconcmds
105 @# should prune jobs using Full Set
113 $bperl -e "check_prune_list('$tmp/log12.out', 1, 2, 3)"
114 estat=$(($estat + $?))
116 check_for_zombie_jobs storage=File