aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/include
diff options
context:
space:
mode:
authorTino Reichardt <[email protected]>2024-09-28 20:24:05 +0400
committerGitHub <[email protected]>2024-09-28 09:24:05 -0700
commitb1958b531b75afa8a138eae8ace9d17201fa42b9 (patch)
tree1b55cf3e24309abc98da8310951ea69e84ccb5ad /tests/zfs-tests/include
parent834b90fb819e0887e05d6069cb9e74033dca1541 (diff)
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 <[email protected]> Signed-off-by: Tino Reichardt <[email protected]> Closes #16577
Diffstat (limited to 'tests/zfs-tests/include')
-rw-r--r--tests/zfs-tests/include/commands.cfg7
-rw-r--r--tests/zfs-tests/include/libtest.shlib23
2 files changed, 9 insertions, 21 deletions
diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg
index 934aca6f9..be41ce521 100644
--- a/tests/zfs-tests/include/commands.cfg
+++ b/tests/zfs-tests/include/commands.cfg
@@ -100,7 +100,8 @@ export SYSTEM_FILES_COMMON='awk
uniq
vmstat
wc
- xargs'
+ xargs
+ xxh128sum'
export SYSTEM_FILES_FREEBSD='chflags
compress
@@ -112,13 +113,11 @@ export SYSTEM_FILES_FREEBSD='chflags
jexec
jls
lsextattr
- md5
mdconfig
newfs
pw
rmextattr
setextattr
- sha256
showmount
swapctl
sysctl
@@ -146,7 +145,6 @@ export SYSTEM_FILES_LINUX='attr
lscpu
lsmod
lsscsi
- md5sum
mkswap
modprobe
mountpoint
@@ -156,7 +154,6 @@ export SYSTEM_FILES_LINUX='attr
perf
setfattr
setpriv
- sha256sum
udevadm
unshare
useradd
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib
index 407101826..9cf919c3d 100644
--- a/tests/zfs-tests/include/libtest.shlib
+++ b/tests/zfs-tests/include/libtest.shlib
@@ -3455,35 +3455,26 @@ 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}'
}
#
-# Compare the MD5 digest of two files.
+# Compare the xxhash128 digest of two files.
#
-function cmp_md5s {
+function cmp_xxh128 {
typeset file1=$1
typeset file2=$2
- typeset sum1=$(md5digest $file1)
- typeset sum2=$(md5digest $file2)
+ typeset sum1=$(xxh128digest $file1)
+ typeset sum2=$(xxh128digest $file2)
test "$sum1" = "$sum2"
}
-#
-# Compute SHA256 digest for given file or stdin if no file given.
-# Note: file path must not contain spaces
-#
-function sha256digest
-{
- openssl sha256 -r $1 | awk '{print $1}'
-}
-
function new_fs #<args>
{
case "$UNAME" in