]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/truncate-concurrent-test
regress: Add test to reproduce #3284 with reload command
[bacula/bacula] / regress / tests / truncate-concurrent-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 # Test truncate command in //
7 #
8 #
9 TestName="truncate-concurrent-test"
10 JobName=FIFOTest
11 . scripts/functions
12
13 cwd=`pwd`
14 scripts/cleanup
15 scripts/copy-test-confs
16
17 echo $src > $tmp/file-list
18
19 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaximumVolumeBytes', '2MB', 'Pool')"
20 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'ActionOnPurge', 'Truncate', 'Pool')"
21 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaximumConsoleConnections', 100, 'Director')"
22 $bperl -e "set_global_maximum_concurrent_jobs(100)"
23
24 start_test
25
26 cat >tmp/bconcmds <<END_OF_DATA
27 @$out /dev/null
28 messages
29 @$out $tmp/log1.out
30 add storage=File pool=Default
31 100
32 Vol
33 1
34
35 @########################################################
36 @# Run a first job on TestVolume001
37 @########################################################
38 run level=full job=$JobName yes
39 wait
40 messages
41 quit
42 END_OF_DATA
43
44 run_bacula
45 check_for_zombie_jobs storage=File
46 touch $tmp/log2.out
47
48 for i in `seq 0 5`
49 do
50     for j in `seq 0 9`
51     do
52         echo "purge volume=Vol00$i$j pool=Default storage=File" >> $tmp/purgecmd
53         echo "truncate volume=Vol00$i$j pool=Default storage=File" > $tmp/bconcmds-$i$j
54     done
55 done
56
57 run_bconsole $tmp/purgecmd
58
59 for i in $tmp/bconcmds-*
60 do
61     run_bconsole $i >> $tmp/truncate.log &
62 done
63 wait
64
65 grep "Cannot free Volume" $tmp/truncate.log > /dev/null
66 if [ $? -eq 0 ]; then
67     print_debug "WARNING: Should not find problems with 'Cannot free volume' in $tmp/truncate.log"
68 #   estat=1
69 fi
70
71 end_test