Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/runfiles/common.run
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,8 @@ tests = ['redacted_compressed', 'redacted_contents', 'redacted_deleted',
'redacted_disabled_feature', 'redacted_embedded', 'redacted_holes',
'redacted_incrementals', 'redacted_largeblocks', 'redacted_many_clones',
'redacted_mixed_recsize', 'redacted_mounts', 'redacted_negative',
'redacted_origin', 'redacted_panic', 'redacted_props', 'redacted_resume',
'redacted_size', 'redacted_volume']
'redacted_opposite_endian', 'redacted_origin', 'redacted_panic',
'redacted_props', 'redacted_resume', 'redacted_size', 'redacted_volume']
tags = ['functional', 'redacted_send']

[tests/functional/raidz]
Expand Down
1 change: 1 addition & 0 deletions tests/test-runner/bin/zts-report.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ known = {
'refreserv/refreserv_004_pos': ['FAIL', known_reason],
'rootpool/setup': ['SKIP', na_reason],
'rsend/rsend_008_pos': ['SKIP', 6066],
'redacted_send/redacted_opposite_endian': ['FAIL', 18344],
'vdev_zaps/vdev_zaps_007_pos': ['FAIL', known_reason],
}

Expand Down
3 changes: 3 additions & 0 deletions tests/zfs-tests/tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ nobase_dist_datadir_zfs_tests_tests_DATA += \
functional/projectquota/projectquota_common.kshlib \
functional/quota/quota.cfg \
functional/quota/quota.kshlib \
functional/redacted_send/big-endian-redacted.zsend.bz2 \
functional/redacted_send/little-endian-redacted.zsend.bz2 \
functional/redacted_send/redacted.cfg \
functional/redacted_send/redacted.kshlib \
functional/redundancy/redundancy.cfg \
Expand Down Expand Up @@ -1889,6 +1891,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/redacted_send/redacted_mixed_recsize.ksh \
functional/redacted_send/redacted_mounts.ksh \
functional/redacted_send/redacted_negative.ksh \
functional/redacted_send/redacted_opposite_endian.ksh \
functional/redacted_send/redacted_origin.ksh \
functional/redacted_send/redacted_panic.ksh \
functional/redacted_send/redacted_props.ksh \
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/ksh
# SPDX-License-Identifier: CDDL-1.0

#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright (c) 2026, OpenZFS Contributors. All rights reserved.
#

. $STF_SUITE/tests/functional/redacted_send/redacted.kshlib

#
# Description:
# Verify that zfs receive can accept a redacted send stream generated
# on a system with the opposite byte order. This is a regression test
# for GitHub issue #18344, which reports that receiving a redacted stream
# from an opposite-endian sender fails.
#
# Strategy:
# 1. Determine the endianness of the running system.
# 2. Select the pre-built redacted send stream from the opposite
# endianness.
# 3. Decompress the stream and attempt to receive it into POOL2.
# 4. Verify the receive succeeds.
#

verify_runnable "both"

typeset recvfs="$POOL2/opposite_endian_recv"
typeset streamdir=$STF_SUITE/tests/functional/redacted_send
typeset tmpdir="$(get_prop mountpoint $POOL)/tmp"
typeset sendfile=$(mktemp $tmpdir/stream.XXXX)

function cleanup
{
if datasetexists $recvfs; then
destroy_dataset $recvfs "-r"
fi
rm -f $sendfile
}
log_onexit cleanup

log_assert "Receiving a redacted stream from an opposite-endian sender" \
"should succeed (issue #18344)"

# Determine system endianness and select the opposite-endian stream.
typeset native_endian=$(python3 -c "import sys; print(sys.byteorder)")
if [[ "$native_endian" == "little" ]]; then
# System is little-endian; use the big-endian stream.
typeset streamfile="$streamdir/big-endian-redacted.zsend.bz2"
log_note "System is little-endian, receiving big-endian stream"
else
# System is big-endian; use the little-endian stream.
typeset streamfile="$streamdir/little-endian-redacted.zsend.bz2"
log_note "System is big-endian, receiving little-endian stream"
fi

if [[ ! -f "$streamfile" ]]; then
log_unsupported "Opposite-endian stream file not found: $streamfile"
fi

log_must eval "bzcat <$streamfile >$sendfile"
log_must eval "zfs recv $recvfs <$sendfile"

log_pass "Successfully received opposite-endian redacted stream (issue #18344)"
Loading