]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/big-files-test
regress: Add test for bvfs-test with deleted files
[bacula/bacula] / regress / tests / big-files-test
1 #!/bin/sh
2 #
3 #  Test if Bacula can handle big fileset
4 #  This test create 2M files on a directory and
5 #  backup it twice in accurate mode.
6 #
7 #  Creating 2M files is very long, so the "many-files"
8 #  directory isn' cleaned at the end.
9 #
10
11 TestName="big-files-test"
12 JobName=BigFiles
13 . scripts/functions
14
15 copy_test_confs
16
17 echo "${cwd}/many-files" >${cwd}/tmp/file-list
18 if [ ! -f ${cwd}/many-files/100000file100000 ]; then
19     mkdir -p ${cwd}/many-files
20     cd ${cwd}/many-files
21     print_debug "Creating 2000000 files..."
22     time perl -e 'for($i=0; $i < 2000000; $i++) {open(FP, ">${i}file${i}") or die "$!"; print FP "$i\n"; close(FP); print "\r$i   " if ($i%10000);}'
23 fi
24
25 cd $cwd}
26
27 sed 's%# Label Format%  Label Format%' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
28 # sed 's%Type = Backup%Type = Backup; Accurate = yes%' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
29 sed 's%Type = Backup%Type = Backup%' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
30
31 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'Max Run Time', '90min', 'Job')"
32 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'SpoolData', 'no', 'Job')"
33
34 change_jobname MonsterFileSet $JobName
35 start_test
36
37 cat <<END_OF_SCRIPT >${cwd}/tmp/bconcmds
38 @$out /dev/null
39 messages
40 @$out ${cwd}/tmp/log1.out
41 status all
42 status all
43 list pools
44 messages
45 @#setdebug level=110 storage=File
46 run job=$JobName spooldata=no storage=File yes
47 list pools
48 list volumes
49 wait
50 sql
51 SELECT StartTime, JobFiles, JobId, Level, count(*) AS nb_jobmedia  
52 FROM JobMedia join Job using (JobId) join Client using (ClientId) 
53 where Client.Name = 'localhost-fd' group by JobId, Level, StartTime, 
54 JobFiles order by JobId desc ;
55
56 messages
57 run job=$JobName spooldata=no storage=File yes
58 wait
59 messages
60 @# 
61 @# now do a restore
62 @#
63 @$out ${cwd}/tmp/log2.out
64 @#setdebug level=400 storage=File
65 restore where=${cwd}/many-files/bacula-restores select storage=File
66 unmark *
67 mark *
68 count
69 find 10file10
70 pwd
71 estimate
72 done
73 yes
74 wait
75 messages
76 quit
77 END_OF_SCRIPT
78
79 run_bacula
80 check_for_zombie_jobs storage=File || exit 1
81 stop_bacula
82
83 check_two_logs
84
85 # we are really more interested to know if backup and restore 
86 # worked, but checking the files restored is non-trivial due
87 # to the big fileset exclusions
88 #  check_restore_diff
89
90 zstat=0
91 dstat=0
92 bstat=0
93 rstat=0
94 end_test