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.
17 # Copyright (c) 2016 by Delphix. All rights reserved.
20 . $STF_SUITE/include/libtest.shlib
21 . $STF_SUITE/tests/functional/casenorm/casenorm.cfg
23 function create_testfs
27 rm -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
28 mkdir -p $TESTDIR || log_unresolved Could not create $TESTDIR
30 log_must zfs create $opts $TESTPOOL/$TESTFS
31 log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
34 function destroy_testfs
36 if datasetexists $TESTPOOL/$TESTFS ; then
37 log_must zfs destroy -f $TESTPOOL/$TESTFS
38 rm -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
44 typeset name=$TESTDIR/$1
51 typeset name=$TESTDIR/$1
53 rm $name >/dev/null 2>&1
55 if [[ $? -ne 0 ]] ; then
59 if [[ -f $name ]] ; then
68 zlook -l $TESTDIR $name >/dev/null 2>&1
71 function lookup_file_ci
75 zlook -il $TESTDIR $name >/dev/null 2>&1
80 for name in $NAMES_ALL ; do
82 if [[ $? -eq 0 ]] ; then
92 typeset norm=$(get_norm $1)
94 if [[ $norm == "C" ]] ; then
103 if [[ "${NAMES_C#*$1}" != "${NAMES_C}" ]] ; then
105 elif [[ "${NAMES_D#*$1}" != "${NAMES_D}" ]] ; then
114 if [[ ${NAMES_UPPER#*$1} != ${NAMES_UPPER} ]] ; then
116 elif [[ ${NAMES_LOWER#*$1} != ${NAMES_LOWER} ]] ; then
118 elif [[ ${NAMES_ORIG#*$1} != ${NAMES_ORIG} ]] ; then