7290 ZFS test suite needs to control what utilities it can run
[unleashed.git] / usr / src / test / zfs-tests / tests / functional / casenorm / norm_all_values.ksh
blob0037d3a835ccfc4b57e75a4942261a1ab25497d3
1 #! /usr/bin/ksh -p
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.
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.
15 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
19 # Copyright (c) 2016 by Delphix. All rights reserved.
22 . $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
24 # DESCRIPTION:
25 # Check that we can create FS with all supported normalization forms.
27 # STRATEGY:
28 # 1. Create FS with all supported normalization forms.
29 # 2. Check that utf8only is set on except for normalization=none.
30 # 3. Check that it's not possible to create FS with utf8only=off
31 # and normalization other than none.
33 verify_runnable "global"
35 function cleanup
37 destroy_testfs
40 log_onexit cleanup
41 log_assert "Can create FS with all supported normalization forms"
43 for form in none formC formD formKC formKD; do
44 create_testfs "-o normalization=$form"
45 if [[ $form != "none" ]] ; then
46 utf8only=$(zfs get -H -o value utf8only $TESTPOOL/$TESTFS)
47 if [[ $utf8only != "on" ]]; then
48 log_fail "Turning on normalization didn't set " \
49 "utf8only to on"
52 destroy_testfs
53 done
55 for form in formC formD formKC formKD; do
56 log_mustnot zfs create -o utf8only=off -o normalization=$form \
57 $TESTPOOL/$TESTFS
58 destroy_testfs
59 done
61 log_pass "Can create FS with all supported normalization forms"