From owner-svn-src-projects@freebsd.org Mon Jan 29 23:59:41 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E06BDEC26BE for ; Mon, 29 Jan 2018 23:59:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91A756DAA9; Mon, 29 Jan 2018 23:59:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8829C7558; Mon, 29 Jan 2018 23:59:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0TNxeKv070169; Mon, 29 Jan 2018 23:59:40 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0TNxeTo070164; Mon, 29 Jan 2018 23:59:40 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801292359.w0TNxeTo070164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 29 Jan 2018 23:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r328573 - in projects/zfsd/head/tests/sys/cddl/zfs/tests: cli_root/zpool_replace hotplug X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/zfsd/head/tests/sys/cddl/zfs/tests: cli_root/zpool_replace hotplug X-SVN-Commit-Revision: 328573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jan 2018 23:59:41 -0000 Author: asomers Date: Mon Jan 29 23:59:39 2018 New Revision: 328573 URL: https://svnweb.freebsd.org/changeset/base/328573 Log: Rewrite hotplug_007_pos as zpool_replace_002_neg tests/sys/cddl/zfs/tests/cli_root/zpool_replace/Makefile tests/sys/cddl/zfs/tests/cli_root/zpool_replace/zpool_replace_002_neg.ksh tests/sys/cddl/zfs/tests/cli_root/zpool_replace/zpool_replace_test.sh tests/sys/cddl/zfs/tests/hotplug/Makefile tests/sys/cddl/zfs/tests/hotplug/hotplug_007_pos.ksh tests/sys/cddl/zfs/tests/hotplug/hotplug_test.sh Rewrite hotplug_007_pos.ksh as zpool_replace_002_neg.ksh. It doesn't really have anything to do with hotplugging. The new test is simpler and runs faster, too. Sponsored by: Spectra Logic Corp Added: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_replace/zpool_replace_002_neg.ksh Deleted: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/hotplug_007_pos.ksh Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_replace/Makefile projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_replace/zpool_replace_test.sh projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/Makefile projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/hotplug_test.sh Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_replace/Makefile ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_replace/Makefile Mon Jan 29 23:53:53 2018 (r328572) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_replace/Makefile Mon Jan 29 23:59:39 2018 (r328573) @@ -9,6 +9,7 @@ FILESDIR=${TESTSDIR} ATF_TESTS_KSH93+= zpool_replace_test ${PACKAGE}FILES+= zpool_replace_001_neg.ksh +${PACKAGE}FILES+= zpool_replace_002_neg.ksh ${PACKAGE}FILES+= setup.ksh ${PACKAGE}FILES+= cleanup.ksh ${PACKAGE}FILES+= zpool_replace.cfg Added: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_replace/zpool_replace_002_neg.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_replace/zpool_replace_002_neg.ksh Mon Jan 29 23:59:39 2018 (r328573) @@ -0,0 +1,38 @@ +#!/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 2017 Spectra Logic Corp. All rights reserved. +# Use is subject to license terms. +# + +. $STF_SUITE/include/libtest.kshlib + +log_assert "'zpool replace' should fail if the new device is too small" + +log_must $TRUNCATE -s 1024m bigfile +log_must $TRUNCATE -s 512m smallfile + +log_must $ZPOOL create $TESTPOOL $PWD/bigfile +log_mustnot $ZPOOL replace $TESTPOOL $PWD/bigfile $PWD/smallfile + +log_pass "'zpool replace' should fail if the new device is too small" Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_replace/zpool_replace_test.sh ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_replace/zpool_replace_test.sh Mon Jan 29 23:53:53 2018 (r328572) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_replace/zpool_replace_test.sh Mon Jan 29 23:59:39 2018 (r328573) @@ -47,9 +47,31 @@ zpool_replace_001_neg_cleanup() ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } +atf_test_case zpool_replace_002_neg cleanup +zpool_replace_002_neg_head() +{ + atf_set "descr" "'zpool replace' should fail if the new device is too small" + atf_set "require.progs" zpool +} +zpool_replace_002_neg_body() +{ + . $(atf_get_srcdir)/../../../include/default.cfg + . $(atf_get_srcdir)/zpool_replace.cfg + ksh93 $(atf_get_srcdir)/zpool_replace_002_neg.ksh || atf_fail "Testcase failed" +} +zpool_replace_002_neg_cleanup() +{ + . $(atf_get_srcdir)/../../../include/default.cfg + . $(atf_get_srcdir)/zpool_replace.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + atf_init_test_cases() { atf_add_test_case zpool_replace_001_neg + atf_add_test_case zpool_replace_002_neg } Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/Makefile ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/Makefile Mon Jan 29 23:53:53 2018 (r328572) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/Makefile Mon Jan 29 23:59:39 2018 (r328573) @@ -12,7 +12,6 @@ ${PACKAGE}FILES+= hotplug.cfg ${PACKAGE}FILES+= hotplug_006_pos.ksh ${PACKAGE}FILES+= hotplug_002_pos.ksh ${PACKAGE}FILES+= cleanup.ksh -${PACKAGE}FILES+= hotplug_007_pos.ksh ${PACKAGE}FILES+= hotplug_003_pos.ksh ${PACKAGE}FILES+= setup.ksh ${PACKAGE}FILES+= hotplug_005_pos.ksh Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/hotplug_test.sh ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/hotplug_test.sh Mon Jan 29 23:53:53 2018 (r328572) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/hotplug/hotplug_test.sh Mon Jan 29 23:59:39 2018 (r328573) @@ -185,33 +185,6 @@ hotplug_006_pos_cleanup() } -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" zpool lofiadm - atf_set "timeout" 1800 -} -hotplug_007_pos_body() -{ - . $(atf_get_srcdir)/../../include/default.cfg - . $(atf_get_srcdir)/hotplug.kshlib - . $(atf_get_srcdir)/hotplug.cfg - - atf_skip "TODO: move to cli_root/zpool_replace" - 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() -{ - . $(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() { @@ -327,7 +300,6 @@ atf_init_test_cases() 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