Date: Mon, 29 Jan 2018 23:59:39 +0000 (UTC) From: Alan Somers <asomers@FreeBSD.org> 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 Message-ID: <201801292359.w0TNxeTo070164@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801292359.w0TNxeTo070164>