]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport regress/tests/plugin-test
authorEric Bollengier <eric@baculasystems.com>
Wed, 2 Sep 2020 12:50:38 +0000 (14:50 +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:   Mon Dec 19 10:33:27 2016 +0100

    regress: Fix plugin-test

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Mon May 2 09:29:57 2016 +0200

    Add an option to configure the FileMedia record interval

regress/tests/plugin-test

index ebc06d53ae9504334a906773f1a0532171059636..d84992f99fcf90568a6cf7f74853621dab7258af 100755 (executable)
@@ -2,8 +2,6 @@
 #
 # Copyright (C) 2000-2020 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
-#
-
 #
 # Attempt to backup and restore a file with the bpipe plugin
 #
@@ -13,12 +11,14 @@ JobName=pluginTest
 
 scripts/cleanup
 scripts/copy-plugin-confs
-make -C $src/src/plugins/fd install-test-plugin
+make -C $src/src/plugins/fd install install-test-plugin
 
 file=encrypt-bug.jpg
 rm -rf ${cwd}/tmp/*
 echo "${cwd}/README" >${cwd}/tmp/file-list
 
+$bperl -e 'add_attribute("$conf/bacula-sd.conf", "MaximumFileIndex", "48KB", "Device")'
+
 start_test
 
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
@@ -51,16 +51,22 @@ cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out $tmp/list
 llist pluginrestoreconf jobid=2
 @$out $tmp/conf
-llist pluginrestoreconf jobid=2 id=2
+llist pluginrestoreconf jobid=2 id=4
 END_OF_DATA
 
 run_bconsole
 
 grep string1 $tmp/conf
 
+if [ $? -ne 0 ]; then
+    print_debug "ERROR: Should find string1 in the RestoreObject $tmp/conf"
+    estat=1
+fi
+
 cat <<EOF >$tmp/obj
 string1="My string"
 string2="My other string"
+req=no
 ok=no
 EOF
 
@@ -117,7 +123,8 @@ messages
 @$out ${cwd}/tmp/log3.out
 setdebug level=50 client=$CLIENT trace=1
 @putfile obj1 $tmp/obj
-restore pluginrestoreconf="2:obj1" fileset=TestPluginSet where=${cwd}/tmp  select all storage=File1 done
+list pluginrestoreconf jobid=2 id=4
+restore pluginrestoreconf="4:obj1" fileset=TestPluginSet where=${cwd}/tmp  select all storage=File1 done
 yes
 wait
 setdebug level=0 client=$CLIENT trace=0