1d7e7cb9Yuri Pankov#! /usr/bin/ksh -p
2d7e7cb9Yuri Pankov#
3d7e7cb9Yuri Pankov#
4d7e7cb9Yuri Pankov# This file and its contents are supplied under the terms of the
5d7e7cb9Yuri Pankov# Common Development and Distribution License ("CDDL"), version 1.0.
6d7e7cb9Yuri Pankov# You may only use this file in accordance with the terms of version
7d7e7cb9Yuri Pankov# 1.0 of the CDDL.
8d7e7cb9Yuri Pankov#
9d7e7cb9Yuri Pankov# A full copy of the text of the CDDL should have accompanied this
10d7e7cb9Yuri Pankov# source.  A copy of the CDDL is also available via the Internet at
11d7e7cb9Yuri Pankov# http://www.illumos.org/license/CDDL.
12d7e7cb9Yuri Pankov#
13d7e7cb9Yuri Pankov
14d7e7cb9Yuri Pankov#
15d7e7cb9Yuri Pankov# Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
16d7e7cb9Yuri Pankov#
17d7e7cb9Yuri Pankov
18d7e7cb9Yuri Pankov. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
19d7e7cb9Yuri Pankov
20d7e7cb9Yuri Pankov# DESCRIPTION:
21d7e7cb9Yuri Pankov# For the filesystem with casesensitivity=mixed, normalization=formD,
22d7e7cb9Yuri Pankov# check that lookup succeeds only if (case=same).
23d7e7cb9Yuri Pankov#
24d7e7cb9Yuri Pankov# STRATEGY:
25d7e7cb9Yuri Pankov# For each c/n name form:
26d7e7cb9Yuri Pankov# 1. Create file with given c/n name form.
27d7e7cb9Yuri Pankov# 2. Check that lookup succeeds if (case=same).
28d7e7cb9Yuri Pankov# 3. Check that lookup fails if (case=other).
29d7e7cb9Yuri Pankov
30d7e7cb9Yuri Pankovverify_runnable "global"
31d7e7cb9Yuri Pankov
32d7e7cb9Yuri Pankovfunction cleanup
33d7e7cb9Yuri Pankov{
34d7e7cb9Yuri Pankov	destroy_testfs
35d7e7cb9Yuri Pankov}
36d7e7cb9Yuri Pankov
37d7e7cb9Yuri Pankovlog_onexit cleanup
38d7e7cb9Yuri Pankovlog_assert "CM-UN FS: lookup succeeds if (case=same)"
39d7e7cb9Yuri Pankov
40d7e7cb9Yuri Pankovcreate_testfs "-o casesensitivity=mixed -o normalization=formD"
41d7e7cb9Yuri Pankov
42d7e7cb9Yuri Pankovfor name1 in $NAMES_ALL; do
43d7e7cb9Yuri Pankov	log_must create_file $name1
44d7e7cb9Yuri Pankov	for name2 in $NAMES_ALL; do
45d7e7cb9Yuri Pankov		if [[ $(get_case $name2) == $(get_case $name1) ]]; then
46d7e7cb9Yuri Pankov			log_must lookup_file $name2
47d7e7cb9Yuri Pankov		else
48d7e7cb9Yuri Pankov			log_mustnot lookup_file $name2
49d7e7cb9Yuri Pankov		fi
50d7e7cb9Yuri Pankov	done
51d7e7cb9Yuri Pankov	delete_file $name1
52d7e7cb9Yuri Pankovdone
53d7e7cb9Yuri Pankov
54d7e7cb9Yuri Pankovdestroy_testfs
55d7e7cb9Yuri Pankov
56d7e7cb9Yuri Pankovlog_pass "CM-UN FS: lookup succeeds if (case=same)"
57