summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/pkg/manifests/system-test-zfstest.mf33
-rw-r--r--usr/src/test/zfs-tests/include/commands.cfg1
-rw-r--r--usr/src/test/zfs-tests/runfiles/delphix.run9
-rw-r--r--usr/src/test/zfs-tests/runfiles/omnios.run9
-rw-r--r--usr/src/test/zfs-tests/runfiles/openindiana.run9
-rw-r--r--usr/src/test/zfs-tests/tests/functional/Makefile4
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/Makefile61
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/case_all_values.ksh42
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/casenorm.cfg27
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/casenorm.kshlib119
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/cleanup.ksh20
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_formd_delete.ksh53
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_formd_lookup.ksh51
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_none_delete.ksh71
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_none_lookup.ksh66
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_delete.ksh59
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_lookup.ksh56
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_lookup_ci.ksh51
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_delete.ksh56
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_lookup.ksh53
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_lookup_ci.ksh66
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/norm_all_values.ksh57
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_formd_delete.ksh59
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_formd_lookup.ksh56
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_none_delete.ksh56
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_none_lookup.ksh53
-rw-r--r--usr/src/test/zfs-tests/tests/functional/casenorm/setup.ksh23
27 files changed, 1217 insertions, 3 deletions
diff --git a/usr/src/pkg/manifests/system-test-zfstest.mf b/usr/src/pkg/manifests/system-test-zfstest.mf
index 61fe6c615a..0605ab6c6d 100644
--- a/usr/src/pkg/manifests/system-test-zfstest.mf
+++ b/usr/src/pkg/manifests/system-test-zfstest.mf
@@ -12,7 +12,7 @@
#
# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
-# Copyright 2015, Nexenta Systems Inc. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
#
set name=pkg.fmri value=pkg:/system/test/zfstest@$(PKGVERS)
@@ -35,6 +35,7 @@ dir path=opt/zfs-tests/tests/functional/atime
dir path=opt/zfs-tests/tests/functional/bootfs
dir path=opt/zfs-tests/tests/functional/cache
dir path=opt/zfs-tests/tests/functional/cachefile
+dir path=opt/zfs-tests/tests/functional/casenorm
dir path=opt/zfs-tests/tests/functional/checksum
dir path=opt/zfs-tests/tests/functional/clean_mirror
dir path=opt/zfs-tests/tests/functional/cli_root
@@ -328,6 +329,36 @@ file path=opt/zfs-tests/tests/functional/cachefile/cachefile_001_pos mode=0555
file path=opt/zfs-tests/tests/functional/cachefile/cachefile_002_pos mode=0555
file path=opt/zfs-tests/tests/functional/cachefile/cachefile_003_pos mode=0555
file path=opt/zfs-tests/tests/functional/cachefile/cachefile_004_pos mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/case_all_values mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/casenorm.cfg mode=0444
+file path=opt/zfs-tests/tests/functional/casenorm/casenorm.kshlib mode=0444
+file path=opt/zfs-tests/tests/functional/casenorm/cleanup mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/insensitive_formd_delete \
+ mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/insensitive_formd_lookup \
+ mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/insensitive_none_delete \
+ mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/insensitive_none_lookup \
+ mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/mixed_formd_delete mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/mixed_formd_lookup mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/mixed_formd_lookup_ci \
+ mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/mixed_none_delete mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/mixed_none_lookup mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/mixed_none_lookup_ci \
+ mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/norm_all_values mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/sensitive_formd_delete \
+ mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/sensitive_formd_lookup \
+ mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/sensitive_none_delete \
+ mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/sensitive_none_lookup \
+ mode=0555
+file path=opt/zfs-tests/tests/functional/casenorm/setup mode=0555
$(i386_ONLY)file path=opt/zfs-tests/tests/functional/checksum/edonr_test.amd64 \
mode=0555
$(i386_ONLY)file path=opt/zfs-tests/tests/functional/checksum/edonr_test.i386 \
diff --git a/usr/src/test/zfs-tests/include/commands.cfg b/usr/src/test/zfs-tests/include/commands.cfg
index 7f9e7f34c6..adcd697b05 100644
--- a/usr/src/test/zfs-tests/include/commands.cfg
+++ b/usr/src/test/zfs-tests/include/commands.cfg
@@ -155,6 +155,7 @@ export ZDB="/usr/sbin/zdb"
export ZFS="/usr/sbin/zfs"
export ZHACK="/usr/sbin/zhack"
export ZLOGIN="/usr/sbin/zlogin"
+export ZLOOK="/usr/bin/zlook"
export ZONEADM="/usr/sbin/zoneadm"
export ZONECFG="/usr/sbin/zonecfg"
export ZONENAME="/usr/bin/zonename"
diff --git a/usr/src/test/zfs-tests/runfiles/delphix.run b/usr/src/test/zfs-tests/runfiles/delphix.run
index 475a42969e..091fb22954 100644
--- a/usr/src/test/zfs-tests/runfiles/delphix.run
+++ b/usr/src/test/zfs-tests/runfiles/delphix.run
@@ -72,6 +72,15 @@ tests = ['cachefile_001_pos', 'cachefile_002_pos', 'cachefile_003_pos',
pre =
post =
+[/opt/zfs-tests/tests/functional/casenorm]
+tests = ['case_all_values', 'norm_all_values',
+ 'sensitive_none_lookup', 'sensitive_none_delete',
+ 'sensitive_formd_lookup', 'sensitive_formd_delete',
+ 'insensitive_none_lookup', 'insensitive_none_delete',
+ 'insensitive_formd_lookup', 'insensitive_formd_delete',
+ 'mixed_none_lookup', 'mixed_none_lookup_ci', 'mixed_none_delete',
+ 'mixed_formd_lookup', 'mixed_formd_lookup_ci', 'mixed_formd_delete']
+
[/opt/zfs-tests/tests/functional/checksum]
tests = ['run_edonr_test', 'run_sha2_test', 'run_skein_test']
pre =
diff --git a/usr/src/test/zfs-tests/runfiles/omnios.run b/usr/src/test/zfs-tests/runfiles/omnios.run
index 5b030f3390..4db1db32a5 100644
--- a/usr/src/test/zfs-tests/runfiles/omnios.run
+++ b/usr/src/test/zfs-tests/runfiles/omnios.run
@@ -72,6 +72,15 @@ tests = ['cachefile_001_pos', 'cachefile_002_pos', 'cachefile_003_pos',
pre =
post =
+[/opt/zfs-tests/tests/functional/casenorm]
+tests = ['case_all_values', 'norm_all_values',
+ 'sensitive_none_lookup', 'sensitive_none_delete',
+ 'sensitive_formd_lookup', 'sensitive_formd_delete',
+ 'insensitive_none_lookup', 'insensitive_none_delete',
+ 'insensitive_formd_lookup', 'insensitive_formd_delete',
+ 'mixed_none_lookup', 'mixed_none_lookup_ci', 'mixed_none_delete',
+ 'mixed_formd_lookup', 'mixed_formd_lookup_ci', 'mixed_formd_delete']
+
[/opt/zfs-tests/tests/functional/checksum]
tests = ['run_edonr_test', 'run_sha2_test', 'run_skein_test']
pre =
diff --git a/usr/src/test/zfs-tests/runfiles/openindiana.run b/usr/src/test/zfs-tests/runfiles/openindiana.run
index 475a42969e..091fb22954 100644
--- a/usr/src/test/zfs-tests/runfiles/openindiana.run
+++ b/usr/src/test/zfs-tests/runfiles/openindiana.run
@@ -72,6 +72,15 @@ tests = ['cachefile_001_pos', 'cachefile_002_pos', 'cachefile_003_pos',
pre =
post =
+[/opt/zfs-tests/tests/functional/casenorm]
+tests = ['case_all_values', 'norm_all_values',
+ 'sensitive_none_lookup', 'sensitive_none_delete',
+ 'sensitive_formd_lookup', 'sensitive_formd_delete',
+ 'insensitive_none_lookup', 'insensitive_none_delete',
+ 'insensitive_formd_lookup', 'insensitive_formd_delete',
+ 'mixed_none_lookup', 'mixed_none_lookup_ci', 'mixed_none_delete',
+ 'mixed_formd_lookup', 'mixed_formd_lookup_ci', 'mixed_formd_delete']
+
[/opt/zfs-tests/tests/functional/checksum]
tests = ['run_edonr_test', 'run_sha2_test', 'run_skein_test']
pre =
diff --git a/usr/src/test/zfs-tests/tests/functional/Makefile b/usr/src/test/zfs-tests/tests/functional/Makefile
index a182243e60..6f3638a7dd 100644
--- a/usr/src/test/zfs-tests/tests/functional/Makefile
+++ b/usr/src/test/zfs-tests/tests/functional/Makefile
@@ -1,5 +1,4 @@
#
-#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
@@ -12,6 +11,7 @@
#
# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
#
.PARALLEL: $(SUBDIRS)
@@ -21,6 +21,7 @@ SUBDIRS = acl \
bootfs \
cache \
cachefile \
+ casenorm \
checksum \
clean_mirror \
cli_root \
@@ -75,5 +76,4 @@ SUBDIRS = acl \
xattr \
zvol
-
include $(SRC)/test/Makefile.com
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/Makefile b/usr/src/test/zfs-tests/tests/functional/casenorm/Makefile
new file mode 100644
index 0000000000..de9a016bcb
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/Makefile
@@ -0,0 +1,61 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+include $(SRC)/Makefile.master
+
+ROOTOPTPKG= $(ROOT)/opt/zfs-tests
+ROOTTESTDIR= $(ROOTOPTPKG)/tests/functional/casenorm
+
+TESTS= setup \
+ cleanup \
+ case_all_values \
+ norm_all_values \
+ sensitive_none_lookup \
+ sensitive_none_delete \
+ sensitive_formd_lookup \
+ sensitive_formd_delete \
+ insensitive_none_lookup \
+ insensitive_none_delete \
+ insensitive_formd_lookup \
+ insensitive_formd_delete \
+ mixed_none_lookup \
+ mixed_none_lookup_ci \
+ mixed_none_delete \
+ mixed_formd_lookup \
+ mixed_formd_lookup_ci \
+ mixed_formd_delete
+
+FILES= casenorm.cfg \
+ casenorm.kshlib
+
+ROOTTESTS= $(TESTS:%=$(ROOTTESTDIR)/%)
+ROOTFILES= $(FILES:%=$(ROOTTESTDIR)/%)
+$(ROOTTESTS) := FILEMODE = 0555
+$(ROOTFILES) := FILEMODE = 0444
+
+all lint clean clobber:
+
+install: $(ROOTTESTS) $(ROOTFILES)
+
+$(ROOTTESTS) $(ROOTFILES): $(ROOTTESTDIR)
+
+$(ROOTTESTDIR):
+ $(INS.dir)
+
+$(ROOTTESTDIR)/%: %.ksh
+ $(INS.rename)
+
+$(ROOTTESTDIR)/%: %
+ $(INS.file)
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/case_all_values.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/case_all_values.ksh
new file mode 100644
index 0000000000..ea5fffb926
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/case_all_values.ksh
@@ -0,0 +1,42 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# Check that we can create FS with any supported casesensitivity value.
+#
+# STRATEGY:
+# For all suported casesensitivity values:
+# 1. Create FS with given casesensitivity value.
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "Can create FS with any supported casesensitivity value"
+
+for caseval in sensitive insensitive mixed; do
+ create_testfs "-o casesensitivity=$caseval"
+ destroy_testfs
+done
+
+log_pass "Can create FS with any supported casesensitivity value"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/casenorm.cfg b/usr/src/test/zfs-tests/tests/functional/casenorm/casenorm.cfg
new file mode 100644
index 0000000000..ffad2fb9f9
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/casenorm.cfg
@@ -0,0 +1,27 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+NAME_C_ORIG=$($ECHO 'F\0303\0257L\0303\0253N\0303\0204m\0303\0253')
+NAME_C_UPPER=$($ECHO 'F\0303\0217L\0303\0213N\0303\0204M\0303\0213')
+NAME_C_LOWER=$($ECHO 'f\0303\0257l\0303\0253n\0303\0244m\0303\0253')
+NAME_D_ORIG=$($ECHO 'Fi\0314\0210Le\0314\0210NA\0314\0210me\0314\0210')
+NAME_D_UPPER=$($ECHO 'FI\0314\0210LE\0314\0210NA\0314\0210ME\0314\0210')
+NAME_D_LOWER=$($ECHO 'fi\0314\0210le\0314\0210na\0314\0210me\0314\0210')
+NAMES_ORIG="$NAME_C_ORIG $NAME_D_ORIG"
+NAMES_UPPER="$NAME_C_UPPER $NAME_D_UPPER"
+NAMES_LOWER="$NAME_C_LOWER $NAME_D_LOWER"
+NAMES_C="$NAME_C_ORIG $NAME_C_UPPER $NAME_C_LOWER"
+NAMES_D="$NAME_D_ORIG $NAME_D_UPPER $NAME_D_LOWER"
+NAMES_ALL="$NAMES_C $NAMES_D"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/casenorm.kshlib b/usr/src/test/zfs-tests/tests/functional/casenorm/casenorm.kshlib
new file mode 100644
index 0000000000..ff1206fdb6
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/casenorm.kshlib
@@ -0,0 +1,119 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/casenorm/casenorm.cfg
+
+function create_testfs
+{
+ typeset opts=$1
+
+ $RM -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
+ $MKDIR -p $TESTDIR || log_unresolved Could not create $TESTDIR
+
+ log_must $ZFS create $opts $TESTPOOL/$TESTFS
+ log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
+}
+
+function destroy_testfs
+{
+ if datasetexists $TESTPOOL/$TESTFS ; then
+ log_must $ZFS destroy -f $TESTPOOL/$TESTFS
+ $RM -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
+ fi
+}
+
+function create_file
+{
+ typeset name=$TESTDIR/$1
+
+ $ECHO $name > $name
+}
+
+function delete_file
+{
+ typeset name=$TESTDIR/$1
+
+ $RM $name >/dev/null 2>&1
+
+ if [[ $? -ne 0 ]] ; then
+ return 1
+ fi
+
+ if [[ -f $name ]] ; then
+ return 2
+ fi
+}
+
+function lookup_file
+{
+ typeset name=$1
+
+ $ZLOOK -l $TESTDIR $name >/dev/null 2>&1
+}
+
+function lookup_file_ci
+{
+ typeset name=$1
+
+ $ZLOOK -il $TESTDIR $name >/dev/null 2>&1
+}
+
+function lookup_any
+{
+ for name in $NAMES_ALL ; do
+ lookup_file $name
+ if [[ $? -eq 0 ]] ; then
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+function switch_norm
+{
+ typeset norm=$(get_norm $1)
+
+ if [[ $norm == "C" ]] ; then
+ print "D"
+ else
+ print "C"
+ fi
+}
+
+function get_norm
+{
+ if [[ "${NAMES_C#*$1}" != "${NAMES_C}" ]] ; then
+ print "C"
+ elif [[ "${NAMES_D#*$1}" != "${NAMES_D}" ]] ; then
+ print "D"
+ else
+ return 1
+ fi
+}
+
+function get_case
+{
+ if [[ ${NAMES_UPPER#*$1} != ${NAMES_UPPER} ]] ; then
+ print "UPPER"
+ elif [[ ${NAMES_LOWER#*$1} != ${NAMES_LOWER} ]] ; then
+ print "LOWER"
+ elif [[ ${NAMES_ORIG#*$1} != ${NAMES_ORIG} ]] ; then
+ print "ORIG"
+ else
+ return 1
+ fi
+}
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/cleanup.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/cleanup.ksh
new file mode 100644
index 0000000000..0afd18ea5b
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/cleanup.ksh
@@ -0,0 +1,20 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+default_cleanup
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_formd_delete.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_formd_delete.ksh
new file mode 100644
index 0000000000..98a03dffb5
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_formd_delete.ksh
@@ -0,0 +1,53 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=insensitive, normalization=formD,
+# check that file can be deleted using any name form.
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that deleting file using other c/n name forms succeeds.
+# 3. Check that file isn't accessible by any c/n name form.
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CI-UN FS: delete succeeds using any name form"
+
+# Can delete using any case/normalization form
+create_testfs "-o casesensitivity=insensitive -o normalization=formD"
+
+for name1 in $NAMES_ALL ; do
+ for name2 in $NAMES_ALL ; do
+ log_must create_file $name1
+ log_must delete_file $name2
+ log_mustnot lookup_any
+ done
+done
+
+destroy_testfs
+
+log_pass "CI-UN FS: delete succeeds using any name form"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_formd_lookup.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_formd_lookup.ksh
new file mode 100644
index 0000000000..11824b7af6
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_formd_lookup.ksh
@@ -0,0 +1,51 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=insensitive, normalization=formD,
+# check that lookup succeds using any name form.
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that lookup succeeds for any other c/n name form.
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CI-UN FS: lookup succeeds using any name form"
+
+create_testfs "-o casesensitivity=insensitive -o normalization=formD"
+
+for name1 in $NAMES_ALL ; do
+ log_must create_file $name1
+ for name2 in $NAMES_ALL ; do
+ log_must lookup_file $name2
+ done
+ delete_file $name1
+done
+
+destroy_testfs
+
+log_pass "CI-UN FS: lookup succeeds using any name form"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_none_delete.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_none_delete.ksh
new file mode 100644
index 0000000000..e06dd2e579
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_none_delete.ksh
@@ -0,0 +1,71 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=insensitive, normalization=none,
+# check that delete succeeds if (norm=same).
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that delete succeeds if (norm=same).
+# 3. Check that file is no longer accessible using any name form.
+# 4. Check that delete fails if (norm=other).
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CI-not-UN FS: delete succeeds if (norm=same)"
+
+create_testfs "-o casesensitivity=insensitive -o normalization=none"
+
+for name1 in $NAMES_C ; do
+ for name2 in $NAMES_C ; do
+ log_must create_file $name1
+ log_must delete_file $name2
+ log_mustnot lookup_any
+ done
+ for name2 in $NAMES_D ; do
+ log_must create_file $name1
+ log_mustnot delete_file $name2
+ delete_file $name1
+ done
+done
+
+for name1 in $NAMES_D ; do
+ for name2 in $NAMES_D ; do
+ log_must create_file $name1
+ log_must delete_file $name2
+ log_mustnot lookup_any
+ done
+ for name2 in $NAMES_C ; do
+ log_must create_file $name1
+ log_mustnot delete_file $name2
+ delete_file $name1
+ done
+done
+
+destroy_testfs
+
+log_pass "CI-not-UN FS: delete succeeds if (norm=same)"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_none_lookup.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_none_lookup.ksh
new file mode 100644
index 0000000000..9d52d52b14
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/insensitive_none_lookup.ksh
@@ -0,0 +1,66 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=insensitive, normalization=none,
+# check that lookup succeeds only if (norm=same)
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that lookup succeeds if (norm=same).
+# 3. Check that lookup fails if (norm=other).
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CI-not-UN FS: lookup succeeds only if (norm=same)"
+
+create_testfs "-o casesensitivity=insensitive -o normalization=none"
+
+for name1 in $NAMES_C ; do
+ log_must create_file $name1
+ for name2 in $NAMES_C ; do
+ log_must lookup_file $name2
+ done
+ for name2 in $NAMES_D; do
+ log_mustnot lookup_file $name2
+ done
+ delete_file $name1
+done
+
+for name1 in $NAMES_D ; do
+ log_must create_file $name1
+ for name2 in $NAMES_D ; do
+ log_must lookup_file $name2
+ done
+ for name2 in $NAMES_C; do
+ log_mustnot lookup_file $name2
+ done
+ delete_file $name1
+done
+
+destroy_testfs
+
+log_pass "CI-not-UN FS: lookup succeeds only if (norm=same)"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_delete.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_delete.ksh
new file mode 100644
index 0000000000..3e7400c6b3
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_delete.ksh
@@ -0,0 +1,59 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=mixed, normalization=formD,
+# check that delete succeeds if (case=same).
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that delete succeeds if (case=same).
+# 3. Check that file is no longer accessible using any name form.
+# 4. Check that delete fails for all other name forms other than original.
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CM-UN FS: delete succeeds if (case=same)"
+
+create_testfs "-o casesensitivity=mixed -o normalization=formD"
+
+for name1 in $NAMES_ALL; do
+ typeset -n namen=NAME_$(switch_norm $name1)_$(get_case $name1)
+ for name2 in $NAMES_ALL; do
+ log_must create_file $name1
+ if [[ $name2 == $namen || $name2 == $name1 ]]; then
+ log_must delete_file $name2
+ log_mustnot lookup_any
+ else
+ log_mustnot delete_file $name2
+ fi
+ delete_file $name1
+ done
+done
+
+destroy_testfs
+
+log_pass "CM-UN FS: delete succeeds if (case=same)"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_lookup.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_lookup.ksh
new file mode 100644
index 0000000000..5250d1bb0f
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_lookup.ksh
@@ -0,0 +1,56 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=mixed, normalization=formD,
+# check that lookup succeeds only if (case=same).
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that lookup succeeds if (case=same).
+# 3. Check that lookup fails if (case=other).
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CM-UN FS: lookup succeeds if (case=same)"
+
+create_testfs "-o casesensitivity=mixed -o normalization=formD"
+
+for name1 in $NAMES_ALL; do
+ log_must create_file $name1
+ for name2 in $NAMES_ALL; do
+ if [[ $(get_case $name2) == $(get_case $name1) ]]; then
+ log_must lookup_file $name2
+ else
+ log_mustnot lookup_file $name2
+ fi
+ done
+ delete_file $name1
+done
+
+destroy_testfs
+
+log_pass "CM-UN FS: lookup succeeds if (case=same)"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_lookup_ci.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_lookup_ci.ksh
new file mode 100644
index 0000000000..584873bde0
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_formd_lookup_ci.ksh
@@ -0,0 +1,51 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=insensitive, normalization=formD,
+# check that CI lookup succeeds using any name form.
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that CI lookup succeeds for any c/n name form.
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CM-UN FS: CI lookup succeeds using any name form"
+
+create_testfs "-o casesensitivity=mixed -o normalization=formD"
+
+for name1 in $NAMES_ALL ; do
+ log_must create_file $name1
+ for name2 in $NAMES_ALL ; do
+ log_must lookup_file_ci $name2
+ done
+ delete_file $name1
+done
+
+destroy_testfs
+
+log_pass "CM-UN FS: CI lookup succeeds using any name form"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_delete.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_delete.ksh
new file mode 100644
index 0000000000..490f88689d
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_delete.ksh
@@ -0,0 +1,56 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=mixed, normalization=none,
+# check that delete succeeds only if (case=same and norm=same).
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file in given c/n name form.
+# 2. Check that delete fails for all other name forms.
+# 3. Check that delete succeeds if (case=same and norm=same).
+# 4. Check that file is no longer accessible by any name form.
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CM-not-UN FS: delete succeeds only if using exact name form"
+
+create_testfs "-o casesensitivity=mixed -o normalization=none"
+
+for name1 in $NAMES_ALL ; do
+ log_must create_file $name1
+ for name2 in $NAMES_ALL ; do
+ if [[ $name2 != $name1 ]] ; then
+ log_mustnot delete_file $name2
+ fi
+ done
+ delete_file $name1
+ log_mustnot lookup_any
+done
+
+destroy_testfs
+
+log_pass "CM-not-UN FS: delete succeeds only if using exact name form"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_lookup.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_lookup.ksh
new file mode 100644
index 0000000000..ad938a6d17
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_lookup.ksh
@@ -0,0 +1,53 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=mixed, normalization=none,
+# check that lookup succeeds only if (case=same and norm=same).
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that lookup fails for all other c/n name forms.
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CM-not-UN FS: lookup succeeds only if using exact name form"
+
+create_testfs "-o casesensitivity=mixed -o normalization=none"
+
+for name1 in $NAMES_ALL; do
+ for name2 in $NAMES_ALL; do
+ log_must create_file $name1
+ if [[ $name2 != $name1 ]]; then
+ log_mustnot lookup_file $name2
+ fi
+ delete_file $name1
+ done
+done
+
+destroy_testfs
+
+log_pass "CM-not-UN FS: lookup succeeds only if using exact name form"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_lookup_ci.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_lookup_ci.ksh
new file mode 100644
index 0000000000..3fd48a7aa6
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/mixed_none_lookup_ci.ksh
@@ -0,0 +1,66 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=mixed, normalization=none,
+# check that CI lookup succeeds only if (norm=same).
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that CI lookup succeeds if (norm=same).
+# 3. Check that CI lookup fails if (norm=other).
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CM-not-UN FS: CI lookup succeeds only if (norm=same)"
+
+create_testfs "-o casesensitivity=mixed -o normalization=none"
+
+for name1 in $NAMES_C ; do
+ log_must create_file $name1
+ for name2 in $NAMES_C ; do
+ log_must lookup_file_ci $name2
+ done
+ for name2 in $NAMES_D; do
+ log_mustnot lookup_file_ci $name2
+ done
+ delete_file $name1
+done
+
+for name1 in $NAMES_D ; do
+ log_must create_file $name1
+ for name2 in $NAMES_D ; do
+ log_must lookup_file_ci $name2
+ done
+ for name2 in $NAMES_C; do
+ log_mustnot lookup_file_ci $name2
+ done
+ delete_file $name1
+done
+
+destroy_testfs
+
+log_pass "CM-not-UN FS: CI lookup succeeds only if (norm=same)"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/norm_all_values.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/norm_all_values.ksh
new file mode 100644
index 0000000000..c5af81c0b7
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/norm_all_values.ksh
@@ -0,0 +1,57 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# Check that we can create FS with all supported normalization forms.
+#
+# STRATEGY:
+# 1. Create FS with all supported normalization forms.
+# 2. Check that utf8only is set on except for normalization=none.
+# 3. Check that it's not possible to create FS with utf8only=off
+# and normalization other than none.
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "Can create FS with all supported normalization forms"
+
+for form in none formC formD formKC formKD; do
+ create_testfs "-o normalization=$form"
+ if [[ $form != "none" ]] ; then
+ utf8only=$($ZFS get -H -o value utf8only $TESTPOOL/$TESTFS)
+ if [[ $utf8only != "on" ]]; then
+ log_fail "Turning on normalization didn't set " \
+ "utf8only to on"
+ fi
+ fi
+ destroy_testfs
+done
+
+for form in formC formD formKC formKD; do
+ log_mustnot $ZFS create -o utf8only=off -o normalization=$form \
+ $TESTPOOL/$TESTFS
+ destroy_testfs
+done
+
+log_pass "Can create FS with all supported normalization forms"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_formd_delete.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_formd_delete.ksh
new file mode 100644
index 0000000000..f02904d124
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_formd_delete.ksh
@@ -0,0 +1,59 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=sensitive, normalization=formD,
+# check that delete succeeds if (case=same).
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that delete succeeds if (case=same).
+# 3. Check that file is no longer accessible using any name form.
+# 4. Check that delete fails for all other name forms.
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CS-UN FS: delete succeeds if (case=same)"
+
+create_testfs "-o casesensitivity=sensitive -o normalization=formD"
+
+for name1 in $NAMES_ALL ; do
+ typeset -n namen=NAME_$(switch_norm $name1)_$(get_case $name1)
+ for name2 in $NAMES_ALL ; do
+ log_must create_file $name1
+ if [[ $name2 == $namen || $name2 == $name1 ]] ; then
+ log_must delete_file $name2
+ log_mustnot lookup_any
+ else
+ log_mustnot delete_file $name2
+ fi
+ delete_file $name1
+ done
+done
+
+destroy_testfs
+
+log_pass "CS-UN FS: delete succeeds if (case=same)"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_formd_lookup.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_formd_lookup.ksh
new file mode 100644
index 0000000000..92c3ed38d7
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_formd_lookup.ksh
@@ -0,0 +1,56 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=sensitive, normalization=formD,
+# check that lookup only if (case=same).
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that lookup succeeds if (case=same).
+# 3. Check that lookup fails if (case=other).
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CS-UN FS: lookup succeeds if (case=same)"
+
+create_testfs "-o casesensitivity=sensitive -o normalization=formD"
+
+for name1 in $NAMES_ALL; do
+ log_must create_file $name1
+ for name2 in $NAMES_ALL; do
+ if [[ $(get_case $name2) == $(get_case $name1) ]]; then
+ log_must lookup_file $name2
+ else
+ log_mustnot lookup_file $name2
+ fi
+ done
+ delete_file $name1
+done
+
+destroy_testfs
+
+log_pass "CS-UN FS: lookup succeeds if (case=same)"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_none_delete.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_none_delete.ksh
new file mode 100644
index 0000000000..a6a145e100
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_none_delete.ksh
@@ -0,0 +1,56 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=sensitive, normalization=none,
+# check that delete succeeds only if (case=same and norm=same).
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file in given c/n name form.
+# 2. Check that delete fails for all other name forms.
+# 3. Check that delete succeeds if (case=same and norm=same).
+# 4. Check that file is no longer accessible by any name form.
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CS-not-UN FS: delete succeeds only if using exact name form"
+
+create_testfs "-o casesensitivity=sensitive -o normalization=none"
+
+for name1 in $NAMES_ALL ; do
+ log_must create_file $name1
+ for name2 in $NAMES_ALL ; do
+ if [[ $name2 != $name1 ]] ; then
+ log_mustnot delete_file $name2
+ fi
+ done
+ delete_file $name1
+ log_mustnot lookup_any
+done
+
+destroy_testfs
+
+log_pass "CS-not-UN FS: delete succeeds only if using exact name form"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_none_lookup.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_none_lookup.ksh
new file mode 100644
index 0000000000..3cd341672b
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/sensitive_none_lookup.ksh
@@ -0,0 +1,53 @@
+#! /usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
+
+# DESCRIPTION:
+# For the filesystem with casesensitivity=sensitive, normalization=none,
+# check that lookup succeeds only if (case=same and norm=same).
+#
+# STRATEGY:
+# For each c/n name form:
+# 1. Create file with given c/n name form.
+# 2. Check that lookup fails for all other c/n name forms.
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_testfs
+}
+
+log_onexit cleanup
+log_assert "CS-not-UN FS: lookup succeeds only if using exact name form"
+
+create_testfs "-o casesensitivity=sensitive -o normalization=none"
+
+for name1 in $NAMES_ALL; do
+ for name2 in $NAMES_ALL; do
+ log_must create_file $name1
+ if [[ $name2 != $name1 ]]; then
+ log_mustnot lookup_file $name2
+ fi
+ delete_file $name1
+ done
+done
+
+destroy_testfs
+
+log_pass "CS-not-UN FS: lookup succeeds only if using exact name form"
diff --git a/usr/src/test/zfs-tests/tests/functional/casenorm/setup.ksh b/usr/src/test/zfs-tests/tests/functional/casenorm/setup.ksh
new file mode 100644
index 0000000000..b57431c8a5
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/casenorm/setup.ksh
@@ -0,0 +1,23 @@
+#!/usr/bin/ksh -p
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+verify_runnable "global"
+DISK=${DISKS%% *}
+log_must $ZPOOL create $TESTPOOL $DISK
+log_pass