|
| 1 | +#!/bin/ksh -p |
| 2 | +# |
| 3 | +# CDDL HEADER START |
| 4 | +# |
| 5 | +# The contents of this file are subject to the terms of the |
| 6 | +# Common Development and Distribution License (the "License"). |
| 7 | +# You may not use this file except in compliance with the License. |
| 8 | +# |
| 9 | +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
| 10 | +# or http://www.opensolaris.org/os/licensing. |
| 11 | +# See the License for the specific language governing permissions |
| 12 | +# and limitations under the License. |
| 13 | +# |
| 14 | +# When distributing Covered Code, include this CDDL HEADER in each |
| 15 | +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
| 16 | +# If applicable, add the following below this CDDL HEADER, with the |
| 17 | +# fields enclosed by brackets "[]" replaced with your own identifying |
| 18 | +# information: Portions Copyright [yyyy] [name of copyright owner] |
| 19 | +# |
| 20 | +# CDDL HEADER END |
| 21 | +# |
| 22 | + |
| 23 | +# |
| 24 | +# Copyright (c) 2007, Sun Microsystems Inc. All rights reserved. |
| 25 | +# Copyright (c) 2021, Rich Ercolani. |
| 26 | +# Use is subject to license terms. |
| 27 | +# |
| 28 | + |
| 29 | +. $STF_SUITE/include/properties.shlib |
| 30 | +. $STF_SUITE/include/libtest.shlib |
| 31 | + |
| 32 | +# |
| 33 | +# DESCRIPTION: |
| 34 | +# Import a pool containing variously-permuted zstd-compressed files, |
| 35 | +# then try to copy them out. |
| 36 | + |
| 37 | +typeset TESTPOOL_ZSTD_FILE=$STF_SUITE/tests/functional/compression/testpool_zstd.tar.gz |
| 38 | +verify_runnable "both" |
| 39 | + |
| 40 | +function cleanup |
| 41 | +{ |
| 42 | + pool_destroy testpool_zstd |
| 43 | + rm -f $TEST_BASE_DIR/testpool_zstd |
| 44 | + |
| 45 | +} |
| 46 | + |
| 47 | +log_assert "Trying to read data from variously mangled zstd datasets" |
| 48 | +log_onexit cleanup |
| 49 | + |
| 50 | +tar --directory $TEST_BASE_DIR -xzSf $TESTPOOL_ZSTD_FILE |
| 51 | +zpool import -d $TEST_BASE_DIR testpool_zstd |
| 52 | +log_must cp /testpool_zstd/x86_64/zstd /dev/null |
| 53 | +log_must cp /testpool_zstd/sparc64/zstd /dev/null |
| 54 | +log_must cp /testpool_zstd/ppc64_fbsd/zstd /dev/null |
| 55 | + |
| 56 | +log_pass "Reading from mangled zstd datasets works as expected." |
0 commit comments