ZTS: Replace MD5 and SHA256 wit XXH128

For data integrity checks as done in ZTS, the verification for
unintended data corruption with xxhash128 should be a lot faster
and perfectly usable.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #16577
This commit is contained in:
Tino Reichardt
2024-09-28 20:24:05 +04:00
committed by Tony Hutter
parent a44a15d318
commit e55e9468f7
34 changed files with 118 additions and 127 deletions
+2 -5
View File
@@ -99,7 +99,8 @@ export SYSTEM_FILES_COMMON='awk
uniq
vmstat
wc
xargs'
xargs
xxh128sum'
export SYSTEM_FILES_FREEBSD='chflags
compress
@@ -111,13 +112,11 @@ export SYSTEM_FILES_FREEBSD='chflags
jexec
jls
lsextattr
md5
mdconfig
newfs
pw
rmextattr
setextattr
sha256
showmount
swapctl
sysctl
@@ -145,7 +144,6 @@ export SYSTEM_FILES_LINUX='attr
lscpu
lsmod
lsscsi
md5sum
mkswap
modprobe
mountpoint
@@ -155,7 +153,6 @@ export SYSTEM_FILES_LINUX='attr
perf
setfattr
setpriv
sha256sum
udevadm
unshare
useradd
+11 -8
View File
@@ -3455,21 +3455,24 @@ function tunable_exists
}
#
# Compute MD5 digest for given file or stdin if no file given.
# Compute xxh128sum for given file or stdin if no file given.
# Note: file path must not contain spaces
#
function md5digest
function xxh128digest
{
openssl md5 -r $1 | awk '{print $1}'
xxh128sum $1 | awk '{print $1}'
}
#
# Compute SHA256 digest for given file or stdin if no file given.
# Note: file path must not contain spaces
# Compare the xxhash128 digest of two files.
#
function sha256digest
{
openssl sha256 -r $1 | awk '{print $1}'
function cmp_xxh128 {
typeset file1=$1
typeset file2=$2
typeset sum1=$(xxh128digest $file1)
typeset sum2=$(xxh128digest $file2)
test "$sum1" = "$sum2"
}
function new_fs #<args>