12fae26bdSAlan Somers#!/usr/local/bin/ksh93 -p
22fae26bdSAlan Somers#
32fae26bdSAlan Somers# CDDL HEADER START
42fae26bdSAlan Somers#
52fae26bdSAlan Somers# The contents of this file are subject to the terms of the
62fae26bdSAlan Somers# Common Development and Distribution License (the "License").
72fae26bdSAlan Somers# You may not use this file except in compliance with the License.
82fae26bdSAlan Somers#
92fae26bdSAlan Somers# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
102fae26bdSAlan Somers# or http://www.opensolaris.org/os/licensing.
112fae26bdSAlan Somers# See the License for the specific language governing permissions
122fae26bdSAlan Somers# and limitations under the License.
132fae26bdSAlan Somers#
142fae26bdSAlan Somers# When distributing Covered Code, include this CDDL HEADER in each
152fae26bdSAlan Somers# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
162fae26bdSAlan Somers# If applicable, add the following below this CDDL HEADER, with the
172fae26bdSAlan Somers# fields enclosed by brackets "[]" replaced with your own identifying
182fae26bdSAlan Somers# information: Portions Copyright [yyyy] [name of copyright owner]
192fae26bdSAlan Somers#
202fae26bdSAlan Somers# CDDL HEADER END
212fae26bdSAlan Somers#
222fae26bdSAlan Somers# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
232fae26bdSAlan Somers# Use is subject to license terms.
242fae26bdSAlan Somers
252fae26bdSAlan Somers. $STF_SUITE/include/libtest.kshlib
262fae26bdSAlan Somers. $STF_SUITE/tests/xattr/xattr_common.kshlib
272fae26bdSAlan Somers
282fae26bdSAlan Somers################################################################################
292fae26bdSAlan Somers#
302fae26bdSAlan Somers# __stc_assertion_start
312fae26bdSAlan Somers#
322fae26bdSAlan Somers# ID:  xattr_010_neg
332fae26bdSAlan Somers#
342fae26bdSAlan Somers# DESCRIPTION:
352fae26bdSAlan Somers# Verify that mkdir and various mknods fail inside the xattr namespace
362fae26bdSAlan Somers#
372fae26bdSAlan Somers# STRATEGY:
382fae26bdSAlan Somers#	1. Create a file and add an xattr to it (to ensure the namespace exists)
392fae26bdSAlan Somers#       2. Verify that mkdir fails inside the xattr namespace
402fae26bdSAlan Somers#	3. Verify that various mknods fails inside the xattr namespace
412fae26bdSAlan Somers#
422fae26bdSAlan Somers#
432fae26bdSAlan Somers# TESTABILITY: explicit
442fae26bdSAlan Somers#
452fae26bdSAlan Somers# TEST_AUTOMATION_LEVEL: automated
462fae26bdSAlan Somers#
472fae26bdSAlan Somers# CODING_STATUS: COMPLETED (2006-12-13)
482fae26bdSAlan Somers#
492fae26bdSAlan Somers# __stc_assertion_end
502fae26bdSAlan Somers#
512fae26bdSAlan Somers################################################################################
522fae26bdSAlan Somers
532fae26bdSAlan Somersfunction cleanup {
542fae26bdSAlan Somers
552fae26bdSAlan Somers	log_must $RM $TESTDIR/myfile.${TESTCASE_ID}
562fae26bdSAlan Somers}
572fae26bdSAlan Somers
582fae26bdSAlan Somerslog_assert "mkdir, mknod fail"
592fae26bdSAlan Somerslog_onexit cleanup
602fae26bdSAlan Somers
612fae26bdSAlan Somerstest_requires RUNAT
622fae26bdSAlan Somers
632fae26bdSAlan Somers# create a file, and an xattr on it
642fae26bdSAlan Somerslog_must $TOUCH $TESTDIR/myfile.${TESTCASE_ID}
652fae26bdSAlan Somerscreate_xattr $TESTDIR/myfile.${TESTCASE_ID} passwd /etc/passwd
662fae26bdSAlan Somers
672fae26bdSAlan Somers# Try to create directory in the xattr namespace
682fae26bdSAlan Somerslog_mustnot $RUNAT $TESTDIR/myfile.${TESTCASE_ID} $MKDIR foo
692fae26bdSAlan Somers
702fae26bdSAlan Somers# Try to create a range of different filetypes in the xattr namespace
712fae26bdSAlan Somerslog_mustnot $RUNAT $TESTDIR/myfile.${TESTCASE_ID} $MKNOD block b 888 888
722fae26bdSAlan Somers
732fae26bdSAlan Somerslog_mustnot $RUNAT $TESTDIR/myfile.${TESTCASE_ID} $MKNOD char c
742fae26bdSAlan Somers
752fae26bdSAlan Somerslog_mustnot $RUNAT $TESTDIR/myfile.${TESTCASE_ID} $MKNOD fifo p
762fae26bdSAlan Somers
772fae26bdSAlan Somerslog_pass "mkdir, mknod fail"
78