summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-08-11 17:33:32 +0000
committerpjd <pjd@FreeBSD.org>2010-08-11 17:33:32 +0000
commit510a3e5097100261e9ba09f0fd51d625ba0f6e07 (patch)
treee99839b8a1f7b473f38e8a42726d05b386128f98 /tools
parentafd44137e854c021c1e26e7a5d261dcf706ee9dc (diff)
downloadFreeBSD-src-510a3e5097100261e9ba09f0fd51d625ba0f6e07.zip
FreeBSD-src-510a3e5097100261e9ba09f0fd51d625ba0f6e07.tar.gz
Allow to specify uid, gid and mode for create_file().
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/fstest/tests/misc.sh16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/regression/fstest/tests/misc.sh b/tools/regression/fstest/tests/misc.sh
index ac7ab7e..879c22a 100644
--- a/tools/regression/fstest/tests/misc.sh
+++ b/tools/regression/fstest/tests/misc.sh
@@ -175,11 +175,14 @@ require()
quick_exit
}
+# usage:
+# create_file <type> <name>
+# create_file <type> <name> <mode>
+# create_file <type> <name> <uid> <gid>
+# create_file <type> <name> <mode> <uid> <gid>
create_file() {
type="${1}"
name="${2}"
- uid="${3}"
- gid="${4}"
case "${type}" in
none)
@@ -207,5 +210,12 @@ create_file() {
expect 0 symlink test ${name}
;;
esac
- expect 0 lchown ${name} ${uid} ${gid}
+ if [ -n "${3}" -a -n "${4}" -a -n "${5}" ]; then
+ expect 0 lchmod ${name} ${3}
+ expect 0 lchown ${name} ${4} ${5}
+ elif [ -n "${3}" -a -n "${4}" ]; then
+ expect 0 lchown ${name} ${3} ${4}
+ elif [ -n "${3}" ]; then
+ expect 0 lchmod ${name} ${3}
+ fi
}
OpenPOWER on IntegriCloud