]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport regress/tests/fileset-kw-test
authorEric Bollengier <eric@baculasystems.com>
Wed, 2 Sep 2020 13:10:20 +0000 (15:10 +0200)
committerEric Bollengier <eric@baculasystems.com>
Tue, 1 Mar 2022 14:36:18 +0000 (15:36 +0100)
This commit is the result of the squash of the following main commits:

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Tue Jul 21 10:28:13 2020 +0200

    regress: Add copyright to regress scripts

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Thu Mar 28 17:49:02 2019 +0100

    regress: Add test to check fileset option keywords

regress/tests/fileset-kw-test [new file with mode: 0755]

diff --git a/regress/tests/fileset-kw-test b/regress/tests/fileset-kw-test
new file mode 100755 (executable)
index 0000000..db929e4
--- /dev/null
@@ -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 <<EOF >> $conf/bacula-dir.conf
+@$tmp/conf
+EOF
+
+cat <<EOF > $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 <<EOF > $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 <<EOF > $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 <<EOF > $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 <<EOF > $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