forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for being able to read various variantss of zstd
As detailed in openzfs#12022 and openzfs#12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64, and one written by current FBSD/ppc64. (I'll add one for Linux/sparc64 once the unmodified git checkout finishes building. Linux/ppc64 behaves identically to Linux/sparc64.) Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
- Loading branch information
1 parent
7d07d1b
commit deb59ac
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
tests/zfs-tests/tests/functional/compression/compress_zstd_bswap.ksh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/ksh -p | ||
# | ||
# CDDL HEADER START | ||
# | ||
# The contents of this file are subject to the terms of the | ||
# Common Development and Distribution License (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# | ||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
# or http://www.opensolaris.org/os/licensing. | ||
# See the License for the specific language governing permissions | ||
# and limitations under the License. | ||
# | ||
# When distributing Covered Code, include this CDDL HEADER in each | ||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
# If applicable, add the following below this CDDL HEADER, with the | ||
# fields enclosed by brackets "[]" replaced with your own identifying | ||
# information: Portions Copyright [yyyy] [name of copyright owner] | ||
# | ||
# CDDL HEADER END | ||
# | ||
|
||
# | ||
# Copyright (c) 2007, Sun Microsystems Inc. All rights reserved. | ||
# Copyright (c) 2021, Rich Ercolani. | ||
# Use is subject to license terms. | ||
# | ||
|
||
. $STF_SUITE/include/properties.shlib | ||
. $STF_SUITE/include/libtest.shlib | ||
|
||
# | ||
# DESCRIPTION: | ||
# TODO | ||
|
||
typeset TESTPOOL_ZSTD_FILE=$STF_SUITE/tests/functional/compression/testpool_zstd.tar.gz | ||
verify_runnable "both" | ||
|
||
function cleanup | ||
{ | ||
pool_destroy testpool_zstd | ||
rm -f $TEST_BASE_DIR/testpool_zstd | ||
|
||
} | ||
|
||
log_assert "Trying to read data from variously mangled zstd datasets" | ||
log_onexit cleanup | ||
|
||
tar --directory $TEST_BASE_DIR -xzSf $TESTPOOL_ZSTD_FILE | ||
zpool import -d $TEST_BASE_DIR testpool_zstd | ||
log_must cp /testpool_zstd/x86_64/zstd /dev/null | ||
#log_must cp /testpool_zstd/sparc64/zstd /dev/null | ||
log_must cp /testpool_zstd/ppc64_fbsd/zstd /dev/null | ||
|
||
log_pass "Reading from mangled zstd datasets works as expected." |
Binary file not shown.