#
# 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
#
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
@$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
@$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