2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
16 . $STF_SUITE/include/libtest.shlib
17 . $STF_SUITE/tests/functional/casenorm/casenorm.cfg
19 function create_testfs
23 $RM -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
24 $MKDIR -p $TESTDIR || log_unresolved Could not create $TESTDIR
26 log_must $ZFS create $opts $TESTPOOL/$TESTFS
27 log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
30 function destroy_testfs
32 if datasetexists $TESTPOOL/$TESTFS ; then
33 log_must $ZFS destroy -f $TESTPOOL/$TESTFS
34 $RM -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
40 typeset name=$TESTDIR/$1
47 typeset name=$TESTDIR/$1
49 $RM $name >/dev/null 2>&1
51 if [[ $? -ne 0 ]] ; then
55 if [[ -f $name ]] ; then
64 $ZLOOK -l $TESTDIR $name >/dev/null 2>&1
67 function lookup_file_ci
71 $ZLOOK -il $TESTDIR $name >/dev/null 2>&1
76 for name in $NAMES_ALL ; do
78 if [[ $? -eq 0 ]] ; then
88 typeset norm=$(get_norm $1)
90 if [[ $norm == "C" ]] ; then
99 if [[ "${NAMES_C#*$1}" != "${NAMES_C}" ]] ; then
101 elif [[ "${NAMES_D#*$1}" != "${NAMES_D}" ]] ; then
110 if [[ ${NAMES_UPPER#*$1} != ${NAMES_UPPER} ]] ; then
112 elif [[ ${NAMES_LOWER#*$1} != ${NAMES_LOWER} ]] ; then
114 elif [[ ${NAMES_ORIG#*$1} != ${NAMES_ORIG} ]] ; then