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=insensitive, normalization=none,
22d7e7cb9Yuri Pankov# check that lookup succeeds only if (norm=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 (norm=same).
28d7e7cb9Yuri Pankov# 3. Check that lookup fails if (norm=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 "CI-not-UN FS: lookup succeeds only if (norm=same)"
39d7e7cb9Yuri Pankov
40d7e7cb9Yuri Pankovcreate_testfs "-o casesensitivity=insensitive -o normalization=none"
41d7e7cb9Yuri Pankov
42d7e7cb9Yuri Pankovfor name1 in $NAMES_C ; do
43d7e7cb9Yuri Pankov	log_must create_file $name1
44d7e7cb9Yuri Pankov	for name2 in $NAMES_C ; do
45d7e7cb9Yuri Pankov		log_must lookup_file $name2
46d7e7cb9Yuri Pankov	done
47d7e7cb9Yuri Pankov	for name2 in $NAMES_D; do
48d7e7cb9Yuri Pankov		log_mustnot lookup_file $name2
49d7e7cb9Yuri Pankov	done
50d7e7cb9Yuri Pankov	delete_file $name1
51d7e7cb9Yuri Pankovdone
52d7e7cb9Yuri Pankov
53d7e7cb9Yuri Pankovfor name1 in $NAMES_D ; do
54d7e7cb9Yuri Pankov	log_must create_file $name1
55d7e7cb9Yuri Pankov	for name2 in $NAMES_D ; do
56d7e7cb9Yuri Pankov		log_must lookup_file $name2
57d7e7cb9Yuri Pankov	done
58d7e7cb9Yuri Pankov	for name2 in $NAMES_C; do
59d7e7cb9Yuri Pankov		log_mustnot lookup_file $name2
60d7e7cb9Yuri Pankov	done
61d7e7cb9Yuri Pankov	delete_file $name1
62d7e7cb9Yuri Pankovdone
63d7e7cb9Yuri Pankov
64d7e7cb9Yuri Pankovdestroy_testfs
65d7e7cb9Yuri Pankov
66d7e7cb9Yuri Pankovlog_pass "CI-not-UN FS: lookup succeeds only if (norm=same)"
67