]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: tweak zstd-test to show the time and size and add XPARAM ZSTD_LEVEL
authorAlain Spineux <alain@baculasystems.com>
Thu, 10 Aug 2023 13:49:46 +0000 (15:49 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:02 +0000 (13:57 +0200)
- 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

regress/tests/zstd-test

index 39c0e4d2db460eeaeef5474b88ee7815846faba7..c3bdfa5ee8658dff6d9ce0653d411cc3d9fe0857 100755 (executable)
@@ -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 <<END_OF_DATA >${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