From: Alain Spineux Date: Thu, 10 Aug 2023 13:49:46 +0000 (+0200) Subject: regress: tweak zstd-test to show the time and size and add XPARAM ZSTD_LEVEL X-Git-Tag: Beta-15.0.0~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70db483826509d17b49134bdadf1962cb43f96b3;p=thirdparty%2Fbacula.git regress: tweak zstd-test to show the time and size and add XPARAM ZSTD_LEVEL - remove LZO backup that was breaking the check for "Software Compression" when LZO is available but ZSTD not - handle XPARAM ZSTD_LEVEL to chose the compression level - show time and size to compare different ZSTD level with LZO --- diff --git a/regress/tests/zstd-test b/regress/tests/zstd-test index 39c0e4d2d..c3bdfa5ee 100755 --- a/regress/tests/zstd-test +++ b/regress/tests/zstd-test @@ -4,8 +4,9 @@ # 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 @@ -13,9 +14,16 @@ JobName=zstd 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 <${cwd}/tmp/bconcmds @output /dev/null messages @@ -26,7 +34,6 @@ messages label storage=File volume=TestVolume001 setdebug level=0 client run job=ZSTDTest storage=File yes -run job=LZOTest storage=File yes wait messages @# @@ -54,4 +61,12 @@ if [ $? != 0 ] ; then 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