Index: projects/zfsd/head/tests/sys/cddl/zfs/bin/Makefile =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/bin/Makefile (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/bin/Makefile (revision 322822) @@ -1,61 +1,62 @@ # $FreeBSD$ .include PACKAGE= tests MAN= BINDIR= ${TESTSBASE}/sys/cddl/zfs/bin SCRIPTSDIR= ${TESTSBASE}/sys/cddl/zfs/bin SCRIPTS+= bsddisks.ksh SCRIPTS+= df.ksh SCRIPTS+= dircmp.ksh SCRIPTS+= dumpadm.ksh SCRIPTS+= ff.ksh SCRIPTS+= fmadm.ksh SCRIPTS+= fmdump.ksh SCRIPTS+= format.ksh SCRIPTS+= groupadd.ksh SCRIPTS+= groupdel.ksh SCRIPTS+= groupmod.ksh SCRIPTS+= groupshow.ksh SCRIPTS+= svcs.ksh SCRIPTS+= swap.ksh SCRIPTS+= testenv.ksh SCRIPTS+= useradd.ksh SCRIPTS+= userdel.ksh SCRIPTS+= usermod.ksh SCRIPTS+= zfs.ksh SCRIPTS+= zfs_crypto.ksh SCRIPTS+= zfs_version.ksh SCRIPTS+= zlogin.ksh SCRIPTS+= zoneadm.ksh SCRIPTS+= zonecfg.ksh SCRIPTS+= zpool.ksh SCRIPTS+= zpool_bsd.ksh SCRIPTS+= zpool_smi.ksh SCRIPTS+= zpool_version.ksh PROGS+= chg_usr_exec # Not ported to FreeBSD # PROGRS+= devname2devid PROGS+= dir_rd_update PROGS+= file_check PROGS+= file_trunc PROGS+= file_write PROGS+= largest_file +PROGS+= mkfile PROGS+= mktree PROGS+= mmapwrite PROGS+= randfree_file PROGS+= readmmap PROGS+= rename_dir PROGS+= rm_lnkcnt_zero_file .for p in ${PROGS} SRCS.$p= $p.c .endfor LIBADD.mmapwrite+= pthread LIBADD.rm_lnkcnt_zero_file+= pthread .include Index: projects/zfsd/head/tests/sys/cddl/zfs/bin/mkfile.c =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/bin/mkfile.c (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/bin/mkfile.c (revision 322822) @@ -0,0 +1,213 @@ +/*- + * Copyright (c) 2001-2013 + * HATANO Tomomi. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef lint +static char rcsid[] = "$Id: mkfile.c,v 1.5 2013-10-26 10:11:34+09 hatanou Exp $"; +#endif /* !lint */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MKFILE_WBUF ((size_t)(1048576)) /* Is 1M a reasonable value? */ + +/* SunOS's mkfile(8) sets "sticky bit." */ +#define MKFILE_FLAG (O_WRONLY | O_CREAT | O_TRUNC) +#define MKFILE_MODE (S_IRUSR | S_IWUSR | S_ISVTX) + +static char buf[MKFILE_WBUF]; +static int nofill = 0; +static int verbose = 0; + +static void +usage() +{ + fprintf(stderr, + "Usage: mkfile [-nv] [e|p|t|g|m|k|b] ...\n"); +} + +static unsigned long long +getsize(char *s) +{ + int sh; + unsigned long long length; + char *suffix; + + /* + * NOTE: We don't handle 'Z' (zetta) or 'Y' (yotta) suffixes yet. + * These are too large to store in unsigned long long (64bits). + * In the future, we'll have to use larger type, + * something like uint128_t. + */ + length = strtoull(s, &suffix, 10); + sh = 0; + switch (tolower(*suffix)) { + case 'e': /* Exabytes. */ + sh = 60; + break; + case 'p': /* Petabytes. */ + sh = 50; + break; + case 't': /* Terabytes. */ + sh = 40; + break; + case 'g': /* Gigabytes. */ + sh = 30; + break; + case 'm': /* Megabytes. */ + sh = 20; + break; + case 'k': /* Kilobytes. */ + sh = 10; + break; + case 'b': /* Blocks. */ + sh = 9; + break; + case '\0': /* Bytes. */ + break; + default: /* Unknown... */ + errno = EINVAL; + return 0; + } + if (sh) { + unsigned long long l; + + l = length; + length <<= sh; + /* Check overflow. */ + if ((length >> sh) != l) { + errno = ERANGE; + return 0; + } + } + + return length; +} + +static int +create_file(char *f, unsigned long long s) +{ + int fd; + size_t w; + ssize_t ws; + + if (verbose) { + fprintf(stdout, "%s %llu bytes\n", f, s); + fflush(stdout); + } + + /* Open file to create. */ + if ((fd = open(f, MKFILE_FLAG, MKFILE_MODE)) < 0) { + return -1; + } + + /* Seek to the end and write 1 byte. */ + if ((lseek(fd, (off_t)(s - 1LL), SEEK_SET) == (off_t)-1) || + (write(fd, buf, (size_t)1) == (ssize_t)-1)) { + /* + * We don't close(fd) here to avoid overwriting errno. + * This is fd-leak, but is not harmful + * because returning error causes mkfile(8) to exit. + */ + return -1; + } + + /* Fill. */ + if (!nofill) { + if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) { + /* Same as above. */ + return -1; + } + while (s) { + w = (s > MKFILE_WBUF) ? MKFILE_WBUF : s; + if ((ws = write(fd, buf, w)) == (ssize_t)-1) { + /* Same as above. */ + return -1; + } + s -= ws; + } + } + close(fd); + + return 0; +} + +int +main(int argc, char *argv[]) +{ + unsigned long long fsize; + char ch; + + /* We have at least 2 arguments. */ + if (argc < 3) { + usage(); + return EXIT_FAILURE; + } + + /* Options. */ + while ((ch = getopt(argc, argv, "nv")) != -1) { + switch (ch) { + case 'n': + nofill = 1; + break; + case 'v': + verbose = 1; + break; + default: + usage(); + return EXIT_FAILURE; + } + } + argc -= optind; + argv += optind; + + /* File size to create. */ + if ((fsize = getsize(*argv)) == 0) { + perror(*argv); + return EXIT_FAILURE; + } + + /* Filenames to create. */ + bzero(buf, MKFILE_WBUF); + while (++argv, --argc) { + if (create_file(*argv, fsize) == -1) { + perror(*argv); + unlink(*argv); + return EXIT_FAILURE; + } + } + + return EXIT_SUCCESS; +} Property changes on: projects/zfsd/head/tests/sys/cddl/zfs/bin/mkfile.c ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/zfsd/head/tests/sys/cddl/zfs/include/commands.txt =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/include/commands.txt (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/include/commands.txt (revision 322822) @@ -1,189 +1,189 @@ # # 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 # #!/usr/local/bin/ksh93 -p # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "@(#)commands.txt 1.8 09/01/13 SMI" # # All the commands in this file are converted into environment variables # with the same name as the command e.g. # # /bin/df becomes export DF="/bin/df" # finally an export CMDS="aggregation of all the environment variables" # is created for checking in the execution environment. # # comments are ignored in this file, as are whitespace lines # General Solaris Commands /usr/bin/awk /usr/sbin/arp /usr/bin/basename /bin/cat /usr/bin/cd /usr/bin/chgrp /bin/chmod /usr/sbin/chown /usr/bin/cksum /sbin/clri /usr/bin/cmp /usr/bin/compress /usr/bin/uncompress #/usr/bin/coreadm /bin/cp /usr/bin/cpio /usr/bin/cut /bin/date /bin/dd #/usr/sbin/devfsadm %%STFSUITEDIR%%/bin/df /usr/bin/diff %%STFSUITEDIR%%/bin/dircmp /usr/bin/dirname /usr/bin/du #%%STFSUITEDIR%%/bin/dumpadm /bin/echo /usr/bin/egrep /usr/bin/env #%%STFSUITEDIR%%/bin/ff /usr/bin/fgrep /usr/bin/file /usr/bin/find #%%STFSUITEDIR%%/bin/fmadm #%%STFSUITEDIR%%/bin/fmdump #%%STFSUITEDIR%%/bin/format /sbin/fsck /sbin/fsdb /sbin/fsirand /usr/bin/fsync /usr/sbin/fstyp /usr/bin/id #/usr/bin/isainfo #/usr/sbin/iscsiadm #/usr/sbin/iscsitadm /usr/bin/getent /bin/getfacl /usr/bin/getconf /sbin/sha1 /sbin/gpart /usr/bin/grep /usr/bin/groups %%STFSUITEDIR%%/bin/groupadd %%STFSUITEDIR%%/bin/groupdel %%STFSUITEDIR%%/bin/groupmod %%STFSUITEDIR%%/bin/groupshow /usr/bin/head /bin/hostname /bin/kill /usr/local/bin/ksh93 #/usr/sbin/labelit #/usr/sbin/lockfs #/usr/sbin/lofiadm /bin/ls /usr/bin/logname #/usr/bin/mdb /sbin/mdconfig #/usr/sbin/metaclear #/usr/sbin/metadb #/usr/sbin/metainit #/usr/sbin/metastat /bin/mkdir -/usr/local/sbin/mkfile /sbin/mknod #/usr/sbin/modinfo #/usr/sbin/modunload /sbin/mount /bin/mv #/usr/sbin/ncheck /sbin/newfs /usr/bin/nawk #/usr/bin/pack /usr/bin/pagesize /bin/pax /sbin/ping /usr/bin/printf #/usr/sbin/prtvtoc #/usr/bin/pfexec /bin/pgrep #/usr/bin/pkginfo /bin/pkill /bin/ps #/usr/sbin/psrinfo /bin/pwd /usr/sbin/quotaon /bin/rcp /sbin/reboot /bin/rm /bin/rmdir /usr/bin/rsh #/usr/bin/runat /usr/bin/sed #/usr/sbin/share /bin/sleep /usr/bin/su /usr/bin/sum #%%STFSUITEDIR%%/bin/svcs #/usr/sbin/svcadm #%%STFSUITEDIR%%/bin/swap #/sbin/swapadd /usr/bin/sort /usr/bin/strings /bin/sync /usr/bin/tar /usr/bin/tail /usr/bin/touch /usr/bin/tr /usr/bin/true +/usr/bin/truncate /sbin/tunefs #/usr/sbin/ufsdump #/usr/sbin/ufsrestore /usr/bin/umask /sbin/umount /usr/bin/uname /usr/bin/uniq #/usr/sbin/unshare #/usr/bin/unpack %%STFSUITEDIR%%/bin/useradd %%STFSUITEDIR%%/bin/userdel %%STFSUITEDIR%%/bin/usermod /usr/bin/wait /usr/bin/wc #%%STFSUITEDIR%%/bin/zoneadm #%%STFSUITEDIR%%/bin/zonecfg #%%STFSUITEDIR%%/bin/zlogin #/usr/bin/zonename /sbin/swapon /sbin/swapoff /sbin/swapctl /usr/bin/xargs /usr/sbin/zfsd # ZFS Commands /usr/sbin/zdb /sbin/zfs /sbin/zpool /usr/bin/zinject # Test framework commands #/opt/SUNWstc-runwattr/bin/runwattr %%STFSUITEDIR%%/bin/bsddisks Index: projects/zfsd/head/tests/sys/cddl/zfs/include/constants.cfg =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/include/constants.cfg (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/include/constants.cfg (revision 322822) @@ -1,110 +1,111 @@ #!/usr/bin/env ksh93 # Add test-specific binaries to PATH export PATH=${STF_SUITE}/bin:${PATH} export TMPDIR=${TMPDIR-/tmp} # Set default value of TMPDIR export TMPDIR=${TMPDIR-/tmp} # Define run length constants export RT_LONG="3" export RT_MEDIUM="2" export RT_SHORT="1" # Define macro for zone test export ZONE_POOL="zonepool" export ZONE_CTR="zonectr" # Test Suite Specific Commands export DEVNAME2DEVID="devname2devid" export FILE_WRITE="file_write" export FILE_CHECK="file_check" export LARGEST_FILE="largest_file" export MMAPWRITE="mmapwrite" +export MKFILE="mkfile" export READMMAP="readmmap" export FILE_TRUNC="file_trunc" export CHG_USR_EXEC="chg_usr_exec" export MKTREE="mktree" export RANDFREE_FILE="randfree_file" export DIR_RD_UPDATE="dir_rd_update" export RM_LNKCNT_ZERO_FILE="rm_lnkcnt_zero_file" export RENAME_DIR="rename_dir" # ensure we're running in the C locale, since # localised messages may result in test failures export LC_ALL="C" export LANG="C" # # pattern to ignore from 'zpool list'. # export NO_POOLS="no pools available" # pattern to ignore from 'zfs list'. export NO_DATASETS="no datasets available" export TEST_BASE_DIR="/" # Default to compression ON export COMPRESSION_PROP=on # Default to using the checksum export CHECKSUM_PROP=on # some common variables used by test scripts : export TESTCASE_ID=${TESTCASE_ID:-$$} # some test pool names export TESTPOOL=testpool.${TESTCASE_ID} export TESTPOOL1=testpool1.${TESTCASE_ID} export TESTPOOL2=testpool2.${TESTCASE_ID} export TESTPOOL3=testpool3.${TESTCASE_ID} # some test file system names export TESTCTR=testctr${TESTCASE_ID} export TESTFS=testfs.${TESTCASE_ID} export TESTFS1=testfs1.${TESTCASE_ID} export TESTFS2=testfs2.${TESTCASE_ID} export TESTFS3=testfs3.${TESTCASE_ID} # some test directory names export TESTDIR=${TEST_BASE_DIR%%/}/testdir${TESTCASE_ID} export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0${TESTCASE_ID} export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1${TESTCASE_ID} export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2${TESTCASE_ID} # Default to limit disks to be checked export MAX_FINDDISKSNUM=100 # For iscsi target support export ISCSITGTFILE=$TMPDIR/iscsitgt_file export ISCSITGT_FMRI=svc:/system/iscsitgt:default if [ -n "$SVCS" ]; then export AUTO_SNAP=$($SVCS -a | $GREP auto-snapshot | $GREP online | $AWK '{print $3}') fi # zfs upgrade should output the first line as: # This system is currently running ZFS filesystem version 2. # . ZFS_VERSION= $ZFS upgrade -v > /dev/null 2>&1 if [ $? -eq 0 ]; then export ZFS_VERSION=$($ZFS upgrade | $HEAD -1 | $AWK '{print $NF}' \ | $SED -e 's/\.//g') fi if [ -n "$ZFS_VERSION" ]; then i=1 ZFS_ALL_VERSIONS="" while [ "$i" -le "$ZFS_VERSION" ]; do eval 'export ZFS_VERSION_$i="v${i}-fs"' ZFS_ALL_VERSIONS="$ZFS_ALL_VERSIONS $i" i=$(( i + 1 )) done export ZFS_ALL_VERSIONS fi $TRUE Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/bootfs/bootfs_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/bootfs/bootfs_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/bootfs/bootfs_test.sh (revision 322822) @@ -1,184 +1,184 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case bootfs_001_pos bootfs_001_pos_head() { atf_set "descr" "Valid datasets are accepted as bootfs property values" - atf_set "require.progs" mkfile zpool zfs + atf_set "require.progs" zpool zfs } bootfs_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/bootfs.cfg ksh93 $(atf_get_srcdir)/bootfs_001_pos.ksh || atf_fail "Testcase failed" } atf_test_case bootfs_002_neg bootfs_002_neg_head() { atf_set "descr" "Invalid datasets are rejected as boot property values" atf_set "require.progs" zfs zpool } bootfs_002_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/bootfs.cfg ksh93 $(atf_get_srcdir)/bootfs_002_neg.ksh || atf_fail "Testcase failed" } atf_test_case bootfs_003_pos bootfs_003_pos_head() { atf_set "descr" "Valid pool names are accepted by zpool set bootfs" - atf_set "require.progs" mkfile zpool zfs + atf_set "require.progs" zpool zfs } bootfs_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/bootfs.cfg ksh93 $(atf_get_srcdir)/bootfs_003_pos.ksh || atf_fail "Testcase failed" } atf_test_case bootfs_004_neg bootfs_004_neg_head() { atf_set "descr" "Invalid pool names are rejected by zpool set bootfs" - atf_set "require.progs" mkfile zpool zfs + atf_set "require.progs" zpool zfs } bootfs_004_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/bootfs.cfg ksh93 $(atf_get_srcdir)/bootfs_004_neg.ksh || atf_fail "Testcase failed" } atf_test_case bootfs_005_neg bootfs_005_neg_head() { atf_set "descr" "Boot properties cannot be set on pools with older versions" atf_set "require.progs" zfs zpool } bootfs_005_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/bootfs.cfg ksh93 $(atf_get_srcdir)/bootfs_005_neg.ksh || atf_fail "Testcase failed" } atf_test_case bootfs_006_pos bootfs_006_pos_head() { atf_set "descr" "Pools of correct vdev types accept boot property" - atf_set "require.progs" zfs zpool mkfile + atf_set "require.progs" zfs zpool } bootfs_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/bootfs.cfg ksh93 $(atf_get_srcdir)/bootfs_006_pos.ksh || atf_fail "Testcase failed" } atf_test_case bootfs_007_pos bootfs_007_pos_head() { atf_set "descr" "setting bootfs on a pool which was configured with the whole disk will succeed" atf_set "require.progs" zfs zpool } bootfs_007_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/bootfs.cfg ksh93 $(atf_get_srcdir)/bootfs_007_pos.ksh || atf_fail "Testcase failed" } atf_test_case bootfs_008_neg bootfs_008_neg_head() { atf_set "descr" "setting bootfs on a dataset which has gzip compression enabled will fail" - atf_set "require.progs" mkfile zpool zfs + atf_set "require.progs" zpool zfs } bootfs_008_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/bootfs.cfg ksh93 $(atf_get_srcdir)/bootfs_008_neg.ksh || atf_fail "Testcase failed" } atf_test_case bootfs_009_neg bootfs_009_neg_head() { atf_set "descr" "Valid encrypted datasets can't be set bootfs property values" atf_set "require.config" zfs_encryption atf_set "require.progs" zfs zpool } bootfs_009_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/bootfs.cfg ksh93 $(atf_get_srcdir)/bootfs_009_neg.ksh || atf_fail "Testcase failed" } atf_init_test_cases() { atf_add_test_case bootfs_001_pos atf_add_test_case bootfs_002_neg atf_add_test_case bootfs_003_pos atf_add_test_case bootfs_004_neg atf_add_test_case bootfs_005_neg atf_add_test_case bootfs_006_pos atf_add_test_case bootfs_007_pos atf_add_test_case bootfs_008_neg atf_add_test_case bootfs_009_neg } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cache/cache_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cache/cache_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cache/cache_test.sh (revision 322822) @@ -1,349 +1,349 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case cache_001_pos cleanup cache_001_pos_head() { atf_set "descr" "Creating a pool with a cache device succeeds." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } cache_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cache_001_pos.ksh || atf_fail "Testcase failed" } cache_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case cache_002_pos cleanup cache_002_pos_head() { atf_set "descr" "Adding a cache device to normal pool works." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } cache_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cache_002_pos.ksh || atf_fail "Testcase failed" } cache_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case cache_003_pos cleanup cache_003_pos_head() { atf_set "descr" "Adding an extra cache device works." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } cache_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cache_003_pos.ksh || atf_fail "Testcase failed" } cache_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case cache_004_neg cleanup cache_004_neg_head() { atf_set "descr" "Attaching a cache device fails." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } cache_004_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cache_004_neg.ksh || atf_fail "Testcase failed" } cache_004_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case cache_005_neg cleanup cache_005_neg_head() { atf_set "descr" "Replacing a cache device fails." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } cache_005_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cache_005_neg.ksh || atf_fail "Testcase failed" } cache_005_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case cache_006_pos cleanup cache_006_pos_head() { atf_set "descr" "Exporting and importing pool with cache devices passes." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } cache_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cache_006_pos.ksh || atf_fail "Testcase failed" } cache_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case cache_007_neg cleanup cache_007_neg_head() { atf_set "descr" "A mirror/raidz/raidz2 cache is not supported." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } cache_007_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cache_007_neg.ksh || atf_fail "Testcase failed" } cache_007_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case cache_008_neg cleanup cache_008_neg_head() { atf_set "descr" "A raidz/raidz2 cache can not be added to existed pool." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } cache_008_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cache_008_neg.ksh || atf_fail "Testcase failed" } cache_008_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case cache_009_pos cleanup cache_009_pos_head() { atf_set "descr" "Offline and online a cache device succeed." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } cache_009_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cache_009_pos.ksh || atf_fail "Testcase failed" } cache_009_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case cache_010_neg cleanup cache_010_neg_head() { atf_set "descr" "Cache device can only be disk or slice." - atf_set "require.progs" zfs zpool mkfile + atf_set "require.progs" zfs zpool atf_set "timeout" 1200 } cache_010_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cache_010_neg.ksh || atf_fail "Testcase failed" } cache_010_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case cache_011_pos cleanup cache_011_pos_head() { atf_set "descr" "Remove cache device from pool with spare device should succeed" - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } cache_011_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cache_011_pos.ksh || atf_fail "Testcase failed" } cache_011_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cache.kshlib . $(atf_get_srcdir)/cache.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case cache_001_pos atf_add_test_case cache_002_pos atf_add_test_case cache_003_pos atf_add_test_case cache_004_neg atf_add_test_case cache_005_neg atf_add_test_case cache_006_pos atf_add_test_case cache_007_neg atf_add_test_case cache_008_neg atf_add_test_case cache_009_pos atf_add_test_case cache_010_neg atf_add_test_case cache_011_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cachefile/cachefile_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cachefile/cachefile_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cachefile/cachefile_test.sh (revision 322822) @@ -1,102 +1,102 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case cachefile_001_pos cachefile_001_pos_head() { atf_set "descr" "Creating a pool with \cachefile\ set doesn't update zpool.cache" atf_set "require.progs" zpool } cachefile_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cachefile.kshlib . $(atf_get_srcdir)/cachefile.cfg ksh93 $(atf_get_srcdir)/cachefile_001_pos.ksh || atf_fail "Testcase failed" } atf_test_case cachefile_002_pos cachefile_002_pos_head() { atf_set "descr" "Importing a pool with \cachefile\ set doesn't update zpool.cache" atf_set "require.progs" zpool } cachefile_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cachefile.kshlib . $(atf_get_srcdir)/cachefile.cfg ksh93 $(atf_get_srcdir)/cachefile_002_pos.ksh || atf_fail "Testcase failed" } atf_test_case cachefile_003_pos cachefile_003_pos_head() { atf_set "descr" "Setting altroot=path and cachefile=$CPATH for zpool create succeed." atf_set "require.progs" zpool } cachefile_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cachefile.kshlib . $(atf_get_srcdir)/cachefile.cfg ksh93 $(atf_get_srcdir)/cachefile_003_pos.ksh || atf_fail "Testcase failed" } atf_test_case cachefile_004_pos cachefile_004_pos_head() { atf_set "descr" "Verify set, export and destroy when cachefile is set on pool." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool } cachefile_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/cachefile.kshlib . $(atf_get_srcdir)/cachefile.cfg ksh93 $(atf_get_srcdir)/cachefile_004_pos.ksh || atf_fail "Testcase failed" } atf_init_test_cases() { atf_add_test_case cachefile_001_pos atf_add_test_case cachefile_002_pos atf_add_test_case cachefile_003_pos atf_add_test_case cachefile_004_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh (revision 322822) @@ -1,199 +1,199 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zfs_copies_001_pos cleanup zfs_copies_001_pos_head() { atf_set "descr" "Verify 'copies' property with correct arguments works or not." atf_set "require.progs" zfs } zfs_copies_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_copies_001_pos.ksh || atf_fail "Testcase failed" } zfs_copies_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_copies_002_pos cleanup zfs_copies_002_pos_head() { atf_set "descr" "Verify that the space used by multiple copies is charged correctly." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } zfs_copies_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_copies_002_pos.ksh || atf_fail "Testcase failed" } zfs_copies_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_copies_003_pos cleanup zfs_copies_003_pos_head() { atf_set "descr" "Verify that ZFS volume space used by multiple copies is charged correctly." atf_set "require.progs" zfs } zfs_copies_003_pos_body() { atf_expect_fail "BUG26166 Cannot create pools on zvols" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_copies_003_pos.ksh || atf_fail "Testcase failed" } zfs_copies_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_copies_004_neg cleanup zfs_copies_004_neg_head() { atf_set "descr" "Verify that copies property cannot be set to any value other than 1,2 or 3" atf_set "require.progs" zfs } zfs_copies_004_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_copies_004_neg.ksh || atf_fail "Testcase failed" } zfs_copies_004_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_copies_005_neg cleanup zfs_copies_005_neg_head() { atf_set "descr" "Verify that copies cannot be set with pool version 1" atf_set "require.progs" zfs zpool } zfs_copies_005_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_copies_005_neg.ksh || atf_fail "Testcase failed" } zfs_copies_005_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_copies_006_pos cleanup zfs_copies_006_pos_head() { atf_set "descr" "Verify that ZFS volume space used by multiple copies is charged correctly." - atf_set "require.progs" mkfile zfs + atf_set "require.progs" zfs } zfs_copies_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_copies_006_pos.ksh || atf_fail "Testcase failed" } zfs_copies_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_copies.kshlib . $(atf_get_srcdir)/zfs_copies.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zfs_copies_001_pos atf_add_test_case zfs_copies_002_pos atf_add_test_case zfs_copies_003_pos atf_add_test_case zfs_copies_004_neg atf_add_test_case zfs_copies_005_neg atf_add_test_case zfs_copies_006_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_test.sh (revision 322822) @@ -1,332 +1,332 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zfs_get_001_pos cleanup zfs_get_001_pos_head() { atf_set "descr" "Setting the valid options and properties 'zfs get' should returnthe correct property value." atf_set "require.progs" zfs } zfs_get_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_get_001_pos.ksh || atf_fail "Testcase failed" } zfs_get_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_get_002_pos cleanup zfs_get_002_pos_head() { atf_set "descr" "Setting the valid options and properties 'zfs get' return correctvalue. It should be successful." atf_set "require.progs" zfs } zfs_get_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_get_002_pos.ksh || atf_fail "Testcase failed" } zfs_get_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_get_003_pos cleanup zfs_get_003_pos_head() { atf_set "descr" "'zfs get' should get consistent report with different option." atf_set "require.progs" zfs } zfs_get_003_pos_body() { atf_expect_fail "BUG26181: The remount mount option is broken in SpectraBSD" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_get_003_pos.ksh || atf_fail "Testcase failed" } zfs_get_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_get_004_pos cleanup zfs_get_004_pos_head() { atf_set "descr" "Verify the functions of 'zfs get all' work." - atf_set "require.progs" zfs zpool mkfile + atf_set "require.progs" zfs zpool } zfs_get_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_get_004_pos.ksh || atf_fail "Testcase failed" } zfs_get_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_get_005_neg cleanup zfs_get_005_neg_head() { atf_set "descr" "Setting the invalid option and properties, 'zfs get' should befailed." atf_set "require.progs" zfs } zfs_get_005_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_get_005_neg.ksh || atf_fail "Testcase failed" } zfs_get_005_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_get_006_neg cleanup zfs_get_006_neg_head() { atf_set "descr" "Verify 'zfs get all' fails with invalid combination scenarios." atf_set "require.progs" zfs } zfs_get_006_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_get_006_neg.ksh || atf_fail "Testcase failed" } zfs_get_006_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_get_007_neg cleanup zfs_get_007_neg_head() { atf_set "descr" "'zfs get -o' fails with invalid options or column names" atf_set "require.progs" zfs } zfs_get_007_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_get_007_neg.ksh || atf_fail "Testcase failed" } zfs_get_007_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_get_008_pos cleanup zfs_get_008_pos_head() { atf_set "descr" "Verify '-d ' can work with other options" atf_set "require.progs" zfs } zfs_get_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_get_008_pos.ksh || atf_fail "Testcase failed" } zfs_get_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_get_009_pos cleanup zfs_get_009_pos_head() { atf_set "descr" "'zfs get -d ' should get expected output." atf_set "require.progs" zfs atf_set "timeout" 1200 } zfs_get_009_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_get_009_pos.ksh || atf_fail "Testcase failed" } zfs_get_009_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_get_010_neg cleanup zfs_get_010_neg_head() { atf_set "descr" "A negative depth or a non numeric depth should fail in 'zfs get -d '" atf_set "require.progs" zfs } zfs_get_010_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_get_010_neg.ksh || atf_fail "Testcase failed" } zfs_get_010_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_get_list_d.kshlib . $(atf_get_srcdir)/zfs_get_common.kshlib . $(atf_get_srcdir)/zfs_get.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zfs_get_001_pos atf_add_test_case zfs_get_002_pos atf_add_test_case zfs_get_003_pos atf_add_test_case zfs_get_004_pos atf_add_test_case zfs_get_005_neg atf_add_test_case zfs_get_006_neg atf_add_test_case zfs_get_007_neg atf_add_test_case zfs_get_008_pos atf_add_test_case zfs_get_009_pos atf_add_test_case zfs_get_010_neg } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_test.sh (revision 322822) @@ -1,378 +1,378 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zfs_mount_001_pos cleanup zfs_mount_001_pos_head() { atf_set "descr" "Verify that '$ZFS $mountcmd ' succeeds as root." atf_set "require.progs" zfs } zfs_mount_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_001_pos.ksh || atf_fail "Testcase failed" } zfs_mount_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_002_pos cleanup zfs_mount_002_pos_head() { atf_set "descr" "Verify that '$ZFS $mountcmd' with a filesystemwhose name is not in 'zfs list' will fail with return code 1." atf_set "require.progs" zfs } zfs_mount_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_002_pos.ksh || atf_fail "Testcase failed" } zfs_mount_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_003_pos cleanup zfs_mount_003_pos_head() { atf_set "descr" "Verify that '$ZFS $mountcmd' with a filesystemwhose mountpoint property is 'legacy' or 'none' \will fail with return code 1." atf_set "require.progs" zfs } zfs_mount_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_003_pos.ksh || atf_fail "Testcase failed" } zfs_mount_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_004_pos cleanup zfs_mount_004_pos_head() { atf_set "descr" "Verify that '$ZFS $mountcmd 'with a mounted filesystem will fail with return code 1." atf_set "require.progs" zfs } zfs_mount_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_004_pos.ksh || atf_fail "Testcase failed" } zfs_mount_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_005_pos cleanup zfs_mount_005_pos_head() { atf_set "descr" "Verify that '$ZFS $mountcmd' with a filesystemwhose mountpoint is currently in use will fail with return code 1." atf_set "require.progs" zfs } zfs_mount_005_pos_body() { [[ `uname -s` = "FreeBSD" ]] && atf_skip "Unlike Illumos, FreeBSD allows the behavior the prohibition of which is tested by this testcase" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_005_pos.ksh || atf_fail "Testcase failed" } zfs_mount_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_006_pos cleanup zfs_mount_006_pos_head() { atf_set "descr" "Verify that '$ZFS $mountcmd 'which mountpoint be the identical or the top of an existing one \will fail with return code 1." atf_set "require.progs" zfs } zfs_mount_006_pos_body() { [[ `uname -s` = "FreeBSD" ]] && atf_skip "Unlike Illumos, FreeBSD allows the behavior the prohibition of which is tested by this testcase" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_006_pos.ksh || atf_fail "Testcase failed" } zfs_mount_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_007_pos cleanup zfs_mount_007_pos_head() { atf_set "descr" "Verify '-o' will set filesystem property temporarily,without affecting the property that is stored on disk." atf_set "require.progs" zfs } zfs_mount_007_pos_body() { atf_expect_fail "BUG26181: The remount mount option is broken in SpectraBSD" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_007_pos.ksh || atf_fail "Testcase failed" } zfs_mount_007_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_008_pos cleanup zfs_mount_008_pos_head() { atf_set "descr" "Verify 'zfs mount -O' will override existing mount point." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } zfs_mount_008_pos_body() { [[ `uname -s` = "FreeBSD" ]] && \ atf_skip "Overlay mounts are not supported on FreeBSD" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_008_pos.ksh || atf_fail "Testcase failed" } zfs_mount_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_009_neg cleanup zfs_mount_009_neg_head() { atf_set "descr" "Badly-formed 'zfs $mountcmd' with inapplicable scenariosshould return an error." atf_set "require.progs" zfs } zfs_mount_009_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg [[ -n "$KEEP" ]] && \ atf_skip "Can't test unmount -a when pools are in KEEP" ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_009_neg.ksh || atf_fail "Testcase failed" } zfs_mount_009_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_010_neg cleanup zfs_mount_010_neg_head() { atf_set "descr" "zfs mount fails with mounted filesystem or busy mountpoint" atf_set "require.progs" zfs } zfs_mount_010_neg_body() { [[ `uname -s` = "FreeBSD" ]] && atf_skip "Unlike Illumos, FreeBSD allows the behavior the prohibition of which is tested by this testcase" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_010_neg.ksh || atf_fail "Testcase failed" } zfs_mount_010_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_011_neg cleanup zfs_mount_011_neg_head() { atf_set "descr" "zfs mount fails with bad parameters" atf_set "require.progs" zfs } zfs_mount_011_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_011_neg.ksh || atf_fail "Testcase failed" } zfs_mount_011_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_all_001_pos cleanup zfs_mount_all_001_pos_head() { atf_set "descr" "Verify that 'zfs $mountall' succeeds as root,and all available ZFS filesystems are mounted." atf_set "require.progs" zfs } zfs_mount_all_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg [[ -n "$KEEP" ]] && \ atf_skip "Can't test unmount -a when pools are in KEEP" ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_mount_all_001_pos.ksh || atf_fail "Testcase failed" } zfs_mount_all_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_mount.kshlib . $(atf_get_srcdir)/zfs_mount.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zfs_mount_001_pos atf_add_test_case zfs_mount_002_pos atf_add_test_case zfs_mount_003_pos atf_add_test_case zfs_mount_004_pos atf_add_test_case zfs_mount_005_pos atf_add_test_case zfs_mount_006_pos atf_add_test_case zfs_mount_007_pos atf_add_test_case zfs_mount_008_pos atf_add_test_case zfs_mount_009_neg atf_add_test_case zfs_mount_010_neg atf_add_test_case zfs_mount_011_neg atf_add_test_case zfs_mount_all_001_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_promote/zfs_promote_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_promote/zfs_promote_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_promote/zfs_promote_test.sh (revision 322822) @@ -1,254 +1,254 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zfs_promote_001_pos cleanup zfs_promote_001_pos_head() { atf_set "descr" "'zfs promote' can promote a clone filesystem." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } zfs_promote_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_promote_001_pos.ksh || atf_fail "Testcase failed" } zfs_promote_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_promote_002_pos cleanup zfs_promote_002_pos_head() { atf_set "descr" "'zfs promote' can deal with multiple snapshots in a filesystem." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } zfs_promote_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_promote_002_pos.ksh || atf_fail "Testcase failed" } zfs_promote_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_promote_003_pos cleanup zfs_promote_003_pos_head() { atf_set "descr" "'zfs promote' can deal with multi-point snapshots." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } zfs_promote_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_promote_003_pos.ksh || atf_fail "Testcase failed" } zfs_promote_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_promote_004_pos cleanup zfs_promote_004_pos_head() { atf_set "descr" "'zfs promote' can deal with multi-level clone." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } zfs_promote_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_promote_004_pos.ksh || atf_fail "Testcase failed" } zfs_promote_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_promote_005_pos cleanup zfs_promote_005_pos_head() { atf_set "descr" "The original fs was unmounted, 'zfs promote' still should succeed." atf_set "require.progs" zfs } zfs_promote_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_promote_005_pos.ksh || atf_fail "Testcase failed" } zfs_promote_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_promote_006_neg cleanup zfs_promote_006_neg_head() { atf_set "descr" "'zfs promote' will fail with invalid arguments." atf_set "require.progs" zfs } zfs_promote_006_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_promote_006_neg.ksh || atf_fail "Testcase failed" } zfs_promote_006_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_promote_007_neg cleanup zfs_promote_007_neg_head() { atf_set "descr" "'zfs promote' can deal with name conflicts." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } zfs_promote_007_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_promote_007_neg.ksh || atf_fail "Testcase failed" } zfs_promote_007_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_promote_008_pos cleanup zfs_promote_008_pos_head() { atf_set "descr" "'zfs promote' can promote a volume clone." atf_set "require.progs" zfs } zfs_promote_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_promote_008_pos.ksh || atf_fail "Testcase failed" } zfs_promote_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_promote_common.kshlib . $(atf_get_srcdir)/zfs_promote.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zfs_promote_001_pos atf_add_test_case zfs_promote_002_pos atf_add_test_case zfs_promote_003_pos atf_add_test_case zfs_promote_004_pos atf_add_test_case zfs_promote_005_pos atf_add_test_case zfs_promote_006_neg atf_add_test_case zfs_promote_007_neg atf_add_test_case zfs_promote_008_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_receive/zfs_receive_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_receive/zfs_receive_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_receive/zfs_receive_test.sh (revision 322822) @@ -1,264 +1,264 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zfs_receive_001_pos cleanup zfs_receive_001_pos_head() { atf_set "descr" "Verifying 'zfs receive [] -d ' works." atf_set "require.progs" zfs } zfs_receive_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_receive_001_pos.ksh || atf_fail "Testcase failed" } zfs_receive_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_receive_002_pos cleanup zfs_receive_002_pos_head() { atf_set "descr" "Verifying 'zfs receive ' works." atf_set "require.progs" zfs } zfs_receive_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_receive_002_pos.ksh || atf_fail "Testcase failed" } zfs_receive_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_receive_003_pos cleanup zfs_receive_003_pos_head() { atf_set "descr" "'zfs recv -F' to force rollback." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } zfs_receive_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_receive_003_pos.ksh || atf_fail "Testcase failed" } zfs_receive_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_receive_004_neg cleanup zfs_receive_004_neg_head() { atf_set "descr" "Verify that invalid parameters to 'zfs receive' are caught." atf_set "require.progs" zfs } zfs_receive_004_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_receive_004_neg.ksh || atf_fail "Testcase failed" } zfs_receive_004_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_receive_005_neg cleanup zfs_receive_005_neg_head() { atf_set "descr" "Verify 'zfs receive' fails with unsupported scenarios." atf_set "require.progs" zfs } zfs_receive_005_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_receive_005_neg.ksh || atf_fail "Testcase failed" } zfs_receive_005_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_receive_006_pos cleanup zfs_receive_006_pos_head() { atf_set "descr" "'zfs recv -d ' should succeed no matter ancestor filesystemexists." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } zfs_receive_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_receive_006_pos.ksh || atf_fail "Testcase failed" } zfs_receive_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_receive_007_neg cleanup zfs_receive_007_neg_head() { atf_set "descr" "'zfs recv -F' should fail if the incremental stream does not match" - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } zfs_receive_007_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_receive_007_neg.ksh || atf_fail "Testcase failed" } zfs_receive_007_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_receive_008_pos cleanup zfs_receive_008_pos_head() { atf_set "descr" "Verifying 'zfs receive -vn []and zfs receive -vn -d '" - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } zfs_receive_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_receive_008_pos.ksh || atf_fail "Testcase failed" } zfs_receive_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_receive_009_neg cleanup zfs_receive_009_neg_head() { atf_set "descr" "Verify 'zfs receive' fails with bad option, missing or too many arguments" atf_set "require.progs" zfs } zfs_receive_009_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_receive_009_neg.ksh || atf_fail "Testcase failed" } zfs_receive_009_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_receive.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zfs_receive_001_pos atf_add_test_case zfs_receive_002_pos atf_add_test_case zfs_receive_003_pos atf_add_test_case zfs_receive_004_neg atf_add_test_case zfs_receive_005_neg atf_add_test_case zfs_receive_006_pos atf_add_test_case zfs_receive_007_neg atf_add_test_case zfs_receive_008_pos atf_add_test_case zfs_receive_009_neg } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_rename/zfs_rename_005_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_rename/zfs_rename_005_neg.ksh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_rename/zfs_rename_005_neg.ksh (revision 322822) @@ -1,103 +1,103 @@ #!/usr/local/bin/ksh93 -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 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zfs_rename_005_neg.ksh 1.3 09/06/22 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zfs_rename/zfs_rename.kshlib ################################################################################ # # __stc_assertion_start # # ID: zfs_rename_005_neg # # DESCRIPTION: # 'zfs rename' should fail when the dataset are not within the same pool # # STRATEGY: # 1. Given a file system, snapshot and volume. # 2. Rename each dataset object to a different pool. # 3. Verify the operation fails, and only the original name # is displayed by zfs list. # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2005-09-13) # # __stc_assertion_end # ############################################################################### verify_runnable "global" function my_cleanup { poolexists $TESTPOOL1 && \ destroy_pool $TESTPOOL1 [[ -e $TESTDIR/$TESTFILE1 ]] && \ log_must $RM -f $TESTDIR/$TESTFILE1 cleanup } set -A src_dataset \ "$TESTPOOL/$TESTFS1" "$TESTPOOL/$TESTCTR1" \ "$TESTPOOL/$TESTCTR/$TESTFS1" "$TESTPOOL/$TESTVOL" \ "$TESTPOOL/$TESTFS@snapshot" "$TESTPOOL/$TESTFS-clone" # # cleanup defined in zfs_rename.kshlib # log_onexit my_cleanup log_assert "'zfs rename' should fail while datasets are within different pool." additional_setup typeset FILESIZE=64m -log_must $MKFILE $FILESIZE $TESTDIR/$TESTFILE1 +log_must $TRUNCATE -s $FILESIZE $TESTDIR/$TESTFILE1 create_pool $TESTPOOL1 $TESTDIR/$TESTFILE1 for src in ${src_dataset[@]} ; do dest=${src#$TESTPOOL/} if [[ $dest == *"@"* ]]; then dest=${dest#*@} dest=${TESTPOOL1}@$dest else dest=${TESTPOOL1}/$dest fi log_mustnot $ZFS rename $src $dest log_mustnot $ZFS rename -p $src $dest # # Verify original dataset name still in use # log_must datasetexists $src done log_pass "'zfs rename' fail while datasets are within different pool." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_rename/zfs_rename_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_rename/zfs_rename_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_rename/zfs_rename_test.sh (revision 322822) @@ -1,394 +1,394 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zfs_rename_001_pos cleanup zfs_rename_001_pos_head() { atf_set "descr" "'zfs rename' should successfully rename valid datasets" atf_set "require.progs" zfs } zfs_rename_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_001_pos.ksh || atf_fail "Testcase failed" } zfs_rename_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_002_pos cleanup zfs_rename_002_pos_head() { atf_set "descr" "'zfs rename' should successfully rename valid datasets" atf_set "require.progs" zfs } zfs_rename_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_002_pos.ksh || atf_fail "Testcase failed" } zfs_rename_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_003_pos cleanup zfs_rename_003_pos_head() { atf_set "descr" "'zfs rename' can address the abbreviated snapshot name." atf_set "require.progs" zfs } zfs_rename_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_003_pos.ksh || atf_fail "Testcase failed" } zfs_rename_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_004_neg cleanup zfs_rename_004_neg_head() { atf_set "descr" "'zfs rename' should fail when datasets are of a different type." atf_set "require.progs" zfs } zfs_rename_004_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_004_neg.ksh || atf_fail "Testcase failed" } zfs_rename_004_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_005_neg cleanup zfs_rename_005_neg_head() { atf_set "descr" "'zfs rename' should fail while datasets are within different pool." - atf_set "require.progs" mkfile zfs + atf_set "require.progs" zfs } zfs_rename_005_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_005_neg.ksh || atf_fail "Testcase failed" } zfs_rename_005_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_006_pos cleanup zfs_rename_006_pos_head() { atf_set "descr" "'zfs rename' can successfully rename a volume snapshot." atf_set "require.progs" zfs } zfs_rename_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_006_pos.ksh || atf_fail "Testcase failed" } zfs_rename_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_007_pos cleanup zfs_rename_007_pos_head() { atf_set "descr" "Rename dataset, verify that the data haven't changed." atf_set "require.progs" zfs } zfs_rename_007_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_007_pos.ksh || atf_fail "Testcase failed" } zfs_rename_007_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_008_pos cleanup zfs_rename_008_pos_head() { atf_set "descr" "zfs rename -r can rename snapshot recursively." atf_set "require.progs" zfs } zfs_rename_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_008_pos.ksh || atf_fail "Testcase failed" } zfs_rename_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_009_neg cleanup zfs_rename_009_neg_head() { atf_set "descr" "zfs rename -r failed, when snapshot name is already existing." atf_set "require.progs" zfs } zfs_rename_009_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_009_neg.ksh || atf_fail "Testcase failed" } zfs_rename_009_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_010_neg cleanup zfs_rename_010_neg_head() { atf_set "descr" "The recursive flag -r can only be used for snapshots." atf_set "require.progs" zfs } zfs_rename_010_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_010_neg.ksh || atf_fail "Testcase failed" } zfs_rename_010_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_011_pos cleanup zfs_rename_011_pos_head() { atf_set "descr" "'zfs rename -p' should work as expected" atf_set "require.progs" zfs } zfs_rename_011_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_011_pos.ksh || atf_fail "Testcase failed" } zfs_rename_011_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_012_neg cleanup zfs_rename_012_neg_head() { atf_set "descr" "'zfs rename' should fail with bad option, null target dataset andtoo long target dataset name." atf_set "require.progs" zfs } zfs_rename_012_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_012_neg.ksh || atf_fail "Testcase failed" } zfs_rename_012_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_013_pos cleanup zfs_rename_013_pos_head() { atf_set "descr" "zfs rename -r can rename snapshot when child datasetsdon't have a snapshot of the given name." atf_set "require.progs" zfs } zfs_rename_013_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_rename_013_pos.ksh || atf_fail "Testcase failed" } zfs_rename_013_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zfs_rename.kshlib . $(atf_get_srcdir)/zfs_rename.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zfs_rename_001_pos atf_add_test_case zfs_rename_002_pos atf_add_test_case zfs_rename_003_pos atf_add_test_case zfs_rename_004_neg atf_add_test_case zfs_rename_005_neg atf_add_test_case zfs_rename_006_pos atf_add_test_case zfs_rename_007_pos atf_add_test_case zfs_rename_008_pos atf_add_test_case zfs_rename_009_neg atf_add_test_case zfs_rename_010_neg atf_add_test_case zfs_rename_011_pos atf_add_test_case zfs_rename_012_neg atf_add_test_case zfs_rename_013_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool/zpool_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool/zpool_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool/zpool_test.sh (revision 322822) @@ -1,108 +1,108 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zpool_001_neg cleanup zpool_001_neg_head() { atf_set "descr" "Execute zpool sub-command without proper parameters." atf_set "require.progs" zpool } zpool_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_001_neg.ksh || atf_fail "Testcase failed" } zpool_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_002_pos cleanup zpool_002_pos_head() { atf_set "descr" "With ZFS_ABORT set, all zpool commands can abort and generate a core file." - atf_set "require.progs" mkfile zpool coreadm + atf_set "require.progs" zpool coreadm } zpool_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_002_pos.ksh || atf_fail "Testcase failed" } zpool_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_003_pos cleanup zpool_003_pos_head() { atf_set "descr" "Debugging features of zpool should succeed." atf_set "require.progs" zpool } zpool_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_003_pos.ksh || atf_fail "Testcase failed" } zpool_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zpool_001_neg atf_add_test_case zpool_002_pos atf_add_test_case zpool_003_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh (revision 322822) @@ -1,301 +1,301 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zpool_add_001_pos cleanup zpool_add_001_pos_head() { atf_set "descr" "'zpool add ...' can add devices to the pool." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_001_pos.ksh || atf_fail "Testcase failed" } zpool_add_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_002_pos cleanup zpool_add_002_pos_head() { atf_set "descr" "'zpool add -f ...' can successfully adddevices to the pool in some cases." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_002_pos.ksh || atf_fail "Testcase failed" } zpool_add_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_003_pos cleanup zpool_add_003_pos_head() { atf_set "descr" "'zpool add -n ...' can display the configurationwithout actually adding devices to the pool." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_003_pos.ksh || atf_fail "Testcase failed" } zpool_add_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_004_pos cleanup zpool_add_004_pos_head() { atf_set "descr" "'zpool add ...' can add zfs volume to the pool." atf_set "require.config" disks_are_physical atf_set "require.progs" zfs zpool atf_set "timeout" 2400 } zpool_add_004_pos_body() { atf_expect_fail "BUG26166 Cannot create pools on zvols" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_004_pos.ksh || atf_fail "Testcase failed" } zpool_add_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_005_pos cleanup zpool_add_005_pos_head() { atf_set "descr" "'zpool add' should fail with inapplicable scenarios." atf_set "require.config" disks_are_physical atf_set "require.progs" dumpadm zpool atf_set "timeout" 2400 } zpool_add_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_005_pos.ksh || atf_fail "Testcase failed" } zpool_add_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_006_pos cleanup zpool_add_006_pos_head() { atf_set "descr" "'zpool add [-f]' can add large numbers of vdevs to the specified pool without any errors." atf_set "require.config" disks_are_physical - atf_set "require.progs" zfs mkfile zpool + atf_set "require.progs" zfs zpool atf_set "timeout" 2400 } zpool_add_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_006_pos.ksh || atf_fail "Testcase failed" } zpool_add_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_007_neg cleanup zpool_add_007_neg_head() { atf_set "descr" "'zpool add' should return an error with badly-formed parameters." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_007_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_007_neg.ksh || atf_fail "Testcase failed" } zpool_add_007_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_008_neg cleanup zpool_add_008_neg_head() { atf_set "descr" "'zpool add' should return an error with nonexistent pools and vdevs" atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_008_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_008_neg.ksh || atf_fail "Testcase failed" } zpool_add_008_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_009_neg cleanup zpool_add_009_neg_head() { atf_set "descr" "'zpool add' should fail if vdevs are the same or vdev iscontained in the given pool." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_009_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_009_neg.ksh || atf_fail "Testcase failed" } zpool_add_009_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zpool_add_001_pos atf_add_test_case zpool_add_002_pos atf_add_test_case zpool_add_003_pos atf_add_test_case zpool_add_004_pos atf_add_test_case zpool_add_005_pos atf_add_test_case zpool_add_006_pos atf_add_test_case zpool_add_007_neg atf_add_test_case zpool_add_008_neg atf_add_test_case zpool_add_009_neg } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_test.sh (revision 322822) @@ -1,138 +1,138 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zpool_clear_001_pos cleanup zpool_clear_001_pos_head() { atf_set "descr" "Verify 'zpool clear' can clear errors of a storage pool." - atf_set "require.progs" mkfile zpool zfs + atf_set "require.progs" zpool zfs atf_set "timeout" 2100 } zpool_clear_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_clear.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_clear_001_pos.ksh || atf_fail "Testcase failed" } zpool_clear_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_clear.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_clear_002_neg cleanup zpool_clear_002_neg_head() { atf_set "descr" "Execute 'zpool clear' using invalid parameters." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 2100 } zpool_clear_002_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_clear.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_clear_002_neg.ksh || atf_fail "Testcase failed" } zpool_clear_002_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_clear.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_clear_003_neg cleanup zpool_clear_003_neg_head() { atf_set "descr" "Verify 'zpool clear' cannot clear error for available spare devices." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 2100 } zpool_clear_003_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_clear.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_clear_003_neg.ksh || atf_fail "Testcase failed" } zpool_clear_003_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_clear.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_clear_004_pos cleanup zpool_clear_004_pos_head() { atf_set "descr" "Verify 'zpool clear' can work on spare vdevs" - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 2100 } zpool_clear_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_clear.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_clear_004_pos.ksh || atf_fail "Testcase failed" } zpool_clear_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_clear.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zpool_clear_001_pos atf_add_test_case zpool_clear_002_neg atf_add_test_case zpool_clear_003_neg atf_add_test_case zpool_clear_004_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh (revision 322822) @@ -1,723 +1,723 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zpool_create_001_pos cleanup zpool_create_001_pos_head() { atf_set "descr" "'zpool create ...' can successfully createa new pool with a name in ZFS namespace." atf_set "require.config" disks_are_physical - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_001_pos.ksh || atf_fail "Testcase failed" } zpool_create_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_002_pos cleanup zpool_create_002_pos_head() { atf_set "descr" "'zpool create -f ...' can successfully createa new pool in some cases." atf_set "require.config" disks_are_physical - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_002_pos.ksh || atf_fail "Testcase failed" } zpool_create_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_003_pos cleanup zpool_create_003_pos_head() { atf_set "descr" "'zpool create -n ...' can display the configureationwithout actually creating the pool." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_003_pos.ksh || atf_fail "Testcase failed" } zpool_create_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_004_pos cleanup zpool_create_004_pos_head() { atf_set "descr" "'zpool create [-f]' can create a storage pool with large numbers of vdevswithout any errors." atf_set "require.config" disks_are_physical - atf_set "require.progs" zfs mkfile zpool + atf_set "require.progs" zfs zpool atf_set "timeout" 2400 } zpool_create_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_004_pos.ksh || atf_fail "Testcase failed" } zpool_create_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_005_pos cleanup zpool_create_005_pos_head() { atf_set "descr" "'zpool create [-R root][-m mountpoint] ...' can createan alternate pool or a new pool mounted at the specified mountpoint." atf_set "require.config" disks_are_physical - atf_set "require.progs" mkfile zpool zfs + atf_set "require.progs" zpool zfs atf_set "timeout" 2400 } zpool_create_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_005_pos.ksh || atf_fail "Testcase failed" } zpool_create_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_006_pos cleanup zpool_create_006_pos_head() { atf_set "descr" "Verify 'zpool create' succeed with keywords combination." atf_set "require.config" disks_are_physical - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_006_pos.ksh || atf_fail "Testcase failed" } zpool_create_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_007_neg cleanup zpool_create_007_neg_head() { atf_set "descr" "'zpool create' should return an error with badly-formed parameters." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_007_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_007_neg.ksh || atf_fail "Testcase failed" } zpool_create_007_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_008_pos cleanup zpool_create_008_pos_head() { atf_set "descr" "'zpool create' have to use '-f' scenarios" atf_set "require.config" disks_are_physical atf_set "require.progs" zpool format atf_set "timeout" 2400 } zpool_create_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_008_pos.ksh || atf_fail "Testcase failed" } zpool_create_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_009_neg cleanup zpool_create_009_neg_head() { atf_set "descr" "Create a pool with same devices twice or create two pools withsame devices, 'zpool create' should fail." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_009_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_009_neg.ksh || atf_fail "Testcase failed" } zpool_create_009_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_010_neg cleanup zpool_create_010_neg_head() { atf_set "descr" "'zpool create' should return an error with VDEVs <64mb" atf_set "require.config" disks_are_physical - atf_set "require.progs" zfs mkfile zpool + atf_set "require.progs" zfs zpool atf_set "timeout" 2400 } zpool_create_010_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_010_neg.ksh || atf_fail "Testcase failed" } zpool_create_010_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_011_neg cleanup zpool_create_011_neg_head() { atf_set "descr" "'zpool create' should be failed with inapplicable scenarios." atf_set "require.config" disks_are_physical atf_set "require.progs" dumpadm zpool atf_set "timeout" 2400 } zpool_create_011_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_011_neg.ksh || atf_fail "Testcase failed" } zpool_create_011_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_012_neg cleanup zpool_create_012_neg_head() { atf_set "descr" "'zpool create' should fail with disk slice in swap." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool swap atf_set "timeout" 2400 } zpool_create_012_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_012_neg.ksh || atf_fail "Testcase failed" } zpool_create_012_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_013_neg cleanup zpool_create_013_neg_head() { atf_set "descr" "'zpool create' should fail with metadevice in swap." atf_set "require.config" disks_are_physical atf_set "require.progs" metadb metaclear metastat zpool metainit swap atf_set "timeout" 2400 } zpool_create_013_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_013_neg.ksh || atf_fail "Testcase failed" } zpool_create_013_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_014_neg cleanup zpool_create_014_neg_head() { atf_set "descr" "'zpool create' should fail with regular file in swap." atf_set "require.config" disks_are_physical - atf_set "require.progs" zfs mkfile swap zpool + atf_set "require.progs" zfs swap zpool atf_set "timeout" 2400 } zpool_create_014_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_014_neg.ksh || atf_fail "Testcase failed" } zpool_create_014_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_015_neg cleanup zpool_create_015_neg_head() { atf_set "descr" "'zpool create' should fail with zfs vol device in swap." atf_set "require.config" disks_are_physical atf_set "require.progs" zfs zpool swap atf_set "timeout" 2400 } zpool_create_015_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_015_neg.ksh || atf_fail "Testcase failed" } zpool_create_015_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_016_pos cleanup zpool_create_016_pos_head() { atf_set "descr" "'zpool create' should success with no device in swap." atf_set "require.config" disks_are_physical atf_set "require.progs" dumpadm swapadd zpool swap atf_set "timeout" 2400 } zpool_create_016_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_016_pos.ksh || atf_fail "Testcase failed" } zpool_create_016_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_017_neg cleanup zpool_create_017_neg_head() { atf_set "descr" "'zpool create' should fail with mountpoint exists and not empty." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_017_neg_body() { [ `uname -s` = "FreeBSD" ] && atf_skip "FreeBSD does not consider creating pools on non-empty mountpoints a bug" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_017_neg.ksh || atf_fail "Testcase failed" } zpool_create_017_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_018_pos cleanup zpool_create_018_pos_head() { atf_set "descr" "zpool create can create pools with specified properties" atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_018_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_018_pos.ksh || atf_fail "Testcase failed" } zpool_create_018_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_019_pos cleanup zpool_create_019_pos_head() { atf_set "descr" "zpool create cannot create pools specifying readonly properties" atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_019_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_019_pos.ksh || atf_fail "Testcase failed" } zpool_create_019_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_020_pos cleanup zpool_create_020_pos_head() { atf_set "descr" "zpool create -R works as expected" atf_set "require.config" disks_are_physical atf_set "require.progs" zfs zpool atf_set "timeout" 2400 } zpool_create_020_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_020_pos.ksh || atf_fail "Testcase failed" } zpool_create_020_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_021_pos cleanup zpool_create_021_pos_head() { atf_set "descr" "'zpool create -O property=value pool' can successfully create a poolwith correct filesystem property set." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_021_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_021_pos.ksh || atf_fail "Testcase failed" } zpool_create_021_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_022_pos cleanup zpool_create_022_pos_head() { atf_set "descr" "'zpool create -O property=value pool' can successfully create a poolwith multiple filesystem properties set." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_022_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_022_pos.ksh || atf_fail "Testcase failed" } zpool_create_022_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_023_neg cleanup zpool_create_023_neg_head() { atf_set "descr" "'zpool create -O' should return an error with badly formed parameters." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_023_neg_body() { atf_expect_fail 'BUG26172: "zpool create" does not validate the sharenfs parameter' export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_023_neg.ksh || atf_fail "Testcase failed" } zpool_create_023_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zpool_create_001_pos atf_add_test_case zpool_create_002_pos atf_add_test_case zpool_create_003_pos atf_add_test_case zpool_create_004_pos atf_add_test_case zpool_create_005_pos atf_add_test_case zpool_create_006_pos atf_add_test_case zpool_create_007_neg atf_add_test_case zpool_create_008_pos atf_add_test_case zpool_create_009_neg atf_add_test_case zpool_create_010_neg atf_add_test_case zpool_create_011_neg atf_add_test_case zpool_create_012_neg atf_add_test_case zpool_create_013_neg atf_add_test_case zpool_create_014_neg atf_add_test_case zpool_create_015_neg atf_add_test_case zpool_create_016_pos atf_add_test_case zpool_create_017_neg atf_add_test_case zpool_create_018_pos atf_add_test_case zpool_create_019_pos atf_add_test_case zpool_create_020_pos atf_add_test_case zpool_create_021_pos atf_add_test_case zpool_create_022_pos atf_add_test_case zpool_create_023_neg } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export_test.sh (revision 322822) @@ -1,134 +1,134 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zpool_export_001_pos cleanup zpool_export_001_pos_head() { atf_set "descr" "Verify a pool can be exported." atf_set "require.progs" zfs zpool } zpool_export_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_export.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_export_001_pos.ksh || atf_fail "Testcase failed" } zpool_export_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_export.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_export_002_pos cleanup zpool_export_002_pos_head() { atf_set "descr" "Verify a busy ZPOOL cannot be exported." atf_set "require.progs" zfs zpool } zpool_export_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_export.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_export_002_pos.ksh || atf_fail "Testcase failed" } zpool_export_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_export.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_export_003_neg cleanup zpool_export_003_neg_head() { atf_set "descr" "'zpool export' should return an error with badly-formed parameters." atf_set "require.progs" zfs zpool } zpool_export_003_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_export.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_export_003_neg.ksh || atf_fail "Testcase failed" } zpool_export_003_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_export.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_export_004_pos cleanup zpool_export_004_pos_head() { atf_set "descr" "Verify zpool export succeed or fail with spare." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool } zpool_export_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_export.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_export_004_pos.ksh || atf_fail "Testcase failed" } zpool_export_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_export.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zpool_export_001_pos atf_add_test_case zpool_export_002_pos atf_add_test_case zpool_export_003_neg atf_add_test_case zpool_export_004_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_missing_005_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_missing_005_pos.ksh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_missing_005_pos.ksh (revision 322822) @@ -1,122 +1,122 @@ #!/usr/local/bin/ksh93 -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 2016 Spectra Logic All rights reserved. # Use is subject to license terms. # . $STF_SUITE/include/libtest.kshlib ################################################################################# # # __stc_assertion_start # # ID: zpool_import_missing_005_pos # # DESCRIPTION: # Verify that a pool can still be imported even if its devices' names # have changed, for all types of devices. This is a test of vdev_geom's # import_by_guid functionality. # STRATEGY: # 1. Create a supply of file-backed md devices # 2. Create a disk-backed pool with regular, cache, log, and spare vdevs # 3. Export it # 4. Cause all the md devices names to change # 5. Verify 'zpool import' can import it # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2015-01-4) # # __stc_assertion_end # ################################################################################ verify_runnable "global" log_assert "Verify that all types of vdevs of a disk-backed exported pool can be imported even if they have been renamed" # Create md devices so we can control their devnames # Use high devnames so we'll be unlikely to have collisions typeset -i REGULAR_U=4000 typeset -i LOG_U=4001 typeset -i CACHE_U=4002 typeset -i SPARE_U=4003 typeset -i REGULAR_ALTU=5000 typeset -i LOG_ALTU=5001 typeset -i CACHE_ALTU=5002 typeset -i SPARE_ALTU=5003 typeset REGULAR=${TMPDIR}/regular typeset LOG=${TMPDIR}/log typeset CACHE=${TMPDIR}/cache typeset SPARE=${TMPDIR}/spare function cleanup { destroy_pool $TESTPOOL $MDCONFIG -d -u $REGULAR_U 2>/dev/null $MDCONFIG -d -u $LOG_U 2>/dev/null $MDCONFIG -d -u $CACHE_U 2>/dev/null $MDCONFIG -d -u $SPARE_U 2>/dev/null $MDCONFIG -d -u $REGULAR_ALTU 2>/dev/null $MDCONFIG -d -u $LOG_ALTU 2>/dev/null $MDCONFIG -d -u $CACHE_ALTU 2>/dev/null $MDCONFIG -d -u $SPARE_ALTU 2>/dev/null $RM -f $REGULAR $RM -f $CACHE $RM -f $LOG $RM -f $SPARE } log_onexit cleanup -log_must $MKFILE 64m $REGULAR -log_must $MKFILE 64m $LOG -log_must $MKFILE 64m $CACHE -log_must $MKFILE 64m $SPARE +log_must $TRUNCATE -s 64m $REGULAR +log_must $TRUNCATE -s 64m $LOG +log_must $TRUNCATE -s 64m $CACHE +log_must $TRUNCATE -s 64m $SPARE log_must $MDCONFIG -t vnode -a -f $REGULAR -u $REGULAR_U log_must $MDCONFIG -t vnode -a -f $LOG -u $LOG_U log_must $MDCONFIG -t vnode -a -f $CACHE -u $CACHE_U log_must $MDCONFIG -t vnode -a -f $SPARE -u $SPARE_U log_must $ZPOOL create $TESTPOOL md$REGULAR_U log md$LOG_U cache md$CACHE_U spare md$SPARE_U log_must $ZPOOL export $TESTPOOL # Now destroy the md devices, then recreate them with different names log_must $MDCONFIG -d -u $REGULAR_U log_must $MDCONFIG -d -u $LOG_U log_must $MDCONFIG -d -u $CACHE_U log_must $MDCONFIG -d -u $SPARE_U log_must $MDCONFIG -t vnode -a -f $REGULAR -u $REGULAR_ALTU log_must $MDCONFIG -t vnode -a -f $LOG -u $LOG_ALTU log_must $MDCONFIG -t vnode -a -f $CACHE -u $CACHE_ALTU log_must $MDCONFIG -t vnode -a -f $SPARE -u $SPARE_ALTU log_must $ZPOOL import $TESTPOOL zpool status $TESTPOOL log_must check_state $TESTPOOL md${REGULAR_ALTU} ONLINE log_must check_state $TESTPOOL md${LOG_ALTU} ONLINE log_must check_state $TESTPOOL md${CACHE_ALTU} ONLINE log_must check_state $TESTPOOL md${SPARE_ALTU} AVAIL log_pass Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_test.sh (revision 322822) @@ -1,594 +1,594 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zpool_import_002_pos cleanup zpool_import_002_pos_head() { atf_set "descr" "Verify that an exported pool can be imported and cannot be imported more than once." atf_set "require.config" at_least_2_disks - atf_set "require.progs" zfs zpool sum mkfile zdb + atf_set "require.progs" zfs zpool sum zdb atf_set "timeout" 2400 } zpool_import_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_002_pos.ksh || atf_fail "Testcase failed" } zpool_import_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_003_pos cleanup zpool_import_003_pos_head() { atf_set "descr" "Destroyed pools are not listed unless with -D option is specified." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool zfs + atf_set "require.progs" zpool zfs atf_set "timeout" 2400 } zpool_import_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_003_pos.ksh || atf_fail "Testcase failed" } zpool_import_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_004_pos cleanup zpool_import_004_pos_head() { atf_set "descr" "Destroyed pools devices was moved to another directory,it still can be imported correctly." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool zfs zdb + atf_set "require.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_004_pos.ksh || atf_fail "Testcase failed" } zpool_import_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_005_pos cleanup zpool_import_005_pos_head() { atf_set "descr" "Destroyed pools devices was renamed, it still can be importedcorrectly." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool zfs zdb + atf_set "require.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_005_pos.ksh || atf_fail "Testcase failed" } zpool_import_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_006_pos cleanup zpool_import_006_pos_head() { atf_set "descr" "For mirror, N-1 destroyed pools devices was removed or usedby other pool, it still can be imported correctly." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool zfs zdb + atf_set "require.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_006_pos.ksh || atf_fail "Testcase failed" } zpool_import_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_007_pos cleanup zpool_import_007_pos_head() { atf_set "descr" "For raidz, one destroyed pools devices was removed or used byother pool, it still can be imported correctly." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool zfs zdb + atf_set "require.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_007_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_007_pos.ksh || atf_fail "Testcase failed" } zpool_import_007_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_008_pos cleanup zpool_import_008_pos_head() { atf_set "descr" "For raidz2, two destroyed pools devices was removed or used byother pool, it still can be imported correctly." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool zfs zdb + atf_set "require.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_008_pos.ksh || atf_fail "Testcase failed" } zpool_import_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_009_neg cleanup zpool_import_009_neg_head() { atf_set "descr" "Badly-formed 'zpool import' with inapplicable scenariosshould return an error." atf_set "require.config" at_least_2_disks - atf_set "require.progs" zfs zpool mkfile + atf_set "require.progs" zfs zpool atf_set "timeout" 2400 } zpool_import_009_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_009_neg.ksh || atf_fail "Testcase failed" } zpool_import_009_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_010_pos cleanup zpool_import_010_pos_head() { atf_set "descr" "'zpool -D -a' can import all the specified directoriesdestroyed pools." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool zfs + atf_set "require.progs" zpool zfs atf_set "timeout" 2400 } zpool_import_010_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_010_pos.ksh || atf_fail "Testcase failed" } zpool_import_010_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_011_neg cleanup zpool_import_011_neg_head() { atf_set "descr" "For strip pool, any destroyed pool devices was demaged,zpool import -D will failed." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool zfs zdb + atf_set "require.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_011_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_011_neg.ksh || atf_fail "Testcase failed" } zpool_import_011_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_012_pos cleanup zpool_import_012_pos_head() { atf_set "descr" "Verify all mount & share status of sub-filesystems within a poolcan be restored after import [-Df]." atf_set "require.config" at_least_2_disks - atf_set "require.progs" zfs zpool mkfile zdb share + atf_set "require.progs" zfs zpool zdb share atf_set "timeout" 2400 } zpool_import_012_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_012_pos.ksh || atf_fail "Testcase failed" } zpool_import_012_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_013_neg cleanup zpool_import_013_neg_head() { atf_set "descr" "'zpool import' fail while pool may be in use from other system,it need import forcefully." atf_set "require.config" at_least_2_disks - atf_set "require.progs" zfs zpool mkfile + atf_set "require.progs" zfs zpool atf_set "timeout" 2400 } zpool_import_013_neg_body() { atf_expect_fail 'BUG26195: "zpool import" without "-f" will import foreign, in-use, downrev pools' export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_013_neg.ksh || atf_fail "Testcase failed" } zpool_import_013_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_014_pos cleanup zpool_import_014_pos_head() { atf_set "descr" "'zpool import' can import destroyed disk-backed pools" atf_set "require.config" at_least_1_disks atf_set "require.progs" zfs zpool } zpool_import_014_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/zpool_import_014_pos.ksh || atf_fail "Testcase failed" } zpool_import_014_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_all_001_pos cleanup zpool_import_all_001_pos_head() { atf_set "descr" "Verify that 'zpool import -a' succeeds as root." atf_set "require.config" at_least_2_disks - atf_set "require.progs" zfs zpool sum mkfile + atf_set "require.progs" zfs zpool sum atf_set "timeout" 2400 } zpool_import_all_001_pos_body() { atf_skip "This test relies heavily on Solaris slices. It could be ported, but that is difficult due to the high degree of obfuscation in the code" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_all_001_pos.ksh || atf_fail "Testcase failed" } zpool_import_all_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_missing_001_pos cleanup zpool_import_missing_001_pos_head() { atf_set "descr" "Verify that import could handle damaged or missing device." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zfs sum zpool zdb + atf_set "require.progs" zfs sum zpool zdb atf_set "timeout" 2400 } zpool_import_missing_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_missing_001_pos.ksh || atf_fail "Testcase failed" } zpool_import_missing_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_missing_002_pos cleanup zpool_import_missing_002_pos_head() { atf_set "descr" "Verify that import could handle moving device." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool zfs zdb + atf_set "require.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_missing_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_missing_002_pos.ksh || atf_fail "Testcase failed" } zpool_import_missing_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_missing_003_pos cleanup zpool_import_missing_003_pos_head() { atf_set "descr" "Verify that import could handle device overlapped." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool sum zfs + atf_set "require.progs" zpool sum zfs atf_set "timeout" 2400 } zpool_import_missing_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_missing_003_pos.ksh || atf_fail "Testcase failed" } zpool_import_missing_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_missing_004_pos zpool_import_missing_004_pos_head() { atf_set "descr" "Verify that zpool import succeeds when devices are missing" - atf_set "require.progs" mkfile zfs zpool + atf_set "require.progs" zfs zpool atf_set "timeout" 300 } zpool_import_missing_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/zpool_import_missing_004_pos.ksh || atf_fail "Testcase failed" } atf_test_case zpool_import_missing_005_pos zpool_import_missing_005_pos_head() { atf_set "descr" "Verify that zpool import succeeds when devices of all types have been renamed" - atf_set "require.progs" mkfile mdconfig zfs zpool + atf_set "require.progs" mdconfig zfs zpool atf_set "timeout" 300 } zpool_import_missing_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/zpool_import_missing_005_pos.ksh || atf_fail "Testcase failed" } atf_test_case zpool_import_rename_001_pos cleanup zpool_import_rename_001_pos_head() { atf_set "descr" "Verify that an imported pool can be renamed." atf_set "require.config" at_least_2_disks - atf_set "require.progs" zfs zpool sum mkfile zdb + atf_set "require.progs" zfs zpool sum zdb atf_set "timeout" 2400 } zpool_import_rename_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_import_rename_001_pos.ksh || atf_fail "Testcase failed" } zpool_import_rename_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_corrupt_001_pos cleanup zpool_import_corrupt_001_pos_head() { atf_set "descr" "Verify that a disk-backed exported pool with some of its vdev labels corrupted can still be imported" atf_set "require.config" at_least_1_disks atf_set "require.progs" zfs zpool zdb atf_set "timeout" 2400 } zpool_import_corrupt_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/zpool_import_corrupt_001_pos.ksh || atf_fail "Testcase failed" } zpool_import_corrupt_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zpool_import_002_pos atf_add_test_case zpool_import_003_pos atf_add_test_case zpool_import_004_pos atf_add_test_case zpool_import_005_pos atf_add_test_case zpool_import_006_pos atf_add_test_case zpool_import_007_pos atf_add_test_case zpool_import_008_pos atf_add_test_case zpool_import_009_neg atf_add_test_case zpool_import_010_pos atf_add_test_case zpool_import_011_neg atf_add_test_case zpool_import_012_pos atf_add_test_case zpool_import_013_neg atf_add_test_case zpool_import_014_pos atf_add_test_case zpool_import_all_001_pos atf_add_test_case zpool_import_missing_001_pos atf_add_test_case zpool_import_missing_002_pos atf_add_test_case zpool_import_missing_003_pos atf_add_test_case zpool_import_missing_004_pos atf_add_test_case zpool_import_missing_005_pos atf_add_test_case zpool_import_rename_001_pos atf_add_test_case zpool_import_corrupt_001_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_scrub/zpool_scrub_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_scrub/zpool_scrub_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_scrub/zpool_scrub_test.sh (revision 322822) @@ -1,165 +1,165 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zpool_scrub_001_neg cleanup zpool_scrub_001_neg_head() { atf_set "descr" "Execute 'zpool scrub' using invalid parameters." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool } zpool_scrub_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_scrub.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_scrub_001_neg.ksh || atf_fail "Testcase failed" } zpool_scrub_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_scrub.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_scrub_002_pos cleanup zpool_scrub_002_pos_head() { atf_set "descr" "Verify scrub -s works correctly." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool } zpool_scrub_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_scrub.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_scrub_002_pos.ksh || atf_fail "Testcase failed" } zpool_scrub_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_scrub.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_scrub_003_pos cleanup zpool_scrub_003_pos_head() { atf_set "descr" "scrub command terminates the existing scrub process and starts a new scrub." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool } zpool_scrub_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_scrub.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_scrub_003_pos.ksh || atf_fail "Testcase failed" } zpool_scrub_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_scrub.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_scrub_004_pos cleanup zpool_scrub_004_pos_head() { atf_set "descr" "Resilver prevent scrub from starting until the resilver completes" atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool } zpool_scrub_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_scrub.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_scrub_004_pos.ksh || atf_fail "Testcase failed" } zpool_scrub_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_scrub.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_scrub_005_pos cleanup zpool_scrub_005_pos_head() { atf_set "descr" "When scrubbing, detach device should not break system." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool } zpool_scrub_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_scrub.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_scrub_005_pos.ksh || atf_fail "Testcase failed" } zpool_scrub_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_scrub.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zpool_scrub_001_neg atf_add_test_case zpool_scrub_002_pos atf_add_test_case zpool_scrub_003_pos atf_add_test_case zpool_scrub_004_pos atf_add_test_case zpool_scrub_005_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_set/zpool_set_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_set/zpool_set_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_set/zpool_set_test.sh (revision 322822) @@ -1,78 +1,78 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zpool_set_001_pos zpool_set_001_pos_head() { atf_set "descr" "zpool set usage message is displayed when called with no arguments" atf_set "require.progs" zpool } zpool_set_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg ksh93 $(atf_get_srcdir)/zpool_set_001_pos.ksh || atf_fail "Testcase failed" } atf_test_case zpool_set_002_neg zpool_set_002_neg_head() { atf_set "descr" "Malformed zpool set commands are rejected" - atf_set "require.progs" mkfile zpool zfs + atf_set "require.progs" zpool zfs } zpool_set_002_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg ksh93 $(atf_get_srcdir)/zpool_set_002_neg.ksh || atf_fail "Testcase failed" } atf_test_case zpool_set_003_neg zpool_set_003_neg_head() { atf_set "descr" "zpool set cannot set a readonly property" - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool } zpool_set_003_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg ksh93 $(atf_get_srcdir)/zpool_set_003_neg.ksh || atf_fail "Testcase failed" } atf_init_test_cases() { atf_add_test_case zpool_set_001_pos atf_add_test_case zpool_set_002_neg atf_add_test_case zpool_set_003_neg } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_user/misc/misc_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_user/misc/misc_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_user/misc/misc_test.sh (revision 322822) @@ -1,1188 +1,1188 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zdb_001_neg cleanup zdb_001_neg_head() { atf_set "descr" "zdb can't run as a user on datasets, but can run without arguments" - atf_set "require.progs" zfs mkfile fgrep zpool zdb + atf_set "require.progs" zfs fgrep zpool zdb atf_set "require.user" root } zdb_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zdb_001_neg.ksh" || atf_fail "Testcase failed" } zdb_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_001_neg cleanup zfs_001_neg_head() { atf_set "descr" "zfs shows a usage message when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_001_neg.ksh" || atf_fail "Testcase failed" } zfs_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_allow_001_neg cleanup zfs_allow_001_neg_head() { atf_set "descr" "zfs allow returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep logname zpool + atf_set "require.progs" zfs fgrep logname zpool atf_set "require.user" root } zfs_allow_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_allow_001_neg.ksh" || atf_fail "Testcase failed" } zfs_allow_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_clone_001_neg cleanup zfs_clone_001_neg_head() { atf_set "descr" "zfs clone returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_clone_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_clone_001_neg.ksh" || atf_fail "Testcase failed" } zfs_clone_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_create_001_neg cleanup zfs_create_001_neg_head() { atf_set "descr" "Verify zfs create without parameters fails." - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_create_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_create_001_neg.ksh" || atf_fail "Testcase failed" } zfs_create_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_destroy_001_neg cleanup zfs_destroy_001_neg_head() { atf_set "descr" "zfs destroy [-f|-r] [fs|snap]" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_destroy_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_destroy_001_neg.ksh" || atf_fail "Testcase failed" } zfs_destroy_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_get_001_neg cleanup zfs_get_001_neg_head() { atf_set "descr" "zfs get works when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_get_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_get_001_neg.ksh" || atf_fail "Testcase failed" } zfs_get_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_inherit_001_neg cleanup zfs_inherit_001_neg_head() { atf_set "descr" "zfs inherit returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_inherit_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_inherit_001_neg.ksh" || atf_fail "Testcase failed" } zfs_inherit_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_mount_001_neg cleanup zfs_mount_001_neg_head() { atf_set "descr" "zfs mount returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_mount_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_mount_001_neg.ksh" || atf_fail "Testcase failed" } zfs_mount_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_promote_001_neg cleanup zfs_promote_001_neg_head() { atf_set "descr" "zfs promote returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_promote_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_promote_001_neg.ksh" || atf_fail "Testcase failed" } zfs_promote_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_receive_001_neg cleanup zfs_receive_001_neg_head() { atf_set "descr" "zfs receive returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_receive_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_receive_001_neg.ksh" || atf_fail "Testcase failed" } zfs_receive_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rename_001_neg cleanup zfs_rename_001_neg_head() { atf_set "descr" "zfs rename returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_rename_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_rename_001_neg.ksh" || atf_fail "Testcase failed" } zfs_rename_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_rollback_001_neg cleanup zfs_rollback_001_neg_head() { atf_set "descr" "zfs rollback returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_rollback_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_rollback_001_neg.ksh" || atf_fail "Testcase failed" } zfs_rollback_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_send_001_neg cleanup zfs_send_001_neg_head() { atf_set "descr" "zfs send returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_send_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_send_001_neg.ksh" || atf_fail "Testcase failed" } zfs_send_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_set_001_neg cleanup zfs_set_001_neg_head() { atf_set "descr" "zfs set returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_set_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_set_001_neg.ksh" || atf_fail "Testcase failed" } zfs_set_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_share_001_neg cleanup zfs_share_001_neg_head() { atf_set "descr" "zfs share returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_share_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_share_001_neg.ksh" || atf_fail "Testcase failed" } zfs_share_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_snapshot_001_neg cleanup zfs_snapshot_001_neg_head() { atf_set "descr" "zfs snapshot returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_snapshot_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_snapshot_001_neg.ksh" || atf_fail "Testcase failed" } zfs_snapshot_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_unallow_001_neg cleanup zfs_unallow_001_neg_head() { atf_set "descr" "zfs unallow returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_unallow_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_unallow_001_neg.ksh" || atf_fail "Testcase failed" } zfs_unallow_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_unmount_001_neg cleanup zfs_unmount_001_neg_head() { atf_set "descr" "zfs u[n]mount [-f] [mountpoint|fs|snap]" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_unmount_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_unmount_001_neg.ksh" || atf_fail "Testcase failed" } zfs_unmount_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_unshare_001_neg cleanup zfs_unshare_001_neg_head() { atf_set "descr" "zfs unshare returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep share zpool + atf_set "require.progs" zfs fgrep share zpool atf_set "require.user" root } zfs_unshare_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_unshare_001_neg.ksh" || atf_fail "Testcase failed" } zfs_unshare_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfs_upgrade_001_neg cleanup zfs_upgrade_001_neg_head() { atf_set "descr" "zfs upgrade returns an error when run as a user" - atf_set "require.progs" zfs mkfile fgrep zpool + atf_set "require.progs" zfs fgrep zpool atf_set "require.user" root } zfs_upgrade_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zfs_upgrade_001_neg.ksh" || atf_fail "Testcase failed" } zfs_upgrade_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_001_neg cleanup zpool_001_neg_head() { atf_set "descr" "zpool shows a usage message when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_001_neg.ksh" || atf_fail "Testcase failed" } zpool_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_001_neg cleanup zpool_add_001_neg_head() { atf_set "descr" "zpool add [-fn] pool_name vdev" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_add_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_add_001_neg.ksh" || atf_fail "Testcase failed" } zpool_add_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_002_pos cleanup zpool_add_001_neg_head() { atf_set "descr" "zpool add [-f] -n succeeds for unpriveleged users" atf_set "require.progs" zfs zpool atf_set "require.user" root } zpool_add_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_add_002_pos.ksh" || atf_fail "Testcase failed" } zpool_add_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_attach_001_neg cleanup zpool_attach_001_neg_head() { atf_set "descr" "zpool attach returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_attach_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_attach_001_neg.ksh" || atf_fail "Testcase failed" } zpool_attach_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_clear_001_neg cleanup zpool_clear_001_neg_head() { atf_set "descr" "zpool clear returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_clear_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_clear_001_neg.ksh" || atf_fail "Testcase failed" } zpool_clear_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_001_neg cleanup zpool_create_001_neg_head() { atf_set "descr" "zpool create [-f] fails for unpriveleged users" atf_set "require.progs" zfs zpool atf_set "require.user" root } zpool_create_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg # No setup is required for this test. su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_create_001_neg.ksh" || atf_fail "Testcase failed" } zpool_create_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_create_002_pos cleanup zpool_create_002_pos_head() { atf_set "descr" "zpool create [-f] -n succeeds for unpriveleged users" atf_set "require.progs" zfs zpool atf_set "require.user" root } zpool_create_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg # No setup is required for this test. su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_create_002_pos.ksh" || atf_fail "Testcase failed" } zpool_create_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_destroy_001_neg cleanup zpool_destroy_001_neg_head() { atf_set "descr" "zpool destroy [-f] [pool_name ...]" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_destroy_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_destroy_001_neg.ksh" || atf_fail "Testcase failed" } zpool_destroy_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_detach_001_neg cleanup zpool_detach_001_neg_head() { atf_set "descr" "zpool detach returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_detach_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_detach_001_neg.ksh" || atf_fail "Testcase failed" } zpool_detach_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_export_001_neg cleanup zpool_export_001_neg_head() { atf_set "descr" "zpool export returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_export_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_export_001_neg.ksh" || atf_fail "Testcase failed" } zpool_export_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_get_001_neg cleanup zpool_get_001_neg_head() { atf_set "descr" "zpool get works when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_get_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_get_001_neg.ksh" || atf_fail "Testcase failed" } zpool_get_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_history_001_neg cleanup zpool_history_001_neg_head() { atf_set "descr" "zpool history returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_history_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_history_001_neg.ksh" || atf_fail "Testcase failed" } zpool_history_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_001_neg cleanup zpool_import_001_neg_head() { atf_set "descr" "zpool import returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_import_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_import_001_neg.ksh" || atf_fail "Testcase failed" } zpool_import_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_import_002_neg cleanup zpool_import_002_neg_head() { atf_set "descr" "Executing 'zpool import' by regular user fails" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_import_002_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_import_002_neg.ksh" || atf_fail "Testcase failed" } zpool_import_002_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_offline_001_neg cleanup zpool_offline_001_neg_head() { atf_set "descr" "zpool offline returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_offline_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_offline_001_neg.ksh" || atf_fail "Testcase failed" } zpool_offline_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_online_001_neg cleanup zpool_online_001_neg_head() { atf_set "descr" "zpool online returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_online_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_online_001_neg.ksh" || atf_fail "Testcase failed" } zpool_online_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_remove_001_neg cleanup zpool_remove_001_neg_head() { atf_set "descr" "zpool remove returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_remove_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_remove_001_neg.ksh" || atf_fail "Testcase failed" } zpool_remove_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_replace_001_neg cleanup zpool_replace_001_neg_head() { atf_set "descr" "zpool replace returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_replace_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_replace_001_neg.ksh" || atf_fail "Testcase failed" } zpool_replace_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_scrub_001_neg cleanup zpool_scrub_001_neg_head() { atf_set "descr" "zpool scrub returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_scrub_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_scrub_001_neg.ksh" || atf_fail "Testcase failed" } zpool_scrub_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_set_001_neg cleanup zpool_set_001_neg_head() { atf_set "descr" "zpool set returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_set_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_set_001_neg.ksh" || atf_fail "Testcase failed" } zpool_set_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_status_001_neg cleanup zpool_status_001_neg_head() { atf_set "descr" "zpool status works when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_status_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_status_001_neg.ksh" || atf_fail "Testcase failed" } zpool_status_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_upgrade_001_neg cleanup zpool_upgrade_001_neg_head() { atf_set "descr" "zpool upgrade returns an error when run as a user" - atf_set "require.progs" zfs zpool fgrep mkfile + atf_set "require.progs" zfs zpool fgrep atf_set "require.user" root } zpool_upgrade_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" su -m `atf_config_get unprivileged_user` -c "ksh93 $(atf_get_srcdir)/zpool_upgrade_001_neg.ksh" || atf_fail "Testcase failed" } zpool_upgrade_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/misc.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zdb_001_neg atf_add_test_case zfs_001_neg atf_add_test_case zfs_allow_001_neg atf_add_test_case zfs_clone_001_neg atf_add_test_case zfs_create_001_neg atf_add_test_case zfs_destroy_001_neg atf_add_test_case zfs_get_001_neg atf_add_test_case zfs_inherit_001_neg atf_add_test_case zfs_mount_001_neg atf_add_test_case zfs_promote_001_neg atf_add_test_case zfs_receive_001_neg atf_add_test_case zfs_rename_001_neg atf_add_test_case zfs_rollback_001_neg atf_add_test_case zfs_send_001_neg atf_add_test_case zfs_set_001_neg atf_add_test_case zfs_share_001_neg atf_add_test_case zfs_snapshot_001_neg atf_add_test_case zfs_unallow_001_neg atf_add_test_case zfs_unmount_001_neg atf_add_test_case zfs_unshare_001_neg atf_add_test_case zfs_upgrade_001_neg atf_add_test_case zpool_001_neg atf_add_test_case zpool_add_001_neg atf_add_test_case zpool_add_002_pos atf_add_test_case zpool_attach_001_neg atf_add_test_case zpool_clear_001_neg atf_add_test_case zpool_create_001_neg atf_add_test_case zpool_create_002_pos atf_add_test_case zpool_destroy_001_neg atf_add_test_case zpool_detach_001_neg atf_add_test_case zpool_export_001_neg atf_add_test_case zpool_get_001_neg atf_add_test_case zpool_history_001_neg atf_add_test_case zpool_import_001_neg atf_add_test_case zpool_import_002_neg atf_add_test_case zpool_offline_001_neg atf_add_test_case zpool_online_001_neg atf_add_test_case zpool_remove_001_neg atf_add_test_case zpool_replace_001_neg atf_add_test_case zpool_scrub_001_neg atf_add_test_case zpool_set_001_neg atf_add_test_case zpool_status_001_neg atf_add_test_case zpool_upgrade_001_neg } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/compression/compression_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/compression/compression_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/compression/compression_test.sh (revision 322822) @@ -1,111 +1,111 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case compress_001_pos cleanup compress_001_pos_head() { atf_set "descr" "Ensure that compressed files are smaller." atf_set "require.progs" zfs } compress_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/compress.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/compress_001_pos.ksh || atf_fail "Testcase failed" } compress_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/compress.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case compress_003_pos cleanup compress_003_pos_head() { atf_set "descr" "Changing blocksize doesn't casue system panic with compression settings" - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } compress_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/compress.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/compress_003_pos.ksh || atf_fail "Testcase failed" } compress_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/compress.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case compress_004_pos cleanup compress_004_pos_head() { atf_set "descr" "Creating non-power-of-2 blocksize file and freeing the filestorage space at will should work normally with compression setting" atf_set "require.progs" zfs } compress_004_pos_body() { if [[ $(uname) = "FreeBSD" ]]; then atf_skip "FreeBSD does not implement F_FREESP in fcntl()" fi export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/compress.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/compress_004_pos.ksh || atf_fail "Testcase failed" } compress_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/compress.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case compress_001_pos atf_add_test_case compress_003_pos atf_add_test_case compress_004_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/history/history_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/history/history_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/history/history_test.sh (revision 322822) @@ -1,309 +1,309 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case history_001_pos history_001_pos_head() { atf_set "descr" "Verify zpool sub-commands which modify state are logged." - atf_set "require.progs" mkfile zpool nawk + atf_set "require.progs" zpool nawk atf_set "timeout" 1800 } history_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/history_001_pos.ksh || atf_fail "Testcase failed" } atf_test_case history_002_pos cleanup history_002_pos_head() { atf_set "descr" "Verify zfs sub-commands which modify state are logged." atf_set "require.progs" zfs zpool atf_set "timeout" 1800 } history_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/history_002_pos.ksh || atf_fail "Testcase failed" } history_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case history_003_pos cleanup history_003_pos_head() { atf_set "descr" "zpool history limitation test." atf_set "require.progs" zpool zfs atf_set "timeout" 1800 } history_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/history_003_pos.ksh || atf_fail "Testcase failed" } history_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case history_004_pos cleanup history_004_pos_head() { atf_set "descr" "'zpool history' can copes with many simultaneous command." atf_set "require.progs" zfs zpool atf_set "timeout" 1800 } history_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/history_004_pos.ksh || atf_fail "Testcase failed" } history_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case history_005_neg cleanup history_005_neg_head() { atf_set "descr" "Verify 'zpool list|status|iostat' will not be logged." atf_set "require.progs" zpool atf_set "timeout" 1800 } history_005_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/history_005_neg.ksh || atf_fail "Testcase failed" } history_005_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case history_006_neg cleanup history_006_neg_head() { atf_set "descr" "Verify 'zfs list|get|mount|unmount|share|unshare|send' will notbe logged." atf_set "require.progs" zfs zpool atf_set "timeout" 1800 } history_006_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/history_006_neg.ksh || atf_fail "Testcase failed" } history_006_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case history_007_pos cleanup history_007_pos_head() { atf_set "descr" "Verify command history moves with pool while migrating." atf_set "require.progs" zpool atf_set "timeout" 1800 } history_007_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/history_007_pos.ksh || atf_fail "Testcase failed" } history_007_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case history_008_pos cleanup history_008_pos_head() { atf_set "descr" "Internal journal records all the recursively operations." atf_set "require.progs" zfs zpool atf_set "timeout" 1800 } history_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/history_008_pos.ksh || atf_fail "Testcase failed" } history_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case history_009_pos cleanup history_009_pos_head() { atf_set "descr" "Verify the delegation internal history are correctly." atf_set "require.progs" zfs zpool atf_set "timeout" 1800 } history_009_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/history_009_pos.ksh || atf_fail "Testcase failed" } history_009_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case history_010_pos cleanup history_010_pos_head() { atf_set "descr" "Verify internal long history information are correct." atf_set "require.progs" zfs zpool atf_set "timeout" 1800 } history_010_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/history_010_pos.ksh || atf_fail "Testcase failed" } history_010_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/history_common.kshlib . $(atf_get_srcdir)/history.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case history_001_pos atf_add_test_case history_002_pos atf_add_test_case history_003_pos atf_add_test_case history_004_pos atf_add_test_case history_005_neg atf_add_test_case history_006_neg atf_add_test_case history_007_pos atf_add_test_case history_008_pos atf_add_test_case history_009_pos atf_add_test_case history_010_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/hotplug_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/hotplug_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/hotplug_test.sh (revision 322822) @@ -1,349 +1,349 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case hotplug_001_pos cleanup hotplug_001_pos_head() { atf_set "descr" "When removing a device from a redundant pool, the device'sstate will be indicated as 'REMOVED'. No FMA faulty message." - atf_set "require.progs" mkfile zpool lofiadm + atf_set "require.progs" zpool lofiadm atf_set "timeout" 1800 } hotplug_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotplug_001_pos.ksh || atf_fail "Testcase failed" } hotplug_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotplug_002_pos cleanup hotplug_002_pos_head() { atf_set "descr" "When removing and reinserting a device, the device status isONLINE with no FMA errors." - atf_set "require.progs" mkfile zpool lofiadm + atf_set "require.progs" zpool lofiadm atf_set "timeout" 1800 } hotplug_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotplug_002_pos.ksh || atf_fail "Testcase failed" } hotplug_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotplug_003_pos cleanup hotplug_003_pos_head() { atf_set "descr" "Having removed a device from a redundant pool and inserted a newdevice, the new device state will be 'ONLINE' when autoreplace is on,\and 'UNAVAIL' when autoreplace is off" - atf_set "require.progs" mkfile zpool lofiadm + atf_set "require.progs" zpool lofiadm atf_set "timeout" 1800 } hotplug_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotplug_003_pos.ksh || atf_fail "Testcase failed" } hotplug_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotplug_004_pos cleanup hotplug_004_pos_head() { atf_set "descr" "When device replacement fails, the original device's state willbe 'UNAVAIL' and an FMA fault will be generated." - atf_set "require.progs" mkfile zpool lofiadm + atf_set "require.progs" zpool lofiadm atf_set "timeout" 1800 } hotplug_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotplug_004_pos.ksh || atf_fail "Testcase failed" } hotplug_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotplug_005_pos cleanup hotplug_005_pos_head() { atf_set "descr" "Regarding of autoreplace, when removing offline device andreinserting again. This device's status is 'ONLINE'. \No FMA fault was generated." - atf_set "require.progs" mkfile zpool lofiadm + atf_set "require.progs" zpool lofiadm atf_set "timeout" 1800 } hotplug_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotplug_005_pos.ksh || atf_fail "Testcase failed" } hotplug_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotplug_006_pos cleanup hotplug_006_pos_head() { atf_set "descr" "When unsetting/setting autoreplace, then replacing device, verifythe device's status is 'UNAVAIL/ONLINE'. No FMA fault is generated." - atf_set "require.progs" mkfile zpool lofiadm + atf_set "require.progs" zpool lofiadm atf_set "timeout" 1800 } hotplug_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotplug_006_pos.ksh || atf_fail "Testcase failed" } hotplug_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotplug_007_pos cleanup hotplug_007_pos_head() { atf_set "descr" "When autoreplace is 'on', replacing the device with a smaller one.Verify the device's status is 'UNAVAIL'. FMA fault has been generated." - atf_set "require.progs" mkfile zpool lofiadm + atf_set "require.progs" zpool lofiadm atf_set "timeout" 1800 } hotplug_007_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotplug_007_pos.ksh || atf_fail "Testcase failed" } hotplug_007_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotplug_008_pos cleanup hotplug_008_pos_head() { atf_set "descr" "When removing hotspare device, verify device status is 'REMOVED'." - atf_set "require.progs" mkfile zpool lofiadm + atf_set "require.progs" zpool lofiadm atf_set "timeout" 1800 } hotplug_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotplug_008_pos.ksh || atf_fail "Testcase failed" } hotplug_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotplug_009_pos cleanup hotplug_009_pos_head() { atf_set "descr" "Power off machine and replacing device, verify device status isONLINE when autoreplace is on and UNAVAIL when autoreplace is off" - atf_set "require.progs" mkfile zpool lofiadm svcadm svcs + atf_set "require.progs" zpool lofiadm svcadm svcs atf_set "timeout" 1800 } hotplug_009_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotplug_009_pos.ksh || atf_fail "Testcase failed" } hotplug_009_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotplug_010_pos cleanup hotplug_010_pos_head() { atf_set "descr" "Removing device offlined and reinserting onlined,verify the device status ONLINE." - atf_set "require.progs" mkfile zpool lofiadm svcadm svcs + atf_set "require.progs" zpool lofiadm svcadm svcs atf_set "timeout" 1800 } hotplug_010_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotplug_010_pos.ksh || atf_fail "Testcase failed" } hotplug_010_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotplug_011_pos cleanup hotplug_011_pos_head() { atf_set "descr" "Removing device offlined, verify device status is UNAVAIL,when the system is onlined." - atf_set "require.progs" mkfile zpool lofiadm svcadm svcs + atf_set "require.progs" zpool lofiadm svcadm svcs atf_set "timeout" 1800 } hotplug_011_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotplug_011_pos.ksh || atf_fail "Testcase failed" } hotplug_011_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotplug.kshlib . $(atf_get_srcdir)/hotplug.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case hotplug_001_pos atf_add_test_case hotplug_002_pos atf_add_test_case hotplug_003_pos atf_add_test_case hotplug_004_pos atf_add_test_case hotplug_005_pos atf_add_test_case hotplug_006_pos atf_add_test_case hotplug_007_pos atf_add_test_case hotplug_008_pos atf_add_test_case hotplug_009_pos atf_add_test_case hotplug_010_pos atf_add_test_case hotplug_011_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh (revision 322822) @@ -1,51 +1,51 @@ #!/usr/local/bin/ksh93 -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 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)setup.ksh 1.3 08/11/03 SMI" # . $STF_SUITE/tests/hotplug/hotplug.kshlib if ! $LOFIADM -f > /dev/null 2>&1; then log_unsupported fi verify_runnable "global" if [[ -d $VDEV_DIR ]]; then log_must $RM -rf $VDEV_DIR fi log_must $MKDIR -p $VDEV_DIR -log_must $MKFILE 100M $DEV_FILES $SPARE_FILES $NEWFILE +log_must $TRUNCATE -s 100M $DEV_FILES $SPARE_FILES $NEWFILE log_must create_lofi_device $DEV_FILES $SPARE_FILES # # record repair to resource(s) to cleanup fma faulty # log_must repair_faulty log_pass Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh (revision 322822) @@ -1,846 +1,846 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case hotspare_add_001_pos cleanup hotspare_add_001_pos_head() { atf_set "descr" "'zpool add spare ...' can add devices to the pool." atf_set "timeout" 3600 } hotspare_add_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_add_001_pos.ksh || atf_fail "Testcase failed" } hotspare_add_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_add_002_pos cleanup hotspare_add_002_pos_head() { atf_set "descr" "'zpool add spare ...' can add devices to the pool while it has spare-in device." atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_add_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_add_002_pos.ksh || atf_fail "Testcase failed" } hotspare_add_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_add_003_neg cleanup hotspare_add_003_neg_head() { atf_set "descr" "'zpool add [-f]' with hot spares should fail with inapplicable scenarios." atf_set "require.config" disks_are_physical atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_add_003_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_add_003_neg.ksh || atf_fail "Testcase failed" } hotspare_add_003_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_add_004_neg cleanup hotspare_add_004_neg_head() { atf_set "descr" "'zpool add [-f]' will not allow a swap device to be used as a hotspare'" atf_set "require.config" disks_are_physical atf_set "require.progs" zpool swapon swapoff swapctl } hotspare_add_004_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_add_004_neg.ksh || atf_fail "Testcase failed" } hotspare_add_004_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_clone_001_pos cleanup hotspare_clone_001_pos_head() { atf_set "descr" "'zpool detach ...' against hotspare should do no harm to clone." atf_set "require.progs" zfs zpool sum atf_set "timeout" 3600 } hotspare_clone_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_clone_001_pos.ksh || atf_fail "Testcase failed" } hotspare_clone_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_clone_002_pos cleanup hotspare_clone_002_pos_head() { atf_set "descr" "'zpool detach ...' against basic vdev should do no harm to clone." atf_set "require.progs" zfs zpool sum atf_set "timeout" 3600 } hotspare_clone_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_clone_002_pos.ksh || atf_fail "Testcase failed" } hotspare_clone_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_create_001_neg cleanup hotspare_create_001_neg_head() { atf_set "descr" "'zpool create [-f]' with hot spares should be failedwith inapplicable scenarios." atf_set "require.config" disks_are_physical atf_set "require.progs" dumpadm zpool atf_set "timeout" 3600 } hotspare_create_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_create_001_neg.ksh || atf_fail "Testcase failed" } hotspare_create_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_detach_001_pos cleanup hotspare_detach_001_pos_head() { atf_set "descr" "'zpool detach ...' should deactivate the spared-in hot spare device successfully." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_detach_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_detach_001_pos.ksh || atf_fail "Testcase failed" } hotspare_detach_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_detach_002_pos cleanup hotspare_detach_002_pos_head() { atf_set "descr" "'zpool detach ...' against a functioning device that have spared should take the hot spare permanently swapping in successfully." atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_detach_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_detach_002_pos.ksh || atf_fail "Testcase failed" } hotspare_detach_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_detach_003_pos cleanup hotspare_detach_003_pos_head() { atf_set "descr" "'zpool replace ' against a functioning device that have spared should complete and the hot spare should return to available." atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_detach_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_detach_003_pos.ksh || atf_fail "Testcase failed" } hotspare_detach_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_detach_004_pos cleanup hotspare_detach_004_pos_head() { atf_set "descr" "'zpool replace ' against a hot spare device that have been activated should successful while the another dev is a available hot spare." atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_detach_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_detach_004_pos.ksh || atf_fail "Testcase failed" } hotspare_detach_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_detach_005_neg cleanup hotspare_detach_005_neg_head() { atf_set "descr" "'zpool detach ' against a hot spare device that NOT activated should fail and issue an error message." atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_detach_005_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_detach_005_neg.ksh || atf_fail "Testcase failed" } hotspare_detach_005_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_export_001_neg cleanup hotspare_export_001_neg_head() { atf_set "descr" "export pool that using shared hotspares will fail" atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_export_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_export_001_neg.ksh || atf_fail "Testcase failed" } hotspare_export_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_import_001_pos cleanup hotspare_import_001_pos_head() { atf_set "descr" "'zpool export/import ' should runs successfully regardless the hotspare is only in list, activated, or offline." atf_set "require.progs" zpool sum atf_set "timeout" 3600 } hotspare_import_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_import_001_pos.ksh || atf_fail "Testcase failed" } hotspare_import_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_onoffline_003_neg cleanup hotspare_onoffline_003_neg_head() { atf_set "descr" "'zpool offline/online ' against a hot spare works as expect." atf_set "require.progs" zpool zdb atf_set "timeout" 3600 } hotspare_onoffline_003_neg_body() { atf_expect_fail "This testcase has always failed on FreeBSD" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_onoffline_003_neg.ksh || atf_fail "Testcase failed" } hotspare_onoffline_003_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_onoffline_004_neg cleanup hotspare_onoffline_004_neg_head() { atf_set "descr" "'zpool offline/online ' against a spared basic vdev during I/O completes." atf_set "require.progs" zfs zpool zdb atf_set "timeout" 3600 } hotspare_onoffline_004_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_onoffline_004_neg.ksh || atf_fail "Testcase failed" } hotspare_onoffline_004_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_remove_001_pos cleanup hotspare_remove_001_pos_head() { atf_set "descr" "'zpool remove ...' can remove spare device from the pool." atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_remove_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_remove_001_pos.ksh || atf_fail "Testcase failed" } hotspare_remove_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_remove_002_neg cleanup hotspare_remove_002_neg_head() { atf_set "descr" "'zpool remove ...' should fail with inapplicable scenarios." atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_remove_002_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_remove_002_neg.ksh || atf_fail "Testcase failed" } hotspare_remove_002_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_remove_003_neg cleanup hotspare_remove_003_neg_head() { atf_set "descr" "Executing 'zpool remove' with bad options fails" atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_remove_003_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_remove_003_neg.ksh || atf_fail "Testcase failed" } hotspare_remove_003_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_remove_004_pos cleanup hotspare_remove_004_pos_head() { atf_set "descr" "'zpool remove ...' can remove spare device from the pool." atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_remove_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_remove_004_pos.ksh || atf_fail "Testcase failed" } hotspare_remove_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_replace_001_neg cleanup hotspare_replace_001_neg_head() { atf_set "descr" "'zpool replace ' should fail with inapplicable scenarios." atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_replace_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_replace_001_neg.ksh || atf_fail "Testcase failed" } hotspare_replace_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_replace_002_neg cleanup hotspare_replace_002_neg_head() { atf_set "descr" "'zpool replace ' should fail while the hot spares smaller than the basic vdev." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_replace_002_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_replace_002_neg.ksh || atf_fail "Testcase failed" } hotspare_replace_002_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_replace_003_neg cleanup hotspare_replace_003_neg_head() { atf_set "descr" "'zpool replace' of disabled hotspares should result in ignoring them after destroy." atf_set "require.progs" camcontrol zpool atf_set "require.config" at_least_5_disks atf_set "timeout" 3600 } hotspare_replace_003_neg_body() { atf_expect_fail "Rally: DE189: ZFS config management needs improvement" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_replace_003_neg.ksh || atf_fail "Testcase failed" } hotspare_replace_003_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_scrub_001_pos cleanup hotspare_scrub_001_pos_head() { atf_set "descr" "'zpool scrub ' should runs successfully regardlessthe hotspare is only in list or activated." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_scrub_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_scrub_001_pos.ksh || atf_fail "Testcase failed" } hotspare_scrub_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_scrub_002_pos cleanup hotspare_scrub_002_pos_head() { atf_set "descr" "'zpool scrub' scans spare vdevs" - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool } hotspare_scrub_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_scrub_002_pos.ksh || atf_fail "Testcase failed" } hotspare_scrub_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_shared_001_pos cleanup hotspare_shared_001_pos_head() { atf_set "descr" "'zpool add spare ...' can add a disk as a shared spare to multiple pools." atf_set "require.config" at_least_5_disks atf_set "require.progs" zpool atf_set "timeout" 3600 } hotspare_shared_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_shared_001_pos.ksh || atf_fail "Testcase failed" } hotspare_shared_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_snapshot_001_pos cleanup hotspare_snapshot_001_pos_head() { atf_set "descr" "'zpool detach ...' against hotspare should do no harm to snapshot." atf_set "require.progs" zfs zpool sum atf_set "timeout" 3600 } hotspare_snapshot_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_snapshot_001_pos.ksh || atf_fail "Testcase failed" } hotspare_snapshot_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case hotspare_snapshot_002_pos cleanup hotspare_snapshot_002_pos_head() { atf_set "descr" "'zpool detach ...' against basic vdev do no harm to snapshot." atf_set "require.progs" zfs zpool sum atf_set "timeout" 3600 } hotspare_snapshot_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_snapshot_002_pos.ksh || atf_fail "Testcase failed" } hotspare_snapshot_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case hotspare_add_001_pos atf_add_test_case hotspare_add_002_pos atf_add_test_case hotspare_add_003_neg atf_add_test_case hotspare_add_004_neg atf_add_test_case hotspare_clone_001_pos atf_add_test_case hotspare_clone_002_pos atf_add_test_case hotspare_create_001_neg atf_add_test_case hotspare_detach_001_pos atf_add_test_case hotspare_detach_002_pos atf_add_test_case hotspare_detach_003_pos atf_add_test_case hotspare_detach_004_pos atf_add_test_case hotspare_detach_005_neg atf_add_test_case hotspare_export_001_neg atf_add_test_case hotspare_import_001_pos atf_add_test_case hotspare_onoffline_003_neg atf_add_test_case hotspare_onoffline_004_neg atf_add_test_case hotspare_remove_001_pos atf_add_test_case hotspare_remove_002_neg atf_add_test_case hotspare_remove_003_neg atf_add_test_case hotspare_remove_004_pos atf_add_test_case hotspare_replace_001_neg atf_add_test_case hotspare_replace_002_neg atf_add_test_case hotspare_replace_003_neg atf_add_test_case hotspare_scrub_001_pos atf_add_test_case hotspare_scrub_002_pos atf_add_test_case hotspare_shared_001_pos atf_add_test_case hotspare_snapshot_001_pos atf_add_test_case hotspare_snapshot_002_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/refquota/refquota_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/refquota/refquota_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/refquota/refquota_test.sh (revision 322822) @@ -1,186 +1,186 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case refquota_001_pos cleanup refquota_001_pos_head() { atf_set "descr" "refquota limits the amount of space a dataset can consume,but does not include space used by descendents." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } refquota_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/refquota_001_pos.ksh || atf_fail "Testcase failed" } refquota_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case refquota_002_pos cleanup refquota_002_pos_head() { atf_set "descr" "Quotas are enforced using the minimum of the two properties" - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } refquota_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/refquota_002_pos.ksh || atf_fail "Testcase failed" } refquota_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case refquota_003_pos cleanup refquota_003_pos_head() { atf_set "descr" "Sub-filesystem quotas are not enforced by property 'refquota'" - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } refquota_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/refquota_003_pos.ksh || atf_fail "Testcase failed" } refquota_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case refquota_004_pos cleanup refquota_004_pos_head() { atf_set "descr" "refquotas are not limited by snapshots." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } refquota_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/refquota_004_pos.ksh || atf_fail "Testcase failed" } refquota_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case refquota_005_pos cleanup refquota_005_pos_head() { atf_set "descr" "refquotas are not limited by sub-filesystem snapshots." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } refquota_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/refquota_005_pos.ksh || atf_fail "Testcase failed" } refquota_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case refquota_006_neg cleanup refquota_006_neg_head() { atf_set "descr" "'zfs set refquota' can handle incorrect arguments correctly." atf_set "require.progs" zfs } refquota_006_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/refquota_006_neg.ksh || atf_fail "Testcase failed" } refquota_006_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case refquota_001_pos atf_add_test_case refquota_002_pos atf_add_test_case refquota_003_pos atf_add_test_case refquota_004_pos atf_add_test_case refquota_005_pos atf_add_test_case refquota_006_neg } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/refreserv/refreserv_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/refreserv/refreserv_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/refreserv/refreserv_test.sh (revision 322822) @@ -1,162 +1,162 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case refreserv_001_pos cleanup refreserv_001_pos_head() { atf_set "descr" "Reservations are enforced using the maximum of'reserv' and 'refreserv'" - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } refreserv_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refreserv.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/refreserv_001_pos.ksh || atf_fail "Testcase failed" } refreserv_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refreserv.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case refreserv_002_pos cleanup refreserv_002_pos_head() { atf_set "descr" "Setting full size as refreservation, verify no snapshotcan be created." atf_set "require.progs" zfs } refreserv_002_pos_body() { atf_expect_fail "BUG25520 this test incorrectly assumes that the avail, reserv, and refreserv properties are exact values that apply to data but not metadata" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refreserv.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/refreserv_002_pos.ksh || atf_fail "Testcase failed" } refreserv_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refreserv.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case refreserv_003_pos cleanup refreserv_003_pos_head() { atf_set "descr" "Verify a snapshot will only be allowed if there is enoughfree space outside of this refreservation." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } refreserv_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refreserv.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/refreserv_003_pos.ksh || atf_fail "Testcase failed" } refreserv_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refreserv.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case refreserv_004_pos cleanup refreserv_004_pos_head() { atf_set "descr" "Verify refreservation is limited by available space." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } refreserv_004_pos_body() { atf_expect_fail "BUG25520 this test incorrectly assumes that the avail, reserv, and refreserv properties are exact values that apply to data but not metadata" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refreserv.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/refreserv_004_pos.ksh || atf_fail "Testcase failed" } refreserv_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refreserv.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case refreserv_005_pos cleanup refreserv_005_pos_head() { atf_set "descr" "Volume refreservation is limited by volsize" atf_set "require.progs" zfs } refreserv_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refreserv.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/refreserv_005_pos.ksh || atf_fail "Testcase failed" } refreserv_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/refreserv.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case refreserv_001_pos atf_add_test_case refreserv_002_pos atf_add_test_case refreserv_003_pos atf_add_test_case refreserv_004_pos atf_add_test_case refreserv_005_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/remote/cross_endian/cross_endian_001_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/remote/cross_endian/cross_endian_001_pos.ksh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/remote/cross_endian/cross_endian_001_pos.ksh (revision 322822) @@ -1,147 +1,147 @@ #!/usr/local/bin/ksh93 -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 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)cross_endian_001_pos.ksh 1.2 07/01/09 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/remote/cross_endian/cross_endian_common.kshlib ################################################################################ # # __stc_assertion_start # # ID: cross_endian_001_pos # # DESCRIPTION: # storage pool can be exported and imported between two any architecture # machines. # # STRATEGY: # 1. Create a bunch of block files and then create different types of # storage pool with these files, populate some data to the storage pool # 2. Exported the storage pool and rcp the block files to a remote host # 3. Imported the pool in the remote host and verify the data integrity # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2006-05-26) # # __stc_assertion_end # ################################################################################ verify_runnable "global" function cleanup { typeset file typeset pool typeset tmpfile=$TMPDIR/import.list.${TESTCASE_ID} $ZPOOL import -d $TESTDIR >$tmpfile for pool in $NORMALPOOL $MIRRORPOOL $RAIDZPOOL $RAIDZ2POOL; do $GREP $pool $tmpfile >/dev/null 2>&1 if (( $? == 0 )); then log_must $ZPOOL import -d $TESTDIR $pool $ZPOOL destroy -f $pool elif poolexists $pool; then log_must $ZPOOL destroy -f $pool fi done for file in ${poolfile[*]}; do [[ -e $file ]] && $RM -f $file done } log_assert "Verify any storage pools can be moved between any architecture \ systems." log_onexit cleanup set -A pooltype "regular" "mirror" "raidz" "raidz2" set -A poolfile "$TESTDIR/$TESTFILE1" "$TESTDIR/$TESTFILE2" \ "$TESTDIR/$TESTFILE3" "$TESTDIR/$TESTFILE4" \ "$TESTDIR/$TESTFILE5" "$TESTDIR/$TESTFILE6" \ "$TESTDIR/$TESTFILE7" "$TESTDIR/$TESTFILE8" l_arch=`uname -m` # Setup for testing in local host # create bunches of block files to create pools for file in ${poolfile[*]}; do - log_must $MKFILE $FILESZ $file + log_must $TRUNCATE -s $FILESZ $file done for type in ${pooltype[*]}; do case $type in "regular") log_must $ZPOOL create $NORMALPOOL ${poolfile[0]} ;; "mirror") log_must $ZPOOL create $MIRRORPOOL $type ${poolfile[1]} \ ${poolfile[2]} ;; "raidz") log_must $ZPOOL create $RAIDZPOOL $type ${poolfile[3]} \ ${poolfile[4]} ;; "raidz2") log_must $ZPOOL create $RAIDZ2POOL $type ${poolfile[5]}\ ${poolfile[6]} ${poolfile[7]}\ ;; esac done for pool in $NORMALPOOL $MIRRORPOOL $RAIDZPOOL $RAIDZ2POOL; do log_must $ZFS create $pool/$RTESTFS log_must $CP $STF_SUITE/bin/`$UNAME -p`/* /$pool/$RTESTFS gen_cksum_file /$pool/$RTESTFS log_must $ZPOOL export $pool done # Testing in remote hosts. prog=$(whence -p $0) progpath=${prog%/*} progdirname=${progpath##*/} # test case directory name relpath=${progpath#$STF_SUITE/} for rhost in $TESTHOSTS; do R_PKGDIR=$(get_remote_pkgpath $rhost) r_arch=`$RSH $rhost uname -m` for file in ${poolfile[*]}; do log_must $RCP -p $file $rhost:$RTEST_ROOT/$progdirname/ done rsh_status "" $rhost "$R_PKGDIR/$relpath/r_verify_import $RTEST_ROOT" (( $? != 0 )) && \ log_fail "Storage pools move failed between $l_arch and $r_arch." log_note "All types of storage pools move from $l_arch to $r_arch \ as expected." done log_pass Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/remote/cross_endian/cross_endian_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/remote/cross_endian/cross_endian_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/remote/cross_endian/cross_endian_test.sh (revision 322822) @@ -1,86 +1,86 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case cross_endian_001_pos cleanup cross_endian_001_pos_head() { atf_set "descr" "Verify any storage pools can be moved between any architecturesystems." - atf_set "require.progs" mkfile zpool rsh zfs rcp + atf_set "require.progs" zpool rsh zfs rcp } cross_endian_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/cross_endian_common.kshlib . $(atf_get_srcdir)/cross_endian.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cross_endian_001_pos.ksh || atf_fail "Testcase failed" } cross_endian_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/cross_endian_common.kshlib . $(atf_get_srcdir)/cross_endian.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case cross_endian_002_pos cleanup cross_endian_002_pos_head() { atf_set "descr" "Verify any storage pools can be moved between any architecturesystems." - atf_set "require.progs" zfs rcp rsh zpool mkfile + atf_set "require.progs" zfs rcp rsh zpool } cross_endian_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/cross_endian_common.kshlib . $(atf_get_srcdir)/cross_endian.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/cross_endian_002_pos.ksh || atf_fail "Testcase failed" } cross_endian_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/cross_endian_common.kshlib . $(atf_get_srcdir)/cross_endian.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case cross_endian_001_pos atf_add_test_case cross_endian_002_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/remote/cross_endian/setup.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/remote/cross_endian/setup.ksh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/remote/cross_endian/setup.ksh (revision 322822) @@ -1,76 +1,76 @@ #!/usr/local/bin/ksh93 -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 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)setup.ksh 1.2 07/01/09 SMI" # . ${STF_SUITE}/include/libtest.kshlib (( ${#RHOSTS} == 0 )) && log_unsupported verify_runnable "global" prog=$(whence -p $0) progpath=${prog%/*} export progpath progdirname=${progpath##*/} # testcase directory name export progdirname relpath=${progpath#$STF_SUITE/} # relative path to suite top directory for rhost in $TESTHOSTS; do rsh_status "" $rhost "$MKDIR -m 0777 $RTEST_ROOT/$progdirname" (( $? != 0 )) && \ log_fail "Create directory in remote host failed." #Transfer the parameters to remote host rcfgfile=$TMPDIR/cross_endian.cfg $ECHO "#!/usr/local/bin/ksh93 -p" >$rcfgfile for varname in TESTFILE1 TESTFILE2 TESTFILE3 \ TESTFILE4 TESTFILE5 TESTFILE6 \ TESTFILE7 TESTFILE8 NORMALPOOL \ MIRRORPOOL RAIDZPOOL RAIDZ2POOL \ RTESTPOOL RTESTFS RTESTFILE \ TESTFS TESTSNAP; do $ECHO "export $varname=\"$(eval $ECHO \$$varname)\"" >>$rcfgfile done log_must $RCP $rcfgfile $rhost:$RTEST_ROOT/$progdirname $RM -f $rcfgfile #Initially, create a storage pool for zfs send/recv testing. poolfile=$RTEST_ROOT/$progdirname/$RTESTFILE - rsh_status "" $rhost "$MKFILE $FILESZ $poolfile" + rsh_status "" $rhost "$TRUNCATE -s $FILESZ $poolfile" (( $? != 0 )) && \ log_fail "Creating $FILESZ file in $rhost failed." rsh_status "" $rhost "$ZPOOL create $RTESTPOOL $poolfile" (( $? != 0 )) && \ log_fail "Creating storage pool in $rhost failed." done DISK=${DISKS%% *} default_setup $DISK log_pass Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/rsend/rsend_009_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/rsend/rsend_009_pos.ksh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/rsend/rsend_009_pos.ksh (revision 322822) @@ -1,106 +1,106 @@ #!/usr/local/bin/ksh93 -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 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)rsend_009_pos.ksh 1.1 08/02/27 SMI" # . $STF_SUITE/tests/rsend/rsend.kshlib ################################################################################# # # __stc_assertion_start # # ID: rsend_009_pos # # DESCRIPTION: # zfs receive can handle out of space correctly. # # STRATEGY: # 1. Create two pools, one is big and another is small. # 2. Fill the big pool with data. # 3. Take snapshot and backup the whole pool. # 4. Receive this stream in small pool. # 5. Verify zfs receive can handle the out of space error correctly. # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2007-10-10) # # __stc_assertion_end # ################################################################################ verify_runnable "global" function cleanup { if datasetexists bpool ; then log_must $ZPOOL destroy -f bpool fi if datasetexists spool ; then log_must $ZPOOL destroy -f spool fi } log_assert "Verify zfs receive can handle out of space correctly." log_onexit cleanup -log_must $MKFILE 100M $TESTDIR/bfile -log_must $MKFILE 64M $TESTDIR/sfile +log_must $TRUNCATE -s 100M $TESTDIR/bfile +log_must $TRUNCATE -s 64M $TESTDIR/sfile log_must $ZPOOL create bpool $TESTDIR/bfile log_must $ZPOOL create spool $TESTDIR/sfile # # Test out of space on sub-filesystem # log_must $ZFS create bpool/fs mntpnt=$(get_prop mountpoint bpool/fs) -log_must $MKFILE 30M $mntpnt/file +log_must $TRUNCATE -s 30M $mntpnt/file log_must $ZFS snapshot bpool/fs@snap log_must eval "$ZFS send -R bpool/fs@snap > $BACKDIR/fs-R" log_mustnot eval "$ZFS receive -d -F spool < $BACKDIR/fs-R" log_must datasetnonexists spool/fs log_must ismounted spool # # Test out of space on top filesystem # mntpnt2=$(get_prop mountpoint bpool) log_must $MV $mntpnt/file $mntpnt2 log_must $ZFS destroy -rf bpool/fs log_must $ZFS snapshot bpool@snap log_must eval "$ZFS send -R bpool@snap > $BACKDIR/bpool-R" log_mustnot eval "$ZFS receive -d -F spool < $BACKDIR/bpool-R" log_must datasetnonexists spool/fs log_must ismounted spool log_pass "zfs receive can handle out of space correctly." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/rsend/rsend_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/rsend/rsend_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/rsend/rsend_test.sh (revision 322822) @@ -1,420 +1,420 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case rsend_001_pos cleanup rsend_001_pos_head() { atf_set "descr" "zfs send -R send replication stream up to the named snap." atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_001_pos.ksh || atf_fail "Testcase failed" } rsend_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_002_pos cleanup rsend_002_pos_head() { atf_set "descr" "zfs send -I sends all incrementals from fs@init to fs@final." atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_002_pos.ksh || atf_fail "Testcase failed" } rsend_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_003_pos cleanup rsend_003_pos_head() { atf_set "descr" "zfs send -I send all incrementals from dataset@init to clone@snap" atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_003_pos.ksh || atf_fail "Testcase failed" } rsend_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_004_pos cleanup rsend_004_pos_head() { atf_set "descr" "zfs send -R -i send incremental from fs@init to fs@final." atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_004_pos.ksh || atf_fail "Testcase failed" } rsend_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_005_pos cleanup rsend_005_pos_head() { atf_set "descr" "zfs send -R -I send all the incremental between @init with @final" atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_005_pos.ksh || atf_fail "Testcase failed" } rsend_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_006_pos cleanup rsend_006_pos_head() { atf_set "descr" "Rename snapshot name will not change the dependent order." atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_006_pos.ksh || atf_fail "Testcase failed" } rsend_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_007_pos cleanup rsend_007_pos_head() { atf_set "descr" "Rename parent filesystem name will not change the dependent order." atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_007_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_007_pos.ksh || atf_fail "Testcase failed" } rsend_007_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_008_pos cleanup rsend_008_pos_head() { atf_set "descr" "Changes made by 'zfs promote' can be properly received." atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_008_pos.ksh || atf_fail "Testcase failed" } rsend_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_009_pos cleanup rsend_009_pos_head() { atf_set "descr" "Verify zfs receive can handle out of space correctly." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool zfs + atf_set "require.progs" zpool zfs atf_set "timeout" 2700 } rsend_009_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_009_pos.ksh || atf_fail "Testcase failed" } rsend_009_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_010_pos cleanup rsend_010_pos_head() { atf_set "descr" "ZFS can handle stream with multiple identical (same GUID) snapshots" atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_010_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_010_pos.ksh || atf_fail "Testcase failed" } rsend_010_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_011_pos cleanup rsend_011_pos_head() { atf_set "descr" "Verify changes made by 'zfs inherit' can be properly received." atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_011_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_011_pos.ksh || atf_fail "Testcase failed" } rsend_011_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_012_pos cleanup rsend_012_pos_head() { atf_set "descr" "Verify zfs send -R will backup all the filesystem propertiescorrectly." atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_012_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_012_pos.ksh || atf_fail "Testcase failed" } rsend_012_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rsend_013_pos cleanup rsend_013_pos_head() { atf_set "descr" "zfs receive -dF will destroy all the dataset that not existon the sender side" atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool atf_set "timeout" 2700 } rsend_013_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rsend_013_pos.ksh || atf_fail "Testcase failed" } rsend_013_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/rsend.kshlib . $(atf_get_srcdir)/rsend.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case rsend_001_pos atf_add_test_case rsend_002_pos atf_add_test_case rsend_003_pos atf_add_test_case rsend_004_pos atf_add_test_case rsend_005_pos atf_add_test_case rsend_006_pos atf_add_test_case rsend_007_pos atf_add_test_case rsend_008_pos atf_add_test_case rsend_009_pos atf_add_test_case rsend_010_pos atf_add_test_case rsend_011_pos atf_add_test_case rsend_012_pos atf_add_test_case rsend_013_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/slog/slog_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/slog/slog_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/slog/slog_test.sh (revision 322822) @@ -1,437 +1,437 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case slog_001_pos cleanup slog_001_pos_head() { atf_set "descr" "Creating a pool with a log device succeeds." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_001_pos.ksh || atf_fail "Testcase failed" } slog_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_002_pos cleanup slog_002_pos_head() { atf_set "descr" "Adding a log device to normal pool works." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_002_pos.ksh || atf_fail "Testcase failed" } slog_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_003_pos cleanup slog_003_pos_head() { atf_set "descr" "Adding an extra log device works." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_003_pos.ksh || atf_fail "Testcase failed" } slog_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_004_pos cleanup slog_004_pos_head() { atf_set "descr" "Attaching a log device passes." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_004_pos.ksh || atf_fail "Testcase failed" } slog_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_005_pos cleanup slog_005_pos_head() { atf_set "descr" "Detaching a log device passes." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_005_pos.ksh || atf_fail "Testcase failed" } slog_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_006_pos cleanup slog_006_pos_head() { atf_set "descr" "Replacing a log device passes." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_006_pos.ksh || atf_fail "Testcase failed" } slog_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_007_pos cleanup slog_007_pos_head() { atf_set "descr" "Exporting and importing pool with log devices passes." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_007_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_007_pos.ksh || atf_fail "Testcase failed" } slog_007_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_008_neg cleanup slog_008_neg_head() { atf_set "descr" "A raidz/raidz2 log is not supported." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_008_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_008_neg.ksh || atf_fail "Testcase failed" } slog_008_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_009_neg cleanup slog_009_neg_head() { atf_set "descr" "A raidz/raidz2 log can not be added to existed pool." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_009_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_009_neg.ksh || atf_fail "Testcase failed" } slog_009_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_010_neg cleanup slog_010_neg_head() { atf_set "descr" "Slog device can not be replaced with spare device." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_010_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_010_neg.ksh || atf_fail "Testcase failed" } slog_010_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_011_neg cleanup slog_011_neg_head() { atf_set "descr" "Offline and online a log device passes." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_011_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_011_neg.ksh || atf_fail "Testcase failed" } slog_011_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_012_neg cleanup slog_012_neg_head() { atf_set "descr" "Pool can survive when one of mirror log device get corrupted." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_012_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_012_neg.ksh || atf_fail "Testcase failed" } slog_012_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_013_pos cleanup slog_013_pos_head() { atf_set "descr" "Verify slog device can be disk, file, lofi device or any devicethat presents a block interface." atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool lofiadm + atf_set "require.progs" zpool lofiadm atf_set "timeout" 1200 } slog_013_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_013_pos.ksh || atf_fail "Testcase failed" } slog_013_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case slog_014_pos cleanup slog_014_pos_head() { atf_set "descr" "log device can survive when one of the pool device get corrupted." - atf_set "require.progs" mkfile zpool + atf_set "require.progs" zpool atf_set "timeout" 1200 } slog_014_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/slog_014_pos.ksh || atf_fail "Testcase failed" } slog_014_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/slog.kshlib . $(atf_get_srcdir)/slog.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case slog_001_pos atf_add_test_case slog_002_pos atf_add_test_case slog_003_pos atf_add_test_case slog_004_pos atf_add_test_case slog_005_pos atf_add_test_case slog_006_pos atf_add_test_case slog_007_pos atf_add_test_case slog_008_neg atf_add_test_case slog_009_neg atf_add_test_case slog_010_neg atf_add_test_case slog_011_neg atf_add_test_case slog_012_neg atf_add_test_case slog_013_pos atf_add_test_case slog_014_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/snapshot/snapshot_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/snapshot/snapshot_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/snapshot/snapshot_test.sh (revision 322822) @@ -1,657 +1,657 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case clone_001_pos cleanup clone_001_pos_head() { atf_set "descr" "Verify a cloned file system is writable." atf_set "require.progs" zfs } clone_001_pos_body() { atf_expect_fail "Creating a pool on a zvol is not yet supported in FreeBSD" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/clone_001_pos.ksh || atf_fail "Testcase failed" } clone_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rollback_001_pos cleanup rollback_001_pos_head() { atf_set "descr" "Verify that a rollback to a previous snapshot succeeds." atf_set "require.progs" zfs } rollback_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rollback_001_pos.ksh || atf_fail "Testcase failed" } rollback_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rollback_002_pos cleanup rollback_002_pos_head() { atf_set "descr" "Verify rollback is with respect to latest snapshot." atf_set "require.progs" zfs } rollback_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rollback_002_pos.ksh || atf_fail "Testcase failed" } rollback_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rollback_003_pos cleanup rollback_003_pos_head() { atf_set "descr" "Verify rollback succeeds when there are nested file systems." atf_set "require.progs" zfs } rollback_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/rollback_003_pos.ksh || atf_fail "Testcase failed" } rollback_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_001_pos cleanup snapshot_001_pos_head() { atf_set "descr" "Verify a file system snapshot is identical to original." atf_set "require.progs" zfs sum } snapshot_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_001_pos.ksh || atf_fail "Testcase failed" } snapshot_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_002_pos cleanup snapshot_002_pos_head() { atf_set "descr" "Verify an archive of a file system is identical toan archive of its snapshot." atf_set "require.progs" zfs } snapshot_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_002_pos.ksh || atf_fail "Testcase failed" } snapshot_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_003_pos cleanup snapshot_003_pos_head() { atf_set "descr" "Verify many snapshots of a file system can be taken." atf_set "require.progs" zfs } snapshot_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_003_pos.ksh || atf_fail "Testcase failed" } snapshot_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_004_pos cleanup snapshot_004_pos_head() { atf_set "descr" "Verify that a snapshot of an empty file system remains empty." atf_set "require.progs" zfs } snapshot_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_004_pos.ksh || atf_fail "Testcase failed" } snapshot_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_005_pos cleanup snapshot_005_pos_head() { atf_set "descr" "Verify that a snapshot of a dataset is identical tothe original dataset." atf_set "require.progs" zfs sum } snapshot_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_005_pos.ksh || atf_fail "Testcase failed" } snapshot_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_006_pos cleanup snapshot_006_pos_head() { atf_set "descr" "Verify that an archive of a dataset is identical toan archive of the dataset's snapshot." atf_set "require.progs" zfs } snapshot_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_006_pos.ksh || atf_fail "Testcase failed" } snapshot_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_007_pos cleanup snapshot_007_pos_head() { atf_set "descr" "Verify that many snapshots can be made on a zfs dataset." atf_set "require.progs" zfs } snapshot_007_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_007_pos.ksh || atf_fail "Testcase failed" } snapshot_007_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_008_pos cleanup snapshot_008_pos_head() { atf_set "descr" "Verify that destroying snapshots returns space to the pool." atf_set "require.progs" zfs } snapshot_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_008_pos.ksh || atf_fail "Testcase failed" } snapshot_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_009_pos cleanup snapshot_009_pos_head() { atf_set "descr" "Verify snapshot -r can correctly create a snapshot tree." atf_set "require.progs" zfs } snapshot_009_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_009_pos.ksh || atf_fail "Testcase failed" } snapshot_009_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_010_pos cleanup snapshot_010_pos_head() { atf_set "descr" "Verify 'destroy -r' can correctly destroy a snapshot subtree at any point." atf_set "require.progs" zfs } snapshot_010_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_010_pos.ksh || atf_fail "Testcase failed" } snapshot_010_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_011_pos cleanup snapshot_011_pos_head() { atf_set "descr" "Verify that rollback to a snapshot created by snapshot -r succeeds." atf_set "require.progs" zfs } snapshot_011_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_011_pos.ksh || atf_fail "Testcase failed" } snapshot_011_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_012_pos cleanup snapshot_012_pos_head() { atf_set "descr" "Verify that 'snapshot -r' can work with 'zfs promote'." atf_set "require.progs" zfs } snapshot_012_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_012_pos.ksh || atf_fail "Testcase failed" } snapshot_012_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_013_pos cleanup snapshot_013_pos_head() { atf_set "descr" "Verify snapshots from 'snapshot -r' can be used for zfs send/recv" atf_set "require.progs" zfs } snapshot_013_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_013_pos.ksh || atf_fail "Testcase failed" } snapshot_013_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_014_pos cleanup snapshot_014_pos_head() { atf_set "descr" "Verify creating/destroying snapshots do things clean" - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } snapshot_014_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_014_pos.ksh || atf_fail "Testcase failed" } snapshot_014_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_015_pos cleanup snapshot_015_pos_head() { atf_set "descr" "Verify snapshot can be created via mkdir in .zfs/snapshot." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } snapshot_015_pos_body() { atf_expect_fail "Not all directory operations on the .zfs/snapshot directory are yet supported by FreeBSD" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_015_pos.ksh || atf_fail "Testcase failed" } snapshot_015_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_016_pos cleanup snapshot_016_pos_head() { atf_set "descr" "Verify renamed snapshots via mv can be destroyed." atf_set "require.progs" zfs } snapshot_016_pos_body() { atf_expect_fail "Not all directory operations on the .zfs/snapshot directory are yet supported by FreeBSD" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_016_pos.ksh || atf_fail "Testcase failed" } snapshot_016_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_017_pos cleanup snapshot_017_pos_head() { atf_set "descr" "Directory structure of snapshots reflects filesystem structure." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } snapshot_017_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_017_pos.ksh || atf_fail "Testcase failed" } snapshot_017_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_018_pos cleanup snapshot_018_pos_head() { atf_set "descr" "Snapshot directory supports ACL operations" - atf_set "require.progs" zfs mkfile getfacl getconf sha1 + atf_set "require.progs" zfs getfacl getconf sha1 } snapshot_018_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_018_pos.ksh || atf_fail "Testcase failed" } snapshot_018_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_019_pos cleanup snapshot_019_pos_head() { atf_set "descr" "Accessing snapshots and unmounting them in parallel does not panic" atf_set "require.progs" zfs atf_set "timeout" 1200 } snapshot_019_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_019_pos.ksh || atf_fail "Testcase failed" } snapshot_019_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapshot_020_pos cleanup snapshot_020_pos_head() { atf_set "descr" "Verify mounted snapshots can be renamed and destroyed" atf_set "require.progs" zfs } snapshot_020_pos_body() { atf_expect_fail "TeamTrack: P2_29644 zfs rename does not unmount snapshots in a ctldir" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapshot_020_pos.ksh || atf_fail "Testcase failed" } snapshot_020_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapshot.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case clone_001_pos atf_add_test_case rollback_001_pos atf_add_test_case rollback_002_pos atf_add_test_case rollback_003_pos atf_add_test_case snapshot_001_pos atf_add_test_case snapshot_002_pos atf_add_test_case snapshot_003_pos atf_add_test_case snapshot_004_pos atf_add_test_case snapshot_005_pos atf_add_test_case snapshot_006_pos atf_add_test_case snapshot_007_pos atf_add_test_case snapshot_008_pos atf_add_test_case snapshot_009_pos atf_add_test_case snapshot_010_pos atf_add_test_case snapshot_011_pos atf_add_test_case snapshot_012_pos atf_add_test_case snapshot_013_pos atf_add_test_case snapshot_014_pos atf_add_test_case snapshot_015_pos atf_add_test_case snapshot_016_pos atf_add_test_case snapshot_017_pos atf_add_test_case snapshot_018_pos atf_add_test_case snapshot_019_pos atf_add_test_case snapshot_020_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/snapused/snapused_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/snapused/snapused_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/snapused/snapused_test.sh (revision 322822) @@ -1,170 +1,170 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case snapused_001_pos cleanup snapused_001_pos_head() { atf_set "descr" "Verify used is correct." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } snapused_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapused.kshlib . $(atf_get_srcdir)/snapused.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapused_001_pos.ksh || atf_fail "Testcase failed" } snapused_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapused.kshlib . $(atf_get_srcdir)/snapused.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapused_002_pos cleanup snapused_002_pos_head() { atf_set "descr" "Verify usedbychildren is correct." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } snapused_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapused.kshlib . $(atf_get_srcdir)/snapused.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapused_002_pos.ksh || atf_fail "Testcase failed" } snapused_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapused.kshlib . $(atf_get_srcdir)/snapused.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapused_003_pos cleanup snapused_003_pos_head() { atf_set "descr" "Verify usedbydataset is correct." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } snapused_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapused.kshlib . $(atf_get_srcdir)/snapused.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapused_003_pos.ksh || atf_fail "Testcase failed" } snapused_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapused.kshlib . $(atf_get_srcdir)/snapused.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapused_004_pos cleanup snapused_004_pos_head() { atf_set "descr" "Verify usedbyrefreservation is correct." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } snapused_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapused.kshlib . $(atf_get_srcdir)/snapused.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapused_004_pos.ksh || atf_fail "Testcase failed" } snapused_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapused.kshlib . $(atf_get_srcdir)/snapused.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case snapused_005_pos cleanup snapused_005_pos_head() { atf_set "descr" "Verify usedbysnapshots is correct." - atf_set "require.progs" zfs mkfile + atf_set "require.progs" zfs } snapused_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapused.kshlib . $(atf_get_srcdir)/snapused.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/snapused_005_pos.ksh || atf_fail "Testcase failed" } snapused_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/snapused.kshlib . $(atf_get_srcdir)/snapused.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case snapused_001_pos atf_add_test_case snapused_002_pos atf_add_test_case snapused_003_pos atf_add_test_case snapused_004_pos atf_add_test_case snapused_005_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/groupspace_002_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/groupspace_002_pos.ksh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/groupspace_002_pos.ksh (revision 322822) @@ -1,91 +1,91 @@ #!/usr/local/bin/ksh93 -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 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)groupspace_002_pos.ksh 1.1 09/06/22 SMI" # ################################################################################ # # __stc_assertion_start # # ID: groupspace_002_pos # # DESCRIPTION: # Check the user used and groupspace size in zfs groupspace # # # STRATEGY: # 1. set zfs groupquota to a fs # 2. write some data to the fs with specified user and size # 3. use zfs groupspace to check the used size and quota size # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING STATUS: COMPLETED (2009-04-16) # # __stc_assertion_end # ############################################################################### . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/userquota/userquota_common.kshlib function cleanup { if datasetexists $snapfs; then log_must $ZFS destroy $snapfs fi log_must cleanup_quota } log_onexit cleanup log_assert "Check the zfs groupspace used and quota" log_must $ZFS set groupquota@$QGROUP=500m $QFS mkmount_writable $QFS -log_must user_run $QUSER1 $MKFILE 100m $QFILE +log_must user_run $QUSER1 $TRUNCATE -s 100m $QFILE $SYNC typeset snapfs=$QFS@snap log_must $ZFS snapshot $snapfs log_must eval "$ZFS groupspace $QFS >/dev/null 2>&1" log_must eval "$ZFS groupspace $snapfs >/dev/null 2>&1" for fs in "$QFS" "$snapfs"; do log_note "check the quota size in zfs groupspace $fs" log_must eval "$ZFS groupspace $fs | $GREP $QGROUP | $GREP 500M" log_note "check the user used size in zfs groupspace $fs" log_must eval "$ZFS groupspace $fs | $GREP $QGROUP | $GREP 100M" done log_pass "Check the zfs groupspace used and quota pass as expect" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/userquota_001_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/userquota_001_pos.ksh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/userquota_001_pos.ksh (revision 322822) @@ -1,86 +1,86 @@ #!/usr/local/bin/ksh93 -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 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)userquota_001_pos.ksh 1.1 09/06/22 SMI" # ################################################################################ # # # __stc_assertion_start # # ID: userquota_001_pos # # DESCRIPTION: # Check the basic function of the userquota and groupquota # # # STRATEGY: # 1. Set userquota and overwrite the quota size # 2. The write operation should fail with Disc quota exceeded # 3. Set groupquota and overwrite the quota size # 4. The write operation should fail with Disc quota exceeded # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING STATUS: COMPLETED (2009-04-16) # # __stc_assertion_end # # ############################################################################### . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/userquota/userquota_common.kshlib function cleanup { cleanup_quota } log_onexit cleanup log_assert "If write operation overwrite {user|group}quota size, it will fail" mkmount_writable $QFS log_note "Check the userquota@$QUSER1" log_must $ZFS set userquota@$QUSER1=$UQUOTA_SIZE $QFS -log_must user_run $QUSER1 $MKFILE $UQUOTA_SIZE $QFILE +log_must user_run $QUSER1 $TRUNCATE -s UQUOTA_SIZE $QFILE $SYNC -log_mustnot user_run $QUSER1 $MKFILE 1 $OFILE +log_mustnot user_run $QUSER1 $TRUNCATE -s 1 $OFILE cleanup_quota log_note "Check the groupquota@$QGROUP" log_must $ZFS set groupquota@$QGROUP=$GQUOTA_SIZE $QFS mkmount_writable $QFS -log_must user_run $QUSER1 $MKFILE $GQUOTA_SIZE $QFILE +log_must user_run $QUSER1 $TRUNCATE -s $GQUOTA_SIZE $QFILE $SYNC -log_mustnot user_run $MKFILE 1 $OFILE +log_mustnot user_run $TRUNCATE -s 1 $OFILE cleanup_quota log_pass "Write operation overwrite {user|group}quota size, it as expect" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/userquota_004_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/userquota_004_pos.ksh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/userquota_004_pos.ksh (revision 322822) @@ -1,93 +1,93 @@ #!/usr/local/bin/ksh93 -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 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)userquota_004_pos.ksh 1.1 09/06/22 SMI" # ################################################################################ # # __stc_assertion_start # # ID: userquota_004_pos # # DESCRIPTION: # Check the basic function user|group used # # # STRATEGY: # 1. Write some data to fs by normal user and check the user|group used # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING STATUS: COMPLETED (2009-04-16) # # __stc_assertion_end # ############################################################################### . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/userquota/userquota_common.kshlib function cleanup { cleanup_quota } log_onexit cleanup log_assert "Check the basic function of {user|group} used" typeset user_used=$(get_value "userused@$QUSER1" $QFS) typeset group_used=$(get_value "groupused@$QGROUP" $QFS) if [[ $user_used != 0 ]]; then log_fail "FAIL: userused should be 0" fi if [[ $group_used != 0 ]]; then log_fail "FAIL: groupused should be 0" fi mkmount_writable $QFS -log_must user_run $QUSER1 $MKFILE 100m $QFILE +log_must user_run $QUSER1 $TRUNCATE -s 100m $QFILE $SYNC user_used=$(get_value "userused@$QUSER1" $QFS) group_used=$(get_value "groupused@$QGROUP" $QFS) if [[ $user_used != "100M" ]]; then log_note "user $QUSER1 used is $user_used" log_fail "userused for user $QUSER1 expected to be 50.0M, not $user_used" fi if [[ $user_used != $group_used ]]; then log_note "user $QUSER1 used is $user_used" log_note "group $QGROUP used is $group_used" log_fail "FAIL: userused should equal to groupused" fi log_pass "Check the basic function of {user|group}used pass as expect" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/userquota_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/userquota_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/userquota/userquota_test.sh (revision 322822) @@ -1,478 +1,478 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case groupspace_001_pos cleanup groupspace_001_pos_head() { atf_set "descr" "Check the zfs groupspace with all possible parameters" - atf_set "require.progs" zfs mkfile runwattr + atf_set "require.progs" zfs runwattr } groupspace_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/groupspace_001_pos.ksh || atf_fail "Testcase failed" } groupspace_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case groupspace_002_pos cleanup groupspace_002_pos_head() { atf_set "descr" "Check the zfs groupspace used and quota" - atf_set "require.progs" zfs mkfile runwattr + atf_set "require.progs" zfs runwattr } groupspace_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/groupspace_002_pos.ksh || atf_fail "Testcase failed" } groupspace_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_001_pos cleanup userquota_001_pos_head() { atf_set "descr" "If write operation overwrite {user|group}quota size, it will fail" - atf_set "require.progs" zfs mkfile runwattr + atf_set "require.progs" zfs runwattr } userquota_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_001_pos.ksh || atf_fail "Testcase failed" } userquota_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_002_pos cleanup userquota_002_pos_head() { atf_set "descr" "the userquota and groupquota can be set during zpool,zfs creation" - atf_set "require.progs" mkfile zpool zfs + atf_set "require.progs" zpool zfs } userquota_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_002_pos.ksh || atf_fail "Testcase failed" } userquota_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_003_pos cleanup userquota_003_pos_head() { atf_set "descr" "Check the basic function of set/get userquota and groupquota on fs" atf_set "require.progs" zfs } userquota_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_003_pos.ksh || atf_fail "Testcase failed" } userquota_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_004_pos cleanup userquota_004_pos_head() { atf_set "descr" "Check the basic function of {user|group} used" - atf_set "require.progs" mkfile runwattr + atf_set "require.progs" runwattr } userquota_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_004_pos.ksh || atf_fail "Testcase failed" } userquota_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_005_neg cleanup userquota_005_neg_head() { atf_set "descr" "Check the invalid parameter of zfs set user|group quota" atf_set "require.progs" zfs } userquota_005_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_005_neg.ksh || atf_fail "Testcase failed" } userquota_005_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_006_pos cleanup userquota_006_pos_head() { atf_set "descr" "Check the invalid parameter of zfs get user|group quota" atf_set "require.progs" zfs } userquota_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_006_pos.ksh || atf_fail "Testcase failed" } userquota_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_007_pos cleanup userquota_007_pos_head() { atf_set "descr" "Check set user|group quota to larger than the quota size of a fs" - atf_set "require.progs" zfs mkfile runwattr + atf_set "require.progs" zfs runwattr } userquota_007_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_007_pos.ksh || atf_fail "Testcase failed" } userquota_007_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_008_pos cleanup userquota_008_pos_head() { atf_set "descr" "Check zfs get all will not print out user|group quota" atf_set "require.progs" zfs } userquota_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_008_pos.ksh || atf_fail "Testcase failed" } userquota_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_009_pos cleanup userquota_009_pos_head() { atf_set "descr" "Check the snapshot's user|group quota" atf_set "require.progs" zfs } userquota_009_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_009_pos.ksh || atf_fail "Testcase failed" } userquota_009_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_010_pos cleanup userquota_010_pos_head() { atf_set "descr" "overwrite any of the {user|group}quota size, it will fail" - atf_set "require.progs" zfs mkfile runwattr + atf_set "require.progs" zfs runwattr } userquota_010_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_010_pos.ksh || atf_fail "Testcase failed" } userquota_010_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_011_pos cleanup userquota_011_pos_head() { atf_set "descr" "the userquota and groupquota can't change during zfs actions" atf_set "require.progs" zfs } userquota_011_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_011_pos.ksh || atf_fail "Testcase failed" } userquota_011_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userquota_012_neg cleanup userquota_012_neg_head() { atf_set "descr" "Check set userquota and groupquota on snapshot" atf_set "require.progs" zfs } userquota_012_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userquota_012_neg.ksh || atf_fail "Testcase failed" } userquota_012_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userspace_001_pos cleanup userspace_001_pos_head() { atf_set "descr" "Check the zfs userspace with all possible parameters" - atf_set "require.progs" zfs mkfile runwattr + atf_set "require.progs" zfs runwattr } userspace_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userspace_001_pos.ksh || atf_fail "Testcase failed" } userspace_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case userspace_002_pos cleanup userspace_002_pos_head() { atf_set "descr" "Check the zfs userspace used and quota" - atf_set "require.progs" zfs mkfile runwattr + atf_set "require.progs" zfs runwattr } userspace_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/userspace_002_pos.ksh || atf_fail "Testcase failed" } userspace_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/userquota_common.kshlib . $(atf_get_srcdir)/userquota.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case groupspace_001_pos atf_add_test_case groupspace_002_pos atf_add_test_case userquota_001_pos atf_add_test_case userquota_002_pos atf_add_test_case userquota_003_pos atf_add_test_case userquota_004_pos atf_add_test_case userquota_005_neg atf_add_test_case userquota_006_pos atf_add_test_case userquota_007_pos atf_add_test_case userquota_008_pos atf_add_test_case userquota_009_pos atf_add_test_case userquota_010_pos atf_add_test_case userquota_011_pos atf_add_test_case userquota_012_neg atf_add_test_case userspace_001_pos atf_add_test_case userspace_002_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/xattr/xattr_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/xattr/xattr_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/xattr/xattr_test.sh (revision 322822) @@ -1,394 +1,394 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case xattr_001_pos cleanup xattr_001_pos_head() { atf_set "descr" "Create/read/write/append of xattrs works" atf_set "require.progs" svcadm svcs } xattr_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_001_pos.ksh || atf_fail "Testcase failed" } xattr_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_002_neg cleanup xattr_002_neg_head() { atf_set "descr" "A read of a non-existent xattr fails" atf_set "require.progs" svcadm svcs } xattr_002_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_002_neg.ksh || atf_fail "Testcase failed" } xattr_002_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_003_neg cleanup xattr_003_neg_head() { atf_set "descr" "read/write xattr on a file with no permissions fails" atf_set "require.progs" svcs svcadm runat runwattr } xattr_003_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_003_neg.ksh || atf_fail "Testcase failed" } xattr_003_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_004_pos cleanup xattr_004_pos_head() { atf_set "descr" "Files from ufs,tmpfs with xattrs copied to zfs retain xattr info." atf_set "require.progs" zfs svcadm runat svcs } xattr_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_004_pos.ksh || atf_fail "Testcase failed" } xattr_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_005_pos cleanup xattr_005_pos_head() { atf_set "descr" "read/write/create/delete xattr on a clone filesystem" atf_set "require.progs" zfs svcadm svcs } xattr_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_005_pos.ksh || atf_fail "Testcase failed" } xattr_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_006_pos cleanup xattr_006_pos_head() { atf_set "descr" "read xattr on a snapshot" atf_set "require.progs" zfs svcadm svcs } xattr_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_006_pos.ksh || atf_fail "Testcase failed" } xattr_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_007_neg cleanup xattr_007_neg_head() { atf_set "descr" "create/write xattr on a snapshot fails" atf_set "require.progs" zfs svcadm runat svcs } xattr_007_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_007_neg.ksh || atf_fail "Testcase failed" } xattr_007_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_008_pos cleanup xattr_008_pos_head() { atf_set "descr" "special . and .. dirs work as expected for xattrs" atf_set "require.progs" svcadm runat svcs } xattr_008_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_008_pos.ksh || atf_fail "Testcase failed" } xattr_008_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_009_neg cleanup xattr_009_neg_head() { atf_set "descr" "links between xattr and normal file namespace fail" atf_set "require.progs" svcadm runat svcs } xattr_009_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_009_neg.ksh || atf_fail "Testcase failed" } xattr_009_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_010_neg cleanup xattr_010_neg_head() { atf_set "descr" "mkdir, mknod fail" atf_set "require.progs" svcadm runat svcs } xattr_010_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_010_neg.ksh || atf_fail "Testcase failed" } xattr_010_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_011_pos cleanup xattr_011_pos_head() { atf_set "descr" "Basic applications work with xattrs: cpio cp find mv pax tar" atf_set "require.progs" pax svcadm runat svcs } xattr_011_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_011_pos.ksh || atf_fail "Testcase failed" } xattr_011_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_012_pos cleanup xattr_012_pos_head() { atf_set "descr" "xattr file sizes count towards normal disk usage" - atf_set "require.progs" mkfile svcadm zfs runat zpool svcs + atf_set "require.progs" svcadm zfs runat zpool svcs } xattr_012_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_012_pos.ksh || atf_fail "Testcase failed" } xattr_012_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case xattr_013_pos cleanup xattr_013_pos_head() { atf_set "descr" "The noxattr mount option functions as expected" atf_set "require.progs" zfs svcadm runat svcs } xattr_013_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/xattr_013_pos.ksh || atf_fail "Testcase failed" } xattr_013_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/xattr_common.kshlib . $(atf_get_srcdir)/xattr.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case xattr_001_pos atf_add_test_case xattr_002_neg atf_add_test_case xattr_003_neg atf_add_test_case xattr_004_pos atf_add_test_case xattr_005_pos atf_add_test_case xattr_006_pos atf_add_test_case xattr_007_neg atf_add_test_case xattr_008_pos atf_add_test_case xattr_009_neg atf_add_test_case xattr_010_neg atf_add_test_case xattr_011_pos atf_add_test_case xattr_012_pos atf_add_test_case xattr_013_pos } Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh (revision 322821) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh (revision 322822) @@ -1,591 +1,591 @@ # 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 2012,2013 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zfsd_fault_001_pos cleanup zfsd_fault_001_pos_head() { atf_set "descr" "ZFS will fault a vdev that produces IO errors" atf_set "require.config" at_least_2_disks atf_set "require.progs" zfs zpool zfsd atf_set "timeout" 300 } zfsd_fault_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_fault_001_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_fault_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_degrade_001_pos cleanup zfsd_degrade_001_pos_head() { atf_set "descr" "ZFS will degrade a vdev that produces checksum errors" atf_set "require.config" at_least_2_disks - atf_set "require.progs" mkfile zpool zfsd + atf_set "require.progs" zpool zfsd atf_set "timeout" 300 } zfsd_degrade_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_degrade_001_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_degrade_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_degrade_002_pos cleanup zfsd_degrade_002_pos_head() { atf_set "descr" "ZFS will degrade a spare that produces checksum errors" atf_set "require.config" at_least_3_disks - atf_set "require.progs" mkfile zpool zfsd + atf_set "require.progs" zpool zfsd atf_set "timeout" 300 } zfsd_degrade_002_pos_body() { atf_expect_fail "BUG25761 An active spare on a raidz array will incorrectly account its checksum errors" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_degrade_002_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_degrade_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_hotspare_001_pos cleanup zfsd_hotspare_001_pos_head() { atf_set "descr" "An active, damaged spare will be replaced by an available spare" atf_set "require.progs" zpool zfsd atf_set "timeout" 3600 } zfsd_hotspare_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_hotspare_001_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_hotspare_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_hotspare_002_pos cleanup zfsd_hotspare_002_pos_head() { atf_set "descr" "If a vdev becomes degraded, the spare will be activated." atf_set "require.progs" zpool zfsd zinject atf_set "timeout" 3600 } zfsd_hotspare_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_hotspare_002_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_hotspare_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_hotspare_003_pos cleanup zfsd_hotspare_003_pos_head() { atf_set "descr" "A faulted vdev will be replaced by an available spare" atf_set "require.config" at_least_5_disks atf_set "require.progs" zpool zfsd zinject atf_set "timeout" 3600 } zfsd_hotspare_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_hotspare_003_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_hotspare_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_hotspare_004_pos cleanup zfsd_hotspare_004_pos_head() { atf_set "descr" "Removing a disk from a pool results in the spare activating" atf_set "require.config" at_least_5_disks atf_set "require.progs" zpool camcontrol zfsd atf_set "timeout" 3600 } zfsd_hotspare_004_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_hotspare_004_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_hotspare_004_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_hotspare_005_pos cleanup zfsd_hotspare_005_pos_head() { atf_set "descr" "A spare that is added to a degraded pool will be activated" atf_set "require.progs" zpool zfsd zinject atf_set "timeout" 3600 } zfsd_hotspare_005_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_hotspare_005_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_hotspare_005_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_hotspare_006_pos cleanup zfsd_hotspare_006_pos_head() { atf_set "descr" "zfsd will replace two vdevs that fail simultaneously" atf_set "require.progs" zpool zfsd zinject atf_set "timeout" 3600 } zfsd_hotspare_006_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_hotspare_006_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_hotspare_006_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_hotspare_007_pos cleanup zfsd_hotspare_007_pos_head() { atf_set "descr" "zfsd will swap failed drives at startup" atf_set "require.config" at_least_5_disks atf_set "require.progs" zpool camcontrol zfsd atf_set "timeout" 3600 } zfsd_hotspare_007_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_hotspare_007_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_hotspare_007_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_autoreplace_001_neg cleanup zfsd_autoreplace_001_neg_head() { atf_set "descr" "A pool without autoreplace set will not replace by physical path" atf_set "require.config" at_least_5_disks atf_set "require.progs" zpool camcontrol zfsd atf_set "timeout" 3600 } zfsd_autoreplace_001_neg_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_autoreplace_001_neg.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_autoreplace_001_neg_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_autoreplace_002_pos cleanup zfsd_autoreplace_002_pos_head() { atf_set "descr" "A pool with autoreplace set will replace by physical path" atf_set "require.config" at_least_5_disks atf_set "require.progs" zpool camcontrol zfsd atf_set "timeout" 3600 } zfsd_autoreplace_002_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_autoreplace_002_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_autoreplace_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_autoreplace_003_pos cleanup zfsd_autoreplace_003_pos_head() { atf_set "descr" "A pool with autoreplace set will replace by physical path even if a spare is active" atf_set "require.config" at_least_5_disks atf_set "require.progs" zpool camcontrol zfsd atf_set "timeout" 3600 } zfsd_autoreplace_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_autoreplace_003_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_autoreplace_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/hotspare_cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_replace_001_pos cleanup zfsd_replace_001_pos_head() { atf_set "descr" "ZFSD will automatically replace a SAS disk that dissapears and reappears in the same location, with the same devname" atf_set "require.config" at_least_2_disks atf_set "require.progs" zpool camcontrol zfsd zfs } zfsd_replace_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_replace_001_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_replace_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_replace_002_pos cleanup zfsd_replace_002_pos_head() { atf_set "descr" "A pool can come back online after all disks have dissapeared and reappeared" atf_set "require.config" at_least_2_disks atf_set "require.progs" zpool camcontrol zfsd zfs } zfsd_replace_002_pos_body() { atf_expect_fail "ZFS hangs when an array becomes critical" export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_replace_002_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_replace_002_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_replace_003_pos cleanup zfsd_replace_003_pos_head() { atf_set "descr" "ZFSD will correctly replace disks that dissapear and reappear with different devnames" atf_set "require.config" at_least_3_disks atf_set "require.progs" zpool camcontrol zfsd zfs } zfsd_replace_003_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_replace_003_pos.ksh if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_replace_003_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/zfsd.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zfsd_import_001_pos cleanup zfsd_import_001_pos_head() { atf_set "descr" "If a removed drive gets reinserted while the pool is exported, it will detach its spare when imported." atf_set "require.progs" zfsd zpool atf_set "timeout" 3600 } zfsd_import_001_pos_body() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfsd_import_001_pos.ksh || atf_fail "Testcase failed" if [[ $? != 0 ]]; then save_artifacts atf_fail "Testcase failed" fi } zfsd_import_001_pos_cleanup() { export TESTCASE_ID=$(echo $(atf_get ident) | cksum -o 2 | cut -f 1 -d " ") . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/../hotspare/hotspare.kshlib . $(atf_get_srcdir)/../hotspare/hotspare.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zfsd_fault_001_pos atf_add_test_case zfsd_degrade_001_pos atf_add_test_case zfsd_degrade_002_pos atf_add_test_case zfsd_hotspare_001_pos atf_add_test_case zfsd_hotspare_002_pos atf_add_test_case zfsd_hotspare_003_pos atf_add_test_case zfsd_hotspare_004_pos atf_add_test_case zfsd_hotspare_005_pos atf_add_test_case zfsd_hotspare_006_pos atf_add_test_case zfsd_hotspare_007_pos atf_add_test_case zfsd_autoreplace_001_neg atf_add_test_case zfsd_autoreplace_002_pos atf_add_test_case zfsd_autoreplace_003_pos atf_add_test_case zfsd_replace_001_pos atf_add_test_case zfsd_replace_002_pos atf_add_test_case zfsd_replace_003_pos atf_add_test_case zfsd_import_001_pos } save_artifacts() { # If ARTIFACTS_DIR is defined, save test artifacts for # post-mortem analysis if [[ -n $ARTIFACTS_DIR ]]; then TC_ARTIFACTS_DIR=${ARTIFACTS_DIR}/sys/cddl/zfs/tests/zfsd/$(atf_get ident) mkdir -p $TC_ARTIFACTS_DIR cp -a /var/log/zfsd.log* $TC_ARTIFACTS_DIR bzip2 $TC_ARTIFACTS_DIR/zfsd.log fi }