1#! /usr/bin/ksh -p 2# 3# 4# This file and its contents are supplied under the terms of the 5# Common Development and Distribution License ("CDDL"), version 1.0. 6# You may only use this file in accordance with the terms of version 7# 1.0 of the CDDL. 8# 9# A full copy of the text of the CDDL should have accompanied this 10# source. A copy of the CDDL is also available via the Internet at 11# http://www.illumos.org/license/CDDL. 12# 13 14# 15# Copyright 2015 Nexenta Systems, Inc. All rights reserved. 16# 17 18. $STF_SUITE/tests/functional/casenorm/casenorm.kshlib 19 20# DESCRIPTION: 21# Check that we can create FS with all supported normalization forms. 22# 23# STRATEGY: 24# 1. Create FS with all supported normalization forms. 25# 2. Check that utf8only is set on except for normalization=none. 26# 3. Check that it's not possible to create FS with utf8only=off 27# and normalization other than none. 28 29verify_runnable "global" 30 31function cleanup 32{ 33 destroy_testfs 34} 35 36log_onexit cleanup 37log_assert "Can create FS with all supported normalization forms" 38 39for form in none formC formD formKC formKD; do 40 create_testfs "-o normalization=$form" 41 if [[ $form != "none" ]] ; then 42 utf8only=$($ZFS get -H -o value utf8only $TESTPOOL/$TESTFS) 43 if [[ $utf8only != "on" ]]; then 44 log_fail "Turning on normalization didn't set " \ 45 "utf8only to on" 46 fi 47 fi 48 destroy_testfs 49done 50 51for form in formC formD formKC formKD; do 52 log_mustnot $ZFS create -o utf8only=off -o normalization=$form \ 53 $TESTPOOL/$TESTFS 54 destroy_testfs 55done 56 57log_pass "Can create FS with all supported normalization forms" 58