Skip to content

Commit

Permalink
Update zhammer for latest festivities (openzfs/zfs#15933)
Browse files Browse the repository at this point in the history
  • Loading branch information
numinit committed Mar 13, 2024
1 parent e7d0b02 commit c0712aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
20 changes: 2 additions & 18 deletions nixos/tests/zhammer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,12 @@ let
)
machine.succeed(
"parallel --lb --halt-on-error now,fail=1 zhammer /test 10000000 16k 10000 ::: $(seq $(nproc))${pkgs.lib.optionalString ignoreFailures " || true"}"
"parallel --lb --halt-on-error now,fail=1 zhammer /test 10000000 256k 1000 ::: $(seq $(nproc))${pkgs.lib.optionalString ignoreFailures " || true"}"
)
'' + extraTest;
};


in {
zfs_2_2_1_stock = makeZfsTest "zfs_2_2_1_stock" { ignoreFailures = true; };
zfs_2_2_1_zfs_dmu_offset_next_sync = makeZfsTest "zfs_2_2_1_zfs_dmu_offset_next_sync" { ignoreFailures = true; extraKernelParams = [ "zfs.zfs_dmu_offset_next_sync=0" ]; };
/*
# For some reason, this fails
zfs_2_2_1_with_patch = makeZfsTest "zfs_2_2_1_with_patch" {
zfsPackage = pkgs.zfs.overrideAttrs (prev: {
extraPatches = [
(pkgs.fetchpatch {
# https://github.com/openzfs/zfs/pull/15571
# Remove when it's backported to 2.1.x.
url = "https://github.com/robn/zfs/commit/617c990a4cf1157b0f8332f35672846ad16ca70a.patch";
hash = "sha256-j5YSrud7BaWk2npBl31qwFFLYltbut3CUjI1cjZOpag=";
})
];
});
};*/
zfs_2_1_with_patch = makeZfsTest "zfs_2_1_with_patch" { zfsPackage = pkgs.zfs_2_1; };
zfs_2_2_3_stock = makeZfsTest "zfs_2_2_3_stock" { };
}
11 changes: 10 additions & 1 deletion nixos/tests/zhammer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,21 @@ print_zfs_version_info() {
sha256="$("$cmd" "$module" | sha256sum | awk '{print $1}')"
fi

log "==="
log "Uname: $uname"
log "Cmdline: $(</proc/cmdline)"
for param in zfs_bclone_enabled zfs_bclone_wait_dirty zfs_dmu_offset_next_sync; do
local filename="/sys/module/zfs/parameters/$param"
if [ -f "$filename" ]; then
log " - $param: $(<"$filename")"
fi
done
log "ZFS userspace: $version"
log "ZFS kernel: $kmod"
log "Module: $module"
log "Srcversion: $srcversion"
log "SHA256: $sha256"
log "==="
}

if [ ! -d "$workdir" ] || [ ! "$count" -gt 0 ] || [ -z "$blocksize" ] || [ ! "$check_every" -gt 0 ]; then
Expand All @@ -79,7 +88,7 @@ log "Check every: $check_every files"
# Create a file filled with 0xff.
cd "$workdir"
prefix="zhammer_${BASHPID}_"
dd if=/dev/zero bs="$blocksize" count=1 status=none | LC_ALL=C tr "\000" "\377" > "${prefix}0"
dd if=/dev/urandom bs="$blocksize" count=1 status=none > "${prefix}0"

cleanup() {
rm -f "$prefix"* || true
Expand Down

0 comments on commit c0712aa

Please sign in to comment.