Index: projects/zfsd/head/etc/mtree/BSD.tests.dist =================================================================== --- projects/zfsd/head/etc/mtree/BSD.tests.dist (revision 323269) +++ projects/zfsd/head/etc/mtree/BSD.tests.dist (revision 323270) @@ -1,1018 +1,1020 @@ # $FreeBSD$ # # Please see the file src/etc/mtree/README before making changes to this file. # /set type=dir uname=root gname=wheel mode=0755 . bin cat .. chmod .. date .. dd .. echo .. expr .. ln .. ls .. mv .. pax .. pkill .. pwait .. sh builtins .. errors .. execution .. expansion .. parameters .. parser .. set-e .. .. sleep .. test .. .. cddl lib .. usr.bin .. usr.sbin dtrace common aggs .. arithmetic .. arrays .. assocs .. begin .. bitfields .. buffering .. builtinvar .. cg .. clauses .. cpc .. decls .. drops .. dtraceUtil .. end .. enum .. error .. exit .. fbtprovider .. funcs .. grammar .. include .. inline .. io .. ip .. java_api .. json .. lexer .. llquantize .. mdb .. mib .. misc .. multiaggs .. offsetof .. operators .. pid .. plockstat .. pointers .. pragma .. predicates .. preprocessor .. print .. printa .. printf .. privs .. probes .. proc .. profile-n .. providers .. raise .. rates .. safety .. scalars .. sched .. scripting .. sdt .. sizeof .. speculation .. stability .. stack .. stackdepth .. stop .. strlen .. strtoll .. struct .. sugar .. syscall .. sysevent .. tick-n .. trace .. tracemem .. translators .. typedef .. types .. uctf .. union .. usdt .. ustack .. vars .. version .. .. .. zfsd .. .. .. etc rc.d .. .. games .. gnu lib .. usr.bin diff .. .. .. lib atf libatf-c detail .. .. libatf-c++ detail .. .. test-programs .. .. libarchive .. libc c063 .. db .. gen execve .. posix_spawn .. .. hash data .. .. iconv .. inet .. locale .. net getaddrinfo data .. .. .. nss .. regex data .. .. resolv .. rpc .. ssp .. setjmp .. stdio .. stdlib .. string .. sys .. time .. tls dso .. .. termios .. ttyio .. .. libcam .. libcasper services cap_dns .. cap_grp .. cap_pwd .. cap_sysctl .. .. .. libcrypt .. libdevdctl .. libkvm .. libmp .. libnv .. libproc .. librt .. libsbuf .. libthr dlopen .. .. libutil .. libxo .. msun .. .. libexec atf atf-check .. atf-sh .. .. rtld-elf .. .. sbin dhclient .. devd .. growfs .. ifconfig .. mdconfig .. pfctl files .. .. .. secure lib .. libexec .. usr.bin .. usr.sbin .. .. share examples tests atf .. plain .. tap .. .. .. zoneinfo .. .. sys acl .. aio .. cddl zfs bin .. include .. tests acl cifs .. nontrivial .. trivial .. .. atime .. bootfs .. cache .. cachefile .. clean_mirror assertion_001 .. assertion_002 .. assertion_003 .. assertion_004 .. .. cli_root zfs_upgrade .. zfs_promote .. zfs_clone .. zfs_property .. zfs_destroy .. zpool_create .. zpool_history .. zpool_expand .. zpool_remove .. zfs_mount .. zfs_unshare .. zdb .. zpool_online .. zpool_get .. zpool_export .. zfs_copies .. zfs_get .. zfs .. zpool_clear .. zpool_import + blockfiles + .. .. zpool .. zpool_offline .. zpool_replace .. zfs_rollback .. zpool_set .. zfs_send .. zfs_set .. zpool_detach .. zfs_diff .. zpool_scrub .. zfs_inherit .. zfs_snapshot .. zfs_share .. zpool_destroy .. zpool_status .. zfs_unmount .. zfs_receive .. zfs_create .. zpool_upgrade blockfiles .. .. zpool_add .. zfs_rename .. zpool_attach .. zfs_reservation .. .. cli_user misc .. zfs_list .. zpool_iostat .. zpool_list .. .. compression .. ctime .. delegate zfs_allow .. zfs_unallow .. .. devices .. exec .. grow_pool .. grow_replicas .. history .. hotplug .. hotspare .. inheritance .. interop .. inuse .. iscsi .. large_files .. largest_pool .. link_count .. mdb .. migration .. mmap mmap_read .. mmap_write .. .. mount .. mv_files .. nestedfs .. no_space .. online_offline .. pool_names .. poolversion .. privilege .. quota .. redundancy .. refquota .. refreserv .. remote cross_endian .. rebooting .. sharing .. .. rename_dirs .. replacement .. reservation .. rootpool .. rsend .. sas_phy_thrash .. scrub_mirror .. slog .. snapshot .. snapused .. sparse .. threadsappend .. truncate .. txg_integrity .. userquota .. utils_test .. write_dirs .. xattr .. zfsd .. zil .. zinject .. zones .. zvol zvol_ENOSPC .. zvol_cli .. zvol_misc .. zvol_swap .. .. zvol_thrash .. .. .. .. dtrace .. fifo .. file .. fs tmpfs .. .. geom class concat .. eli .. gate .. gpt .. mirror .. nop .. part .. raid3 .. shsec .. stripe .. uzip etalon .. .. .. .. kern acct .. execve .. pipe .. .. kqueue libkqueue .. .. mac bsdextended .. portacl .. .. mqueue .. net .. netinet .. opencrypto .. pjdfstest chflags .. chmod .. chown .. ftruncate .. granular .. link .. mkdir .. mkfifo .. mknod .. open .. rename .. rmdir .. symlink .. truncate .. unlink .. utimensat .. .. posixshm .. sys .. vfs .. vm .. .. usr.bin apply .. basename .. bmake archives fmt_44bsd .. fmt_44bsd_mod .. fmt_oldbsd .. .. basic t0 .. t1 .. t2 .. t3 .. .. execution ellipsis .. empty .. joberr .. plus .. .. shell builtin .. meta .. path .. path_select .. replace .. select .. .. suffixes basic .. src_wild1 .. src_wild2 .. .. syntax directive-t0 .. enl .. funny-targets .. semi .. .. sysmk t0 2 1 .. .. mk .. .. t1 2 1 .. .. mk .. .. t2 2 1 .. .. mk .. .. .. variables modifier_M .. modifier_t .. opt_V .. t0 .. .. .. bsdcat .. calendar .. cmp .. compress .. cpio .. col .. comm .. csplit .. cut .. diff .. dirname .. du .. file2c .. getconf .. grep .. gzip .. hexdump .. ident .. indent .. join .. jot .. lastcomm .. limits .. m4 .. mkimg .. ncal .. opensm .. pr .. printf .. procstat .. sdiff .. sed regress.multitest.out .. .. soelim .. stat .. tail .. tar .. timeout .. tr .. truncate .. units .. uudecode .. uuencode .. uniq .. xargs .. xinstall .. xo .. yacc yacc .. .. .. usr.sbin chown .. etcupdate .. extattr .. fstyp .. makefs .. newsyslog .. nmtree .. pw .. rpcbind .. sa .. .. .. # vim: set expandtab ts=4 sw=4: Index: projects/zfsd/head/tests/sys/cddl/zfs/include/commands.txt =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/include/commands.txt (revision 323269) +++ projects/zfsd/head/tests/sys/cddl/zfs/include/commands.txt (revision 323270) @@ -1,189 +1,190 @@ # # 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 +/usr/bin/bzcat /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 /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/tests/cli_root/zpool_import/Makefile =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/Makefile (revision 323269) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/Makefile (revision 323270) @@ -1,37 +1,39 @@ # $FreeBSD$ .include PACKAGE=tests TESTSDIR=${TESTSBASE}/sys/cddl/zfs/tests/cli_root/zpool_import FILESDIR=${TESTSDIR} ATF_TESTS_KSH93+= zpool_import_test ${PACKAGE}FILES+= zpool_import_006_pos.ksh ${PACKAGE}FILES+= zpool_import_002_pos.ksh ${PACKAGE}FILES+= zpool_import_missing_003_pos.ksh ${PACKAGE}FILES+= zpool_import_all_001_pos.ksh ${PACKAGE}FILES+= zpool_import.cfg ${PACKAGE}FILES+= zpool_import_corrupt_001_pos.ksh ${PACKAGE}FILES+= zpool_import_012_pos.ksh ${PACKAGE}FILES+= zpool_import_013_neg.ksh ${PACKAGE}FILES+= zpool_import_007_pos.ksh ${PACKAGE}FILES+= zpool_import_003_pos.ksh ${PACKAGE}FILES+= zpool_import_rename_001_pos.ksh ${PACKAGE}FILES+= zpool_import_missing_002_pos.ksh ${PACKAGE}FILES+= setup.ksh ${PACKAGE}FILES+= zpool_import_010_pos.ksh ${PACKAGE}FILES+= zpool_import_014_pos.ksh ${PACKAGE}FILES+= cleanup.ksh ${PACKAGE}FILES+= zpool_import_011_neg.ksh ${PACKAGE}FILES+= zpool_import_missing_004_pos.ksh ${PACKAGE}FILES+= zpool_import_missing_005_pos.ksh ${PACKAGE}FILES+= zpool_import_005_pos.ksh ${PACKAGE}FILES+= zpool_import_009_neg.ksh ${PACKAGE}FILES+= zpool_import_missing_001_pos.ksh ${PACKAGE}FILES+= zpool_import_008_pos.ksh ${PACKAGE}FILES+= zpool_import_004_pos.ksh ${PACKAGE}FILES+= zpool_import.kshlib +SUBDIR+= blockfiles + .include Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/blockfiles/Makefile =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/blockfiles/Makefile (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/blockfiles/Makefile (revision 323270) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.include + +PACKAGE=tests +TESTSDIR=${TESTSBASE}/sys/cddl/zfs/tests/cli_root/zpool_import/blockfiles +FILESDIR=${TESTSDIR} + +${PACKAGE}FILES+= README +${PACKAGE}FILES+= unclean_export.dat.bz2 + +.include Property changes on: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/blockfiles/Makefile ___________________________________________________________________ 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/tests/cli_root/zpool_import/blockfiles/README =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/blockfiles/README (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/blockfiles/README (revision 323270) @@ -0,0 +1,29 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +Unless otherwise noted, all files in this distribution are released +under the Common Development and Distribution License (CDDL). + +This directory contains compressed blockfiles for zpool import testing. Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/blockfiles/unclean_export.dat.bz2 =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/x-bzip2 Property changes on: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/blockfiles/unclean_export.dat.bz2 ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/x-bzip2 \ No newline at end of property Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_013_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_013_neg.ksh (revision 323269) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_013_neg.ksh (revision 323270) @@ -1,110 +1,85 @@ #!/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 "@(#)zpool_import_013_neg.ksh 1.1 07/10/09 SMI" # . $STF_SUITE/include/libtest.kshlib ################################################################################# # # __stc_assertion_start # # ID: zpool_import_013_neg # # DESCRIPTION: # For pool may be in use from other system, # 'zpool import' will prompt the warning and fails. # # STRATEGY: # 1. Prepare rawfile that are created from other system. # 2. Verify 'zpool import' will fail. # 3. Verify 'zpool import -f' succeed. # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2007-07-05) # # __stc_assertion_end # ################################################################################ verify_runnable "global" -if (( ZPOOL_VERSION < 6 )); then - log_unsupported "This case need zpool version >= 6" -fi +POOL_NAME=unclean_export +POOL_FILE=unclean_export.dat -function create_old_pool +function uncompress_pool { - VERSION=$1 - POOL_FILES=$($ENV | grep "ZPOOL_VERSION_${VERSION}_FILES"\ - | $AWK -F= '{print $2}') - POOL_NAME=$($ENV|grep "ZPOOL_VERSION_${VERSION}_NAME"\ - | $AWK -F= '{print $2}') - - log_note "Creating $POOL_NAME from $POOL_FILES" - for pool_file in $POOL_FILES; do - $CP $STF_SUITE/tests/cli_root/zpool_upgrade/blockfiles/$pool_file.Z \ - /$TESTPOOL - $UNCOMPRESS /$TESTPOOL/$pool_file.Z - done + log_note "Creating pool from $POOL_FILE" + log_must $BZCAT \ + $STF_SUITE/tests/cli_root/zpool_import/blockfiles/$POOL_FILE.bz2 \ + > $TMPDIR/$POOL_FILE return 0 } function cleanup { - if [[ -z $POOL_NAME ]]; then - return 1 - fi - destroy_pool $POOL_NAME - for file in $POOL_FILES; do - if [[ -e /$TESTPOOL/$file ]]; then - $RM /$TESTPOOL/$file - fi - done + poolexists $POOL_NAME && log_must zpool destroy $POOL_NAME + [[ -e $TMPDIR/$POOL_FILE ]] && rm $TMPDIR/$POOL_FILE return 0 } -log_assert "'zpool import' fail while pool may be in use from other system," \ - "it need import forcefully." +log_assert "'zpool import' fails for pool that was not cleanly exported" log_onexit cleanup -typeset POOL_FILES -typeset POOL_NAME -# $CONFIGS gets set in the .cfg script -for config in $CONFIGS -do - create_old_pool $config - log_mustnot $ZPOOL import -d /$TESTPOOL $POOL_NAME - log_must $ZPOOL import -d /$TESTPOOL -f $POOL_NAME - destroy_upgraded_pool -done - -log_pass "'zpool import' fail while pool may be in use from other system," \ - "import forcefully succeed as expected." +uncompress_pool +log_mustnot zpool import -d $TMPDIR $POOL_NAME +log_must zpool import -d $TMPDIR -f $POOL_NAME + +log_pass "'zpool import' fails for pool that was not cleanly exported" 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 323269) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_test.sh (revision 323270) @@ -1,554 +1,543 @@ # 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.progs" zfs zpool sum zdb atf_set "timeout" 2400 } zpool_import_002_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zpool zfs atf_set "timeout" 2400 } zpool_import_003_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_004_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_005_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_006_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_007_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_008_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zfs zpool atf_set "timeout" 2400 } zpool_import_009_neg_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zpool zfs atf_set "timeout" 2400 } zpool_import_010_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_011_neg_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zfs zpool zdb share atf_set "timeout" 2400 } zpool_import_012_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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 +atf_test_case zpool_import_013_neg 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 "descr" "'zpool import' fails for pool that was not cleanly exported" 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' . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg - verify_disk_count "$DISKS" 2 - 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() -{ - . $(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.progs" zfs zpool } zpool_import_014_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 1 ksh93 $(atf_get_srcdir)/zpool_import_014_pos.ksh || atf_fail "Testcase failed" } zpool_import_014_pos_cleanup() { . $(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.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" . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zfs sum zpool zdb atf_set "timeout" 2400 } zpool_import_missing_001_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zpool zfs zdb atf_set "timeout" 2400 } zpool_import_missing_002_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zpool sum zfs atf_set "timeout" 2400 } zpool_import_missing_003_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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" zfs zpool atf_set "timeout" 300 } zpool_import_missing_004_pos_body() { . $(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" mdconfig zfs zpool atf_set "timeout" 300 } zpool_import_missing_005_pos_body() { . $(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.progs" zfs zpool sum zdb atf_set "timeout" 2400 } zpool_import_rename_001_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 2 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() { . $(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.progs" zfs zpool zdb atf_set "timeout" 2400 } zpool_import_corrupt_001_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_import.cfg verify_disk_count "$DISKS" 1 ksh93 $(atf_get_srcdir)/zpool_import_corrupt_001_pos.ksh || atf_fail "Testcase failed" } zpool_import_corrupt_001_pos_cleanup() { . $(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 }