08.t revision 211352
1259210Sjmmv#!/bin/sh 2259210Sjmmv# $FreeBSD: head/tools/regression/pjdfstest/tests/mkdir/08.t 210984 2010-08-06 23:58:54Z pjd $ 3291604Sngie 4259210Sjmmvdesc="mkdir returns EPERM if the parent directory of the directory to be created has its immutable flag set" 5291604Sngie 6291604Sngiedir=`dirname $0` 7259210Sjmmv. ${dir}/../misc.sh 8291604Sngie 9291604Sngierequire chflags 10259210Sjmmv 11259210Sjmmvcase "${os}:${fs}" in 12259210SjmmvFreeBSD:ZFS) 13259210Sjmmv echo "1..17" 14259210Sjmmv ;; 15259210SjmmvFreeBSD:UFS) 16259210Sjmmv echo "1..30" 17259210Sjmmv ;; 18259210Sjmmv*) 19259210Sjmmv quick_exit 20259210Sjmmvesac 21259210Sjmmv 22259210Sjmmvn0=`namegen` 23259210Sjmmvn1=`namegen` 24259210Sjmmv 25259210Sjmmvexpect 0 mkdir ${n0} 0755 26259210Sjmmv 27259210Sjmmvexpect 0 mkdir ${n0}/${n1} 0755 28259210Sjmmvexpect 0 rmdir ${n0}/${n1} 29259210Sjmmv 30259210Sjmmvexpect 0 chflags ${n0} SF_IMMUTABLE 31259210Sjmmvexpect EPERM mkdir ${n0}/${n1} 0755 32259210Sjmmvexpect 0 chflags ${n0} none 33259210Sjmmvexpect 0 mkdir ${n0}/${n1} 0755 34259210Sjmmvexpect 0 rmdir ${n0}/${n1} 35259210Sjmmv 36259210Sjmmvexpect 0 chflags ${n0} SF_NOUNLINK 37259210Sjmmvexpect 0 mkdir ${n0}/${n1} 0755 38259210Sjmmvexpect 0 rmdir ${n0}/${n1} 39259210Sjmmvexpect 0 chflags ${n0} none 40259210Sjmmv 41315179Sjillesexpect 0 chflags ${n0} SF_APPEND 42315179Sjillesexpect 0 mkdir ${n0}/${n1} 0755 43315179Sjillesexpect 0 chflags ${n0} none 44316942Sjillesexpect 0 rmdir ${n0}/${n1} 45316942Sjilles 46320510Sjillescase "${os}:${fs}" in 47259210SjmmvFreeBSD:UFS) 48259210Sjmmv expect 0 chflags ${n0} UF_IMMUTABLE 49259210Sjmmv expect EPERM mkdir ${n0}/${n1} 0755 50259210Sjmmv expect 0 chflags ${n0} none 51259210Sjmmv expect 0 mkdir ${n0}/${n1} 0755 52259210Sjmmv expect 0 rmdir ${n0}/${n1} 53259210Sjmmv 54259210Sjmmv expect 0 chflags ${n0} UF_NOUNLINK 55259210Sjmmv expect 0 mkdir ${n0}/${n1} 0755 56287755Sjilles expect 0 rmdir ${n0}/${n1} 57287755Sjilles expect 0 chflags ${n0} none 58287755Sjilles 59259210Sjmmv expect 0 chflags ${n0} UF_APPEND 60259210Sjmmv expect 0 mkdir ${n0}/${n1} 0755 61259210Sjmmv expect 0 chflags ${n0} none 62259210Sjmmv expect 0 rmdir ${n0}/${n1} 63259210Sjmmv ;; 64259210Sjmmvesac 65259210Sjmmv 66259210Sjmmvexpect 0 rmdir ${n0} 67259210Sjmmv