3 # This script will test prune algo
6 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
7 echo " This test is will fail because of the workaround for the bug #5507"
8 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
12 TestName="prune-config-test"
16 scripts/copy-test-confs
20 echo $PWD/build/po > tmp/file-list
22 # We want to have pruning only when doing prune command
23 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "AutoPrune", "No", "Client")'
24 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Job Retention", "1s", "Client")'
26 # Add a new job with a different fileset
27 $bperl -e 'print get_resource("$conf/bacula-dir.conf", "Job", "NightlySave")' | \
28 sed s/NightlySave/DailySave/ | sed 's/Full Set/CompressedSet/' > $tmp/1
30 cat $tmp/1 >> $conf/bacula-dir.conf
32 cat <<EOF > ${cwd}/tmp/bconcmds
36 label storage=File volume=TestVolume001
37 run job=$JobName level=full yes
40 @exec "touch $cwd/build/po/fr.po"
41 run job=$JobName level=incremental yes
44 @exec "touch $cwd/build/po/de.po"
45 run job=$JobName level=incremental yes
48 @# run a second set of backup
49 run job=DailySave level=full yes
52 @exec "touch $cwd/build/po/fr.po"
53 run job=DailySave level=incremental yes
56 @exec "touch $cwd/build/po/de.po"
57 run job=DailySave level=incremental yes
62 @# should prune nothing
71 # should find nothing to prune
72 $bperl -e "check_prune_list('$tmp/log10.out')"
74 # rename the job to see if it's pruned
75 sed s/DailySave/DisabledBackup/ $conf/bacula-dir.conf > $tmp/1
76 mv $tmp/1 $conf/bacula-dir.conf
78 cat <<EOF > ${cwd}/tmp/bconcmds
82 @# should prune jobs using DailySave
90 $bperl -e "check_prune_list('$tmp/log11.out', 4, 5, 6)"
91 estat=$(($estat + $?))
93 # rename Full Set fileset to see if it will be pruned the next time
94 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "FileSet", "CompressedSet", "Job", "NightlySave")'
95 sed "s/Full Set/DisFullSet/g" $conf/bacula-dir.conf > $tmp/1
96 mv $tmp/1 $conf/bacula-dir.conf
98 cat <<EOF > ${cwd}/tmp/bconcmds
102 @# should prune jobs using Full Set
110 $bperl -e "check_prune_list('$tmp/log12.out', 1, 2, 3)"
111 estat=$(($estat + $?))
113 check_for_zombie_jobs storage=File