]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/big-files-test
Fix typo in maxtime-test
[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 change_jobname MonsterFileSet $JobName
32 start_test
33
34 cat <<END_OF_SCRIPT >${cwd}/tmp/bconcmds
35 @$out /dev/null
36 messages
37 @$out ${cwd}/tmp/log1.out
38 status all
39 status all
40 list pools
41 messages
42 @#setdebug level=110 storage=File
43 run job=$JobName storage=File yes
44 list pools
45 list volumes
46 wait
47 sql
48 SELECT StartTime, JobFiles, JobId, Level, count(*) AS nb_jobmedia  
49 FROM JobMedia join Job using (JobId) join Client using (ClientId) 
50 where Client.Name = 'localhost-fd' group by JobId, Level, StartTime, 
51 JobFiles order by JobId desc ;
52
53 messages
54 run job=$JobName storage=File yes
55 wait
56 messages
57 @# 
58 @# now do a restore
59 @#
60 @$out ${cwd}/tmp/log2.out
61 @#setdebug level=400 storage=File
62 restore where=${cwd}/tmp/bacula-restores select storage=File
63 unmark *
64 mark *
65 count
66 find 10file10
67 pwd
68 estimate
69 done
70 yes
71 wait
72 messages
73 quit
74 END_OF_SCRIPT
75
76 run_bacula
77 check_for_zombie_jobs storage=File || exit 1
78 stop_bacula
79
80 check_two_logs
81
82 # we are really more interested to know if backup and restore 
83 # worked, but checking the files restored is non-trivial due
84 # to the big fileset exclusions
85 #  check_restore_diff
86
87 zstat=0
88 dstat=0
89 bstat=0
90 rstat=0
91 end_test