06.t revision 166065
1166065Spjd#!/bin/sh 2166065Spjd# $FreeBSD: head/tools/regression/fstest/tests/rename/06.t 166065 2007-01-17 01:42:12Z pjd $ 3166065Spjd 4166065Spjddesc="rename returns EPERM if the file pointed at by the 'from' argument has its immutable, undeletable or append-only flag set" 5166065Spjd 6166065Spjddir=`dirname $0` 7166065Spjd. ${dir}/../misc.sh 8166065Spjd 9166065Spjdrequire chflags 10166065Spjd 11166065Spjdecho "1..84" 12166065Spjd 13166065Spjdn0=`namegen` 14166065Spjdn1=`namegen` 15166065Spjd 16166065Spjdexpect 0 create ${n0} 0644 17166065Spjdfor flag in SF_IMMUTABLE UF_IMMUTABLE SF_APPEND UF_APPEND SF_NOUNLINK UF_NOUNLINK; do 18166065Spjd expect 0 chflags ${n0} ${flag} 19166065Spjd expect ${flag} stat ${n0} flags 20166065Spjd expect EPERM rename ${n0} ${n1} 21166065Spjddone 22166065Spjdexpect 0 chflags ${n0} none 23166065Spjdexpect 0 unlink ${n0} 24166065Spjd 25166065Spjdexpect 0 mkdir ${n0} 0755 26166065Spjdfor flag in SF_IMMUTABLE UF_IMMUTABLE SF_APPEND UF_APPEND SF_NOUNLINK UF_NOUNLINK; do 27166065Spjd expect 0 chflags ${n0} ${flag} 28166065Spjd expect ${flag} stat ${n0} flags 29166065Spjd expect EPERM rename ${n0} ${n1} 30166065Spjddone 31166065Spjdexpect 0 chflags ${n0} none 32166065Spjdexpect 0 rmdir ${n0} 33166065Spjd 34166065Spjdexpect 0 mkfifo ${n0} 0644 35166065Spjdfor flag in SF_IMMUTABLE UF_IMMUTABLE SF_APPEND UF_APPEND SF_NOUNLINK UF_NOUNLINK; do 36166065Spjd expect 0 chflags ${n0} ${flag} 37166065Spjd expect ${flag} stat ${n0} flags 38166065Spjd expect EPERM rename ${n0} ${n1} 39166065Spjddone 40166065Spjdexpect 0 chflags ${n0} none 41166065Spjdexpect 0 unlink ${n0} 42166065Spjd 43166065Spjdexpect 0 symlink ${n1} ${n0} 44166065Spjdfor flag in SF_IMMUTABLE UF_IMMUTABLE SF_APPEND UF_APPEND SF_NOUNLINK UF_NOUNLINK; do 45166065Spjd expect 0 lchflags ${n0} ${flag} 46166065Spjd expect ${flag} lstat ${n0} flags 47166065Spjd expect EPERM rename ${n0} ${n1} 48166065Spjddone 49166065Spjdexpect 0 lchflags ${n0} none 50166065Spjdexpect 0 unlink ${n0} 51