]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl add test for fileregexp bsr code
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 30 Mar 2009 13:03:10 +0000 (13:03 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 30 Mar 2009 13:03:10 +0000 (13:03 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8650 91ce42f0-d328-0410-95d8-f526ca767f89

regress/DartTestfile.txt.in
regress/all-disk-tests
regress/tests/fileregexp-test [new file with mode: 0644]

index 7a9841def6a521b699bc5158ee2fa0f7245f01f7..da0b92b837274b84893ed5f7c4dc6dbf43c65590 100644 (file)
@@ -22,6 +22,7 @@ ADD_TEST(disk:differential-test "@regressdir@/tests/differential-test")
 ADD_TEST(disk:encrypt-bug-test "@regressdir@/tests/encrypt-bug-test")
 ADD_TEST(disk:fast-two-pool-test "@regressdir@/tests/fast-two-pool-test")
 ADD_TEST(disk:fifo-test "@regressdir@/tests/fifo-test")
+ADD_TEST(disk:fileregexp-test "@regressdir@/tests/fileregexp-test")
 ADD_TEST(disk:four-concurrent-jobs-test "@regressdir@/tests/four-concurrent-jobs-test")
 ADD_TEST(disk:four-jobs-test "@regressdir@/tests/four-jobs-test")
 ADD_TEST(disk:hardlink-test "@regressdir@/tests/hardlink-test")
index 8133f89c36d629ae877cd46bd6d7307693f9e5cf..4de54856d27b90475df953f1364fd0f8c248ebc8 100755 (executable)
@@ -24,6 +24,7 @@ nice tests/copy-volume-test
 nice tests/data-encrypt-test
 nice tests/encrypt-bug-test
 nice tests/fifo-test
+nice tests/fileregexp-test
 nice tests/backup-to-null
 nice tests/regexwhere-test
 # The following two can uses *lots* of disk space
diff --git a/regress/tests/fileregexp-test b/regress/tests/fileregexp-test
new file mode 100644 (file)
index 0000000..ce7f7f7
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory
+#   then restore it.
+#
+TestName="fileregexp-test"
+JobName=backup
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-confs
+
+#
+# Zap out any schedule in default conf file so that
+#  it doesn't start during our test
+#
+outf="tmp/sed_tmp"
+echo "s%  Schedule =%# Schedule =%g" >${outf}
+echo "s%File Retention =%File Retention = 2 #%" >>  ${outf}
+cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
+sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
+
+change_jobname Client1 $JobName
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+label volume=TestVolume001 storage=File pool=Default
+run job=$JobName yes
+wait
+messages
+@sleep 5
+prune files yes
+@# 
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out  
+restore where=${cwd}/tmp/bacula-restores
+5
+no
+README
+yes
+wait
+messages
+@$out
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+COUNT_OTHER=`find ${cwd}/tmp/bacula-restores -type f | grep -v README | wc -l`
+COUNT_README=`find ${cwd}/tmp/bacula-restores -type f | grep README | wc -l`
+
+if [ $COUNT_OTHER -gt 0 -o $COUNT_README -lt 15 ]; then
+    print_debug "Found non matching files"
+    print_debug `find ${cwd}/tmp/bacula-restores -type f | grep -v README`
+    rstat=2
+fi
+
+#check_two_logs         # don't work because of "warning file count mismatch"
+grep "Backup OK" ${cwd}/tmp/log1.out > /dev/null
+if [ $? -ne 0 ]; then
+    print_debug "Found error on backup"
+    bstat=2
+fi
+
+end_test