003 File Manager
Current Path:
/usr/src/tests/sys/cddl/zfs/tests/cli_user/misc
usr
/
src
/
tests
/
sys
/
cddl
/
zfs
/
tests
/
cli_user
/
misc
/
📁
..
📄
Makefile
(2.03 KB)
📄
cleanup.ksh
(1.16 KB)
📄
misc.cfg
(1.89 KB)
📄
misc_test.sh
(31.99 KB)
📄
setup.ksh
(5.05 KB)
📄
setup_basic.ksh
(1.06 KB)
📄
zdb_001_neg.ksh
(2.5 KB)
📄
zfs_001_neg.ksh
(1.92 KB)
📄
zfs_allow_001_neg.ksh
(2.31 KB)
📄
zfs_clone_001_neg.ksh
(1.9 KB)
📄
zfs_create_001_neg.ksh
(2.03 KB)
📄
zfs_destroy_001_neg.ksh
(2.27 KB)
📄
zfs_get_001_neg.ksh
(2.03 KB)
📄
zfs_inherit_001_neg.ksh
(1.94 KB)
📄
zfs_mount_001_neg.ksh
(1.95 KB)
📄
zfs_promote_001_neg.ksh
(1.89 KB)
📄
zfs_receive_001_neg.ksh
(1.96 KB)
📄
zfs_rename_001_neg.ksh
(1.94 KB)
📄
zfs_rollback_001_neg.ksh
(2.09 KB)
📄
zfs_send_001_neg.ksh
(2.21 KB)
📄
zfs_set_001_neg.ksh
(2.23 KB)
📄
zfs_share_001_neg.ksh
(2.02 KB)
📄
zfs_snapshot_001_neg.ksh
(1.92 KB)
📄
zfs_unallow_001_neg.ksh
(2.18 KB)
📄
zfs_unmount_001_neg.ksh
(2.31 KB)
📄
zfs_unshare_001_neg.ksh
(2.08 KB)
📄
zfs_upgrade_001_neg.ksh
(2.13 KB)
📄
zpool_001_neg.ksh
(1.95 KB)
📄
zpool_add_001_neg.ksh
(1.9 KB)
📄
zpool_add_002_pos.ksh
(1.26 KB)
📄
zpool_attach_001_neg.ksh
(2.13 KB)
📄
zpool_clear_001_neg.ksh
(1.75 KB)
📄
zpool_create_001_neg.ksh
(1.98 KB)
📄
zpool_create_002_pos.ksh
(1.23 KB)
📄
zpool_destroy_001_neg.ksh
(1.96 KB)
📄
zpool_detach_001_neg.ksh
(1.91 KB)
📄
zpool_export_001_neg.ksh
(1.98 KB)
📄
zpool_get_001_neg.ksh
(2.07 KB)
📄
zpool_history_001_neg.ksh
(1.91 KB)
📄
zpool_import_001_neg.ksh
(2.08 KB)
📄
zpool_import_002_neg.ksh
(2.13 KB)
📄
zpool_offline_001_neg.ksh
(2.09 KB)
📄
zpool_online_001_neg.ksh
(2.09 KB)
📄
zpool_remove_001_neg.ksh
(1.92 KB)
📄
zpool_replace_001_neg.ksh
(2.15 KB)
📄
zpool_scrub_001_neg.ksh
(1.8 KB)
📄
zpool_set_001_neg.ksh
(2.19 KB)
📄
zpool_status_001_neg.ksh
(2.36 KB)
📄
zpool_upgrade_001_neg.ksh
(2.12 KB)
Editing: zpool_attach_001_neg.ksh
#!/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 # # $FreeBSD$ # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zpool_attach_001_neg.ksh 1.1 07/10/09 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_user/cli_user.kshlib ################################################################################ # # __stc_assertion_start # # ID: zpool_attach_001_neg # # DESCRIPTION: # # zpool attach returns an error when run as a user # # STRATEGY: # 1. Attempt to attach a disk to a pool # 2.Verify that the attach failed # # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2007-07-27) # # __stc_assertion_end # ################################################################################ function check_for_attach { RESULT=$($ZPOOL status -v $TESTPOOL.virt | $GREP disk-additional.dat) if [ -n "$RESULT" ] then log_fail "A disk was attached to the pool!" fi } verify_runnable "global" log_assert "zpool attach returns an error when run as a user" log_mustnot run_unprivileged "$ZPOOL attach $TESTPOOL.virt /$TESTDIR/disk1.dat /$TESTDIR/disk-additional.dat" check_for_attach log_mustnot run_unprivileged "$ZPOOL attach -f $TESTPOOL.virt /$TESTDIR/disk1.dat /$TESTDIR/disk-additional.dat" check_for_attach log_pass "zpool attach returns an error when run as a user"
Upload File
Create Folder