From 69da12ddb27d33634f7af22cd906ae9100dd4c71 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 10 Sep 2009 15:09:50 +0200 Subject: [PATCH] Add exclude-dir-test --- regress/DartTestfile.txt.in | 1 + regress/all-disk-tests | 1 + regress/tests/exclude-dir-test | 100 +++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100755 regress/tests/exclude-dir-test diff --git a/regress/DartTestfile.txt.in b/regress/DartTestfile.txt.in index 1069df0c4b..e1bd890934 100644 --- a/regress/DartTestfile.txt.in +++ b/regress/DartTestfile.txt.in @@ -21,6 +21,7 @@ ADD_TEST(disk:data-encrypt-test "@regressdir@/tests/data-encrypt-test") ADD_TEST(disk:differential-test "@regressdir@/tests/differential-test") ADD_TEST(disk:encrypt-bug-test "@regressdir@/tests/encrypt-bug-test") ADD_TEST(disk:estimate-test "@regressdir@/tests/estimate-test") +ADD_TEST(disk:exclude-dir-test "@regressdir@/tests/exclude-dir-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") diff --git a/regress/all-disk-tests b/regress/all-disk-tests index b5912d76f9..60a30e919d 100755 --- a/regress/all-disk-tests +++ b/regress/all-disk-tests @@ -24,6 +24,7 @@ nice tests/copy-volume-test nice tests/data-encrypt-test nice tests/encrypt-bug-test nice tests/estimate-test +nice tests/exclude-dir-test nice tests/fifo-test nice tests/fileregexp-test nice tests/backup-to-null diff --git a/regress/tests/exclude-dir-test b/regress/tests/exclude-dir-test new file mode 100755 index 0000000000..6cfacc7057 --- /dev/null +++ b/regress/tests/exclude-dir-test @@ -0,0 +1,100 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory using the compressed option +# then backup a second time and finally restore it +# +TestName="exclude-dir-test" +JobName=exclude-dir +. scripts/functions + +cwd=`pwd` +scripts/cleanup +scripts/copy-test-confs +cat >> $conf/bacula-dir.conf <$tmp/1 +cp -f $tmp/1 $conf/bacula-dir.conf +change_jobname CompressedTest $JobName +start_test + +mkdir ${cwd}/build/src/testdir +touch ${cwd}/build/src/testdir/.nobkp +cp ${cwd}/build/src/dird/*.c ${cwd}/build/src/testdir + +cat >tmp/bconcmds < /dev/null +if [ $? = 0 ]; then + print_debug "ERROR: Should not see testdir in estimate output" + bstat=2 +fi + +# build/po is included 2 times with a different exclude file +# we shouldn't see scripts and bin +nb=$(grep -e 'build/po/fr.po$' $tmp/log3.out | wc -l) +if [ $nb != 2 ]; then + print_debug "ERROR: Should see fr.po two times" + bstat=2 +fi + +grep $rscripts $tmp/log3.out > /dev/null +if [ $? = 0 ]; then + print_debug "ERROR: Should not $rscripts in estimate output" + bstat=2 +fi + +grep $conf $tmp/log3.out > /dev/null +if [ $? = 0 ]; then + print_debug "ERROR: Should not $conf in estimate output" + bstat=2 +fi + +end_test -- 2.39.5