From: Eric Bollengier Date: Wed, 2 Sep 2020 13:10:20 +0000 (+0200) Subject: BEE Backport regress/tests/fileset-kw-test X-Git-Tag: Release-11.3.2~1233 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=29a0c7bc83f72bcae3f254f2ab8d41f4e50632b5;p=thirdparty%2Fbacula.git BEE Backport regress/tests/fileset-kw-test This commit is the result of the squash of the following main commits: Author: Eric Bollengier Date: Tue Jul 21 10:28:13 2020 +0200 regress: Add copyright to regress scripts Author: Eric Bollengier Date: Thu Mar 28 17:49:02 2019 +0100 regress: Add test to check fileset option keywords --- diff --git a/regress/tests/fileset-kw-test b/regress/tests/fileset-kw-test new file mode 100755 index 0000000000..db929e49be --- /dev/null +++ b/regress/tests/fileset-kw-test @@ -0,0 +1,114 @@ +#!/bin/sh +# +# Copyright (C) 2000-2020 Kern Sibbald +# License: BSD 2-Clause; see file LICENSE-FOSS +# +# Test fileset options +# +TestName="fileset-kw-test" +JobName=backup +. scripts/functions + +scripts/cleanup +scripts/copy-confs + +start_test + +cat <> $conf/bacula-dir.conf +@$tmp/conf +EOF + +cat < $tmp/conf +FileSet { + Name = test1 + Include { + Options { + Accurate = yes + } + File = /etc + } +} +EOF + +if $bin/bacula-dir -t -c $conf/bacula-dir.conf >> $tmp/log1.out +then + print_debug "ERROR: Should report an error on Accurate option" + estat=1 +fi + +cat < $tmp/conf +FileSet { + Name = test1 + Include { + Options { + Verify = yes + } + File = /etc + } +} +EOF + +if $bin/bacula-dir -t -c $conf/bacula-dir.conf >> $tmp/log1.out +then + print_debug "ERROR: Should report an error on Verify option" + estat=1 +fi + +cat < $tmp/conf +FileSet { + Name = test1 + Include { + Options { + BaseJob = yes + } + File = /etc + } +} +EOF + +if $bin/bacula-dir -t -c $conf/bacula-dir.conf >> $tmp/log1.out +then + print_debug "ERROR: Should report an error on BaseJob option" + estat=1 +fi + +cat < $tmp/conf +FileSet { + Name = test1 + Include { + Options { + BaseJob = ipnugsamMcdA51 + Accurate = ipnugsamMcdA51 + Verify = ipnugsamcd51 + } + File = /etc + } +} +EOF + +if ! $bin/bacula-dir -t -c $conf/bacula-dir.conf >> $tmp/log1.out +then + print_debug "ERROR: Should not report an error on BaseJob option" + estat=1 +fi + +cat < $tmp/conf +FileSet { + Name = test1 + Include { + Options { + Verify = pins5 + } + File = /etc + } +} +EOF + +if ! $bin/bacula-dir -t -c $conf/bacula-dir.conf >> $tmp/log1.out +then + print_debug "ERROR: Should not report an error on Verify option" + estat=1 +fi + + +end_test