# License: BSD 2-Clause; see file LICENSE-FOSS
#
# Run a simple backup of the Bacula build directory using the compressed option
-# then restore it.
-#
+# then restore it.
+# XPARAM ZSTD_LEVEL=(ZSTD|10:ZSTD1|10:ZSTD10|10:ZSTD19)
+
TestName="zstd-test"
JobName=zstd
. scripts/functions
scripts/cleanup
scripts/copy-test-confs
echo "${cwd}/build/po/fr.po" >${cwd}/tmp/file-list
+#echo "${cwd}/build" >${cwd}/tmp/file-list
start_test
-
+
+if [ -n "$ZSTD_LEVEL" ] ; then
+ sed -i "s/compression\s*=\s*ZSTD\s*/compression=${ZSTD_LEVEL}/" $conf/bacula-dir.conf
+else
+ ZSTD_LEVEL="ZSTD"
+ fi
+
cat <<END_OF_DATA >${cwd}/tmp/bconcmds
@output /dev/null
messages
label storage=File volume=TestVolume001
setdebug level=0 client
run job=ZSTDTest storage=File yes
-run job=LZOTest storage=File yes
wait
messages
@#
echo " !!!!! No compression !!!!!"
bstat=1
fi
+
+if [ -n "$REGRESS_DEBUG" ] ; then
+ # Show ZSTD time and size
+ T=`grep "Elapsed time:" ${cwd}/tmp/log1.out`
+ SZ=`grep "FD Bytes Written:" ${cwd}/tmp/log1.out`
+ echo "COMPRESSION $ZSTD_LEVEL --> $SZ $T"
+fi
+
end_test