diff options
author | Luiz Otavio O Souza <luiz@netgate.com> | 2016-03-30 12:50:25 -0500 |
---|---|---|
committer | Luiz Otavio O Souza <luiz@netgate.com> | 2016-03-30 12:50:25 -0500 |
commit | cda345b593ec84d7abbf45b2ce284a9d7f53307c (patch) | |
tree | 7ad875acd35d7cd5a18a7676761b35e5385b1b0c /contrib/pjdfstest/tests | |
parent | c35924db4e1edd83f5a845760098fc8cbd7f7456 (diff) | |
parent | f08e8e5dd415880269fb4ce4cb2fd7bccefe336d (diff) | |
download | FreeBSD-src-cda345b593ec84d7abbf45b2ce284a9d7f53307c.zip FreeBSD-src-cda345b593ec84d7abbf45b2ce284a9d7f53307c.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'contrib/pjdfstest/tests')
-rw-r--r-- | contrib/pjdfstest/tests/ftruncate/11.t | 2 | ||||
-rwxr-xr-x | contrib/pjdfstest/tests/misc.sh | 34 | ||||
-rw-r--r-- | contrib/pjdfstest/tests/open/20.t | 2 | ||||
-rw-r--r-- | contrib/pjdfstest/tests/truncate/11.t | 2 |
4 files changed, 40 insertions, 0 deletions
diff --git a/contrib/pjdfstest/tests/ftruncate/11.t b/contrib/pjdfstest/tests/ftruncate/11.t index b00d7b8..8d9f0d5 100644 --- a/contrib/pjdfstest/tests/ftruncate/11.t +++ b/contrib/pjdfstest/tests/ftruncate/11.t @@ -8,6 +8,8 @@ dir=`dirname $0` [ "${os}" = "FreeBSD" ] || quick_exit +requires_exec + echo "1..2" n0=`namegen` diff --git a/contrib/pjdfstest/tests/misc.sh b/contrib/pjdfstest/tests/misc.sh index 8978b5f..654d3dd 100755 --- a/contrib/pjdfstest/tests/misc.sh +++ b/contrib/pjdfstest/tests/misc.sh @@ -219,3 +219,37 @@ create_file() { expect 0 lchmod ${name} ${3} fi } + +# Tests for whether or not a filesystem is mounted with a particular option +# with -o, e.g. `mount -o noexec`. +# +# Parameters: +# - mount_option - noatime, noexec, etc. +# +# Returns: +# - 0 if mounted with the option. +# - 1 otherwise. +has_mount_option() +{ + local IFS=, + local mount_opt + + local mount_option_search=$1 + + # XXX: mountpoint is defined in .../tests/sys/pjdfstest/tests/conf + for mount_opt in $(mount -d -p | awk '$2 == "'$mountpoint'" { print $4 }'); do + if [ "$mount_opt" = "$mount_option_search" ]; then + return 0 + fi + done + return 1 +} + +# Filesystem must be mounted with -o exec +requires_exec() +{ + if has_mount_option noexec; then + echo "1..0 # SKIP filesystem mounted with -o noexec" + exit 0 + fi +} diff --git a/contrib/pjdfstest/tests/open/20.t b/contrib/pjdfstest/tests/open/20.t index de80b61..a7eb3db 100644 --- a/contrib/pjdfstest/tests/open/20.t +++ b/contrib/pjdfstest/tests/open/20.t @@ -8,6 +8,8 @@ dir=`dirname $0` [ "${os}:${fs}" = "FreeBSD:UFS" ] || quick_exit +requires_exec + echo "1..4" n0=`namegen` diff --git a/contrib/pjdfstest/tests/truncate/11.t b/contrib/pjdfstest/tests/truncate/11.t index b00d7b8..8d9f0d5 100644 --- a/contrib/pjdfstest/tests/truncate/11.t +++ b/contrib/pjdfstest/tests/truncate/11.t @@ -8,6 +8,8 @@ dir=`dirname $0` [ "${os}" = "FreeBSD" ] || quick_exit +requires_exec + echo "1..2" n0=`namegen` |