From 228688335ba7b41b2f52f4694979dfc2a1044868 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 17 Sep 2009 22:49:27 +0200 Subject: [PATCH] Add new test --- regress/tests/speed-test | 139 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100755 regress/tests/speed-test diff --git a/regress/tests/speed-test b/regress/tests/speed-test new file mode 100755 index 0000000000..b2379ef3e7 --- /dev/null +++ b/regress/tests/speed-test @@ -0,0 +1,139 @@ +#!/bin/sh +# +# Run a big test with backup of millions of files then run 100 incremental +# modifying 10% each time +# +TestName="speed-test" +JobName=speed +. scripts/functions + +${rscripts}/cleanup +${rscripts}/copy-test-confs +echo "${cwd}/files" >${tmp}/file-list +rm -rf ${tmp}/bacula-restores +mkdir -p $cwd/files + +change_jobname CompressedTest $JobName +if [ "$1" = "accurate" ]; then + sed 's/Name = "speed"/Name = "speed"; accurate=yes/' $conf/bacula-dir.conf > $tmp/1 + mv $tmp/1 $conf/bacula-dir.conf +fi + +start_test + +# Create X million of files +echo "Creating 1.5M files" +perl -e ' +my $dest="'$cwd/files'"; +my $base; +mkdir $dest; +$base = chr(1450000 % 26 + 65); +if (-f "$dest/$base/aaa1450000aaa$base") { + exit 0; +} +$| = 1; +for(my $i=0; $i < 26; $i++) { + $base = chr($i + 65); + mkdir("$dest/$base") or die "$dest/$base $!"; +} +for(my $i=0; $i<=1500000; $i++) { + $base = chr($i % 26 + 65); + open(FP, ">$dest/$base/aaa${i}aaa$base") or die "$dest/$base $!"; + print FP "$i\n"; + close(FP); + + mkdir "$dest/$base/$base$i$base" if (!($i % 100)); + print "." if (!($i % 10000)); +} +print "\n"; +' + +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +label storage=File volume=TestVolume001 +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=File + +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +run job=$JobName level=Full yes +wait +messages +quit +END_OF_DATA + +# insert 15 million files into File table +for i in $(seq 0 10) +do + run_bconsole +done + +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +run job=$JobName level=Incremental yes +wait +messages +quit +END_OF_DATA + + +for i in $(seq 0 25) +do + +perl -e ' +my $dest="'$cwd/files'"; +my $start="'$i'"; +my $base = chr($start + 65); + +opendir(DIR, "$dest/$base") || die "$!"; +map { + open(FP, ">$dest/$base/$_") or die "$_ $!"; + print FP "update $_\n"; + close(FP); +} grep { ! /^\./ } readdir(DIR); +closedir DIR; +' +run_bconsole + +done + +cat <${tmp}/bconcmds +@$out /dev/null +messages +@# +@# now do a restore +@# +@$out ${tmp}/log2.out +time +restore where=${tmp}/bacula-restores storage=File select all done yes +time +wait +time +status storage=File +messages +quit +END_OF_DATA + +run_bconsole +check_for_zombie_jobs storage=File +stop_bacula + +check_two_logs +#rm -rf ${tmp}/files + +find ${tmp}/bacula-restores | wc -l | tee $tmp/bacula-restore-list + +rm -rf ${tmp}/bacula-restores +end_test -- 2.39.5