Print this page
Missed zlook, sync with master
7290 ZFS test suite needs to control what utilities it can run
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/test/zfs-tests/tests/functional/casenorm/casenorm.kshlib
+++ new/usr/src/test/zfs-tests/tests/functional/casenorm/casenorm.kshlib
1 1 #
2 2 # This file and its contents are supplied under the terms of the
3 3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 4 # You may only use this file in accordance with the terms of version
5 5 # 1.0 of the CDDL.
|
↓ open down ↓ |
5 lines elided |
↑ open up ↑ |
6 6 #
7 7 # A full copy of the text of the CDDL should have accompanied this
8 8 # source. A copy of the CDDL is also available via the Internet at
9 9 # http://www.illumos.org/license/CDDL.
10 10 #
11 11
12 12 #
13 13 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
14 14 #
15 15
16 +#
17 +# Copyright (c) 2016 by Delphix. All rights reserved.
18 +#
19 +
16 20 . $STF_SUITE/include/libtest.shlib
17 21 . $STF_SUITE/tests/functional/casenorm/casenorm.cfg
18 22
19 23 function create_testfs
20 24 {
21 25 typeset opts=$1
22 26
23 - $RM -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
24 - $MKDIR -p $TESTDIR || log_unresolved Could not create $TESTDIR
27 + rm -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
28 + mkdir -p $TESTDIR || log_unresolved Could not create $TESTDIR
25 29
26 - log_must $ZFS create $opts $TESTPOOL/$TESTFS
27 - log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
30 + log_must zfs create $opts $TESTPOOL/$TESTFS
31 + log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
28 32 }
29 33
30 34 function destroy_testfs
31 35 {
32 36 if datasetexists $TESTPOOL/$TESTFS ; then
33 - log_must $ZFS destroy -f $TESTPOOL/$TESTFS
34 - $RM -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
37 + log_must zfs destroy -f $TESTPOOL/$TESTFS
38 + rm -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
35 39 fi
36 40 }
37 41
38 42 function create_file
39 43 {
40 44 typeset name=$TESTDIR/$1
41 45
42 - $ECHO $name > $name
46 + echo $name > $name
43 47 }
44 48
45 49 function delete_file
46 50 {
47 51 typeset name=$TESTDIR/$1
48 52
49 - $RM $name >/dev/null 2>&1
53 + rm $name >/dev/null 2>&1
50 54
51 55 if [[ $? -ne 0 ]] ; then
52 56 return 1
53 57 fi
54 58
55 59 if [[ -f $name ]] ; then
56 60 return 2
57 61 fi
58 62 }
59 63
60 64 function lookup_file
61 65 {
62 66 typeset name=$1
63 67
64 - $ZLOOK -l $TESTDIR $name >/dev/null 2>&1
68 + zlook -l $TESTDIR $name >/dev/null 2>&1
65 69 }
66 70
67 71 function lookup_file_ci
68 72 {
69 73 typeset name=$1
70 74
71 - $ZLOOK -il $TESTDIR $name >/dev/null 2>&1
75 + zlook -il $TESTDIR $name >/dev/null 2>&1
72 76 }
73 77
74 78 function lookup_any
75 79 {
76 80 for name in $NAMES_ALL ; do
77 81 lookup_file $name
78 82 if [[ $? -eq 0 ]] ; then
79 83 return 0
80 84 fi
81 85 done
82 86
83 87 return 1
84 88 }
85 89
86 90 function switch_norm
87 91 {
88 92 typeset norm=$(get_norm $1)
89 93
90 94 if [[ $norm == "C" ]] ; then
91 95 print "D"
92 96 else
93 97 print "C"
94 98 fi
95 99 }
96 100
97 101 function get_norm
98 102 {
99 103 if [[ "${NAMES_C#*$1}" != "${NAMES_C}" ]] ; then
100 104 print "C"
101 105 elif [[ "${NAMES_D#*$1}" != "${NAMES_D}" ]] ; then
102 106 print "D"
103 107 else
104 108 return 1
105 109 fi
106 110 }
107 111
108 112 function get_case
109 113 {
110 114 if [[ ${NAMES_UPPER#*$1} != ${NAMES_UPPER} ]] ; then
111 115 print "UPPER"
112 116 elif [[ ${NAMES_LOWER#*$1} != ${NAMES_LOWER} ]] ; then
113 117 print "LOWER"
114 118 elif [[ ${NAMES_ORIG#*$1} != ${NAMES_ORIG} ]] ; then
115 119 print "ORIG"
116 120 else
117 121 return 1
118 122 fi
119 123 }
|
↓ open down ↓ |
38 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX