svn commit: r211179 - head/tools/regression/fstest/tests

Pawel Jakub Dawidek pjd at FreeBSD.org
Wed Aug 11 16:34:26 UTC 2010


Author: pjd
Date: Wed Aug 11 16:34:26 2010
New Revision: 211179
URL: http://svn.freebsd.org/changeset/base/211179

Log:
  Move create_file() to misc.sh, as it is going to be used in more places.

Modified:
  head/tools/regression/fstest/tests/misc.sh

Modified: head/tools/regression/fstest/tests/misc.sh
==============================================================================
--- head/tools/regression/fstest/tests/misc.sh	Wed Aug 11 16:33:17 2010	(r211178)
+++ head/tools/regression/fstest/tests/misc.sh	Wed Aug 11 16:34:26 2010	(r211179)
@@ -174,3 +174,38 @@ require()
 	fi
 	quick_exit
 }
+
+create_file() {
+	type="${1}"
+	name="${2}"
+	uid="${3}"
+	gid="${4}"
+
+	case "${type}" in
+	none)
+		return
+		;;
+	regular)
+		expect 0 create ${name} 0644
+		;;
+	dir)
+		expect 0 mkdir ${name} 0755
+		;;
+	fifo)
+		expect 0 mkfifo ${name} 0644
+		;;
+	block)
+		expect 0 mknod ${name} b 0644 1 2
+		;;
+	char)
+		expect 0 mknod ${name} c 0644 1 2
+		;;
+	socket)
+		expect 0 bind ${name}
+		;;
+	symlink)
+		expect 0 symlink test ${name}
+		;;
+	esac
+	expect 0 lchown ${name} ${uid} ${gid}
+}


More information about the svn-src-all mailing list