Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_004_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_004_pos.ksh (revision 323266) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_004_pos.ksh (nonexistent) @@ -1,72 +0,0 @@ -#!/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 "@(#)rootpool_004_pos.ksh 1.1 08/05/14 SMI" -# -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: rootpool_004_pos -# -# DESCRIPTION: -# -# rootfs's canmount property must be noauto -# -# STRATEGY: -# -# 1) check if the current system is installed as zfs rootfs or not. -# 2) get the rootfs -# 3) get the canmount value of rootfs -# 4) check to see if the upper value equal to noauto or not. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2008-01-21) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" -log_assert "rootfs's canmount property must be noauto" - -typeset rootfs=$(get_rootfs) -typeset can_mount=$(get_prop canmount $rootfs) - - -if [[ $can_mount != "noauto" ]]; then - log_note "${rootfs} canmount=$can_mount" - log_fail "rootfs's canmount is not noauto" -fi - -log_pass "rootfs's canmount is noauto." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_005_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_005_pos.ksh (revision 323266) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_005_pos.ksh (nonexistent) @@ -1,71 +0,0 @@ -#!/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 "@(#)rootpool_005_pos.ksh 1.1 08/05/14 SMI" -# -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: rootpool_005_pos -# -# DESCRIPTION: -# -# rootpool/ROOT's mountpoint property should be legacy -# -# STRATEGY: -# -# 1) check if the current system is installed as zfs rootfs or not. -# 2) get the rootpool's name -# 3) get the mountpoint value of rootpool/ROOT -# 4) check to see if the upper value equal to legacy or not. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2008-02-26) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" -log_assert "rootpool/ROOT's mountpoint must be legacy" - -typeset rootpool=$(get_rootpool) -typeset mountpoint=$(get_prop mountpoint $rootpool/ROOT) - -if [[ $mountpoint != "legacy" ]]; then - log_note "${rootpool} mountpoint=$mountpoint" - log_fail "rootpool's mountpoint property is not legacy." -fi - -log_pass "rootpool/ROOT's mountpoint is legacy." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_006_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_006_pos.ksh (revision 323266) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_006_pos.ksh (nonexistent) @@ -1,75 +0,0 @@ -#!/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 "@(#)rootpool_006_pos.ksh 1.2 08/08/15 SMI" -# -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: rootpool_006_pos -# -# DESCRIPTION: -# -# the zfs rootfs's mountpoint must be mounted and must be / -# -# STRATEGY: -# 1) check if the current system is installed as zfs root -# 2) get the rootfs -# 3) check the rootfs's mount ponit, it must be mounted and must be / -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2008-01-21) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" -log_assert "zfs rootfs's mountpoint must be mounted and must be /" - -typeset rootfs=$(get_rootfs) -typeset mountpoint=$(get_prop mountpoint $rootfs) -typeset mounted=$(get_prop mounted $rootfs) - -if [[ "$mountpoint" != "/" ]]; then - log_note "${rootfs} mountpoint=$mountpoint" - log_fail "rootpool ${rootfs}'s mountpoint is not /" -fi - -if [[ "$mounted" != "yes" ]]; then - log_note "${rootfs} mounted =$mounted" - log_fail "rootfs's mounted property is not yes" -fi - -log_pass "zfs rootfs's mountpoint must be mounted and must be /" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_003_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_003_neg.ksh (revision 323266) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_003_neg.ksh (nonexistent) @@ -1,74 +0,0 @@ -#!/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 "@(#)rootpool_003_neg.ksh 1.2 09/05/19 SMI" -# -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: rootpool_003_neg -# -# DESCRIPTION: -# -# system related filesystems can not be renamed or destroyed -# -# STRATEGY: -# -# 1) check if the current system is installed as zfs rootfs -# 2) get the rootfs -# 3) try to rename the rootfs to some newfs, which should fail. -# 4) try to destroy the rootfs, which should fail. -# 5) try to destroy the rootfs with -f which should fail -# 6) try to destroy the rootfs with -fR which should fail -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2008-01-21) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" -log_assert "system related filesytems can not be renamed or destroyed" - -typeset rootpool=$(get_rootpool) -typeset rootfs=$(get_rootfs) - -log_mustnot $ZFS rename $rootfs $rootpool/newfs -log_mustnot $ZFS rename -f $rootfs $rootpool/newfs - -log_mustnot $ZFS destroy $rootfs -log_mustnot $ZFS destroy -f $rootfs - -log_pass "system related filesystems can not be renamed or destroyed" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/Makefile =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/Makefile (revision 323266) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/Makefile (revision 323267) @@ -1,21 +1,17 @@ # $FreeBSD$ .include PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/cddl/zfs/tests/rootpool FILESDIR= ${TESTSDIR} ATF_TESTS_KSH93+= rootpool_test -${PACKAGE}FILES+= rootpool_006_pos.ksh ${PACKAGE}FILES+= cleanup.ksh -${PACKAGE}FILES+= rootpool_003_neg.ksh ${PACKAGE}FILES+= rootpool_007_neg.ksh ${PACKAGE}FILES+= rootpool_002_neg.ksh ${PACKAGE}FILES+= setup.ksh -${PACKAGE}FILES+= rootpool_005_pos.ksh ${PACKAGE}FILES+= rootpool_001_pos.ksh -${PACKAGE}FILES+= rootpool_004_pos.ksh .include Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_test.sh (revision 323266) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/rootpool/rootpool_test.sh (revision 323267) @@ -1,187 +1,95 @@ # 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 rootpool_001_pos cleanup rootpool_001_pos_head() { atf_set "descr" "rootpool's bootfs property must be equal to " atf_set "require.config" is_zfs_root } rootpool_001_pos_body() { . $(atf_get_srcdir)/../../include/default.cfg ksh93 $(atf_get_srcdir)/rootpool_001_pos.ksh || atf_fail "Testcase failed" } rootpool_001_pos_cleanup() { . $(atf_get_srcdir)/../../include/default.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case rootpool_002_neg cleanup rootpool_002_neg_head() { atf_set "descr" "zpool/zfs destory should return error" atf_set "require.config" is_zfs_root atf_set "require.progs" zfs zpool } rootpool_002_neg_body() { - atf_expect_fail "Destroying the root pool will panic FreeBSD BUG25145" - atf_fail "Prematurely fail the test so we don't cause a panic" . $(atf_get_srcdir)/../../include/default.cfg ksh93 $(atf_get_srcdir)/rootpool_002_neg.ksh || atf_fail "Testcase failed" } rootpool_002_neg_cleanup() { . $(atf_get_srcdir)/../../include/default.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } -atf_test_case rootpool_003_neg cleanup -rootpool_003_neg_head() -{ - atf_set "descr" "system related filesytems can not be renamed or destroyed" - atf_set "require.config" is_zfs_root - atf_set "require.progs" zfs -} -rootpool_003_neg_body() -{ - atf_expect_fail "Destroying the root pool will panic FreeBSD BUG25145" - atf_fail "Prematurely fail the test so we don't cause a panic" - . $(atf_get_srcdir)/../../include/default.cfg - - ksh93 $(atf_get_srcdir)/rootpool_003_neg.ksh || atf_fail "Testcase failed" -} -rootpool_003_neg_cleanup() -{ - . $(atf_get_srcdir)/../../include/default.cfg - - ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case rootpool_004_pos cleanup -rootpool_004_pos_head() -{ - atf_set "descr" "rootfs's canmount property must be noauto" - atf_set "require.config" is_zfs_root -} -rootpool_004_pos_body() -{ - atf_skip "The expected behavior of this test does not match the behavior of Illumos. Illumos and FreeBSD behave identically in this regard, so the test is probably wrong" - . $(atf_get_srcdir)/../../include/default.cfg - - ksh93 $(atf_get_srcdir)/rootpool_004_pos.ksh || atf_fail "Testcase failed" -} -rootpool_004_pos_cleanup() -{ - . $(atf_get_srcdir)/../../include/default.cfg - - ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case rootpool_005_pos cleanup -rootpool_005_pos_head() -{ - atf_set "descr" "rootpool/ROOT's mountpoint must be legacy" - atf_set "require.config" is_zfs_root -} -rootpool_005_pos_body() -{ - atf_skip "FreeBSD does not place any special requirements on /ROOT" - . $(atf_get_srcdir)/../../include/default.cfg - - ksh93 $(atf_get_srcdir)/rootpool_005_pos.ksh || atf_fail "Testcase failed" -} -rootpool_005_pos_cleanup() -{ - . $(atf_get_srcdir)/../../include/default.cfg - - ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case rootpool_006_pos cleanup -rootpool_006_pos_head() -{ - atf_set "descr" "zfs rootfs's mountpoint must be mounted and must be /" - atf_set "require.config" is_zfs_root -} -rootpool_006_pos_body() -{ - atf_skip "The expected behavior of this test does not match the behavior of Illumos. Illumos and FreeBSD behave identically in this regard, so the test is probably wrong" - . $(atf_get_srcdir)/../../include/default.cfg - - ksh93 $(atf_get_srcdir)/rootpool_006_pos.ksh || atf_fail "Testcase failed" -} -rootpool_006_pos_cleanup() -{ - . $(atf_get_srcdir)/../../include/default.cfg - - ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" -} - - atf_test_case rootpool_007_neg cleanup rootpool_007_neg_head() { atf_set "descr" "the zfs rootfs's compression property can not set to gzip and gzip[1-9]" atf_set "require.config" is_zfs_root atf_set "require.progs" zfs } rootpool_007_neg_body() { . $(atf_get_srcdir)/../../include/default.cfg ksh93 $(atf_get_srcdir)/rootpool_007_neg.ksh || atf_fail "Testcase failed" } rootpool_007_neg_cleanup() { . $(atf_get_srcdir)/../../include/default.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case rootpool_001_pos atf_add_test_case rootpool_002_neg - atf_add_test_case rootpool_003_neg - atf_add_test_case rootpool_004_pos - atf_add_test_case rootpool_005_pos - atf_add_test_case rootpool_006_pos atf_add_test_case rootpool_007_neg }