summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGeorge Melikov <[email protected]>2019-11-20 03:23:27 +0300
committerBrian Behlendorf <[email protected]>2019-11-19 16:23:27 -0800
commit540312df7f3f8e10e3049e4b3ec667d57fa9b90e (patch)
tree4f1f6c1be883d2f48fa892311d7b3bc0c07ff0d7 /tests
parent8221bcf1e4efc40d92d1354de710048c70eb709b (diff)
ZTS: Casenorm fix unicode interpretation
Use `printf` to properly interpret unicode characters. Illumos uses a utility called `zlook` to allow additional flags to be provided to readdir and lookup for testing. This functionality could be ported to Linux, but even without it several of the tests can be enabled by instead using the standard `test` command. Additional, work is required to enable the remaining test cases. Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Melikov <[email protected]> Issue #7633 Closes #8812
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test-runner/bin/zts-report.py8
-rw-r--r--tests/zfs-tests/tests/functional/casenorm/casenorm.cfg16
-rw-r--r--tests/zfs-tests/tests/functional/casenorm/casenorm.kshlib12
3 files changed, 20 insertions, 16 deletions
diff --git a/tests/test-runner/bin/zts-report.py b/tests/test-runner/bin/zts-report.py
index 4c3c29384..0e78c3547 100755
--- a/tests/test-runner/bin/zts-report.py
+++ b/tests/test-runner/bin/zts-report.py
@@ -160,17 +160,9 @@ summary = {
# reasons listed above can be used.
#
known = {
- 'casenorm/sensitive_none_lookup': ['FAIL', '7633'],
- 'casenorm/sensitive_none_delete': ['FAIL', '7633'],
'casenorm/sensitive_formd_lookup': ['FAIL', '7633'],
'casenorm/sensitive_formd_delete': ['FAIL', '7633'],
- 'casenorm/insensitive_none_lookup': ['FAIL', '7633'],
- 'casenorm/insensitive_none_delete': ['FAIL', '7633'],
- 'casenorm/insensitive_formd_lookup': ['FAIL', '7633'],
- 'casenorm/insensitive_formd_delete': ['FAIL', '7633'],
- 'casenorm/mixed_none_lookup': ['FAIL', '7633'],
'casenorm/mixed_none_lookup_ci': ['FAIL', '7633'],
- 'casenorm/mixed_none_delete': ['FAIL', '7633'],
'casenorm/mixed_formd_lookup': ['FAIL', '7633'],
'casenorm/mixed_formd_lookup_ci': ['FAIL', '7633'],
'casenorm/mixed_formd_delete': ['FAIL', '7633'],
diff --git a/tests/zfs-tests/tests/functional/casenorm/casenorm.cfg b/tests/zfs-tests/tests/functional/casenorm/casenorm.cfg
index 9e8e45686..5d2efbf00 100644
--- a/tests/zfs-tests/tests/functional/casenorm/casenorm.cfg
+++ b/tests/zfs-tests/tests/functional/casenorm/casenorm.cfg
@@ -17,12 +17,16 @@
# Copyright (c) 2016 by Delphix. All rights reserved.
#
-NAME_C_ORIG=$(echo 'F\0303\0257L\0303\0253N\0303\0204m\0303\0253')
-NAME_C_UPPER=$(echo 'F\0303\0217L\0303\0213N\0303\0204M\0303\0213')
-NAME_C_LOWER=$(echo 'f\0303\0257l\0303\0253n\0303\0244m\0303\0253')
-NAME_D_ORIG=$(echo 'Fi\0314\0210Le\0314\0210NA\0314\0210me\0314\0210')
-NAME_D_UPPER=$(echo 'FI\0314\0210LE\0314\0210NA\0314\0210ME\0314\0210')
-NAME_D_LOWER=$(echo 'fi\0314\0210le\0314\0210na\0314\0210me\0314\0210')
+# Ksh on linux may have locale env variables undefined
+export LANG="C.UTF-8"
+export LC_ALL="C.UTF-8"
+
+NAME_C_ORIG=$(printf '\u0046\u00ef\u004c\u00eb\u004e\u00c4\u006d\u00eb')
+NAME_C_UPPER=$(printf '\u0046\u00cf\u004c\u00cb\u004e\u00c4\u004d\u00cb')
+NAME_C_LOWER=$(printf '\u0066\u00ef\u006c\u00eb\u006e\u00e4\u006d\u00eb')
+NAME_D_ORIG=$(printf '\u0046\u0069\u0308\u004c\u0065\u0308\u004e\u0041\u0308\u006d\u0065\u0308')
+NAME_D_UPPER=$(printf '\u0046\u0049\u0308\u004c\u0045\u0308\u004e\u0041\u0308\u004d\u0045\u0308')
+NAME_D_LOWER=$(printf '\u0066\u0069\u0308\u006c\u0065\u0308\u006e\u0061\u0308\u006d\u0065\u0308')
NAMES_ORIG="$NAME_C_ORIG $NAME_D_ORIG"
NAMES_UPPER="$NAME_C_UPPER $NAME_D_UPPER"
NAMES_LOWER="$NAME_C_LOWER $NAME_D_LOWER"
diff --git a/tests/zfs-tests/tests/functional/casenorm/casenorm.kshlib b/tests/zfs-tests/tests/functional/casenorm/casenorm.kshlib
index 273522406..5b080165b 100644
--- a/tests/zfs-tests/tests/functional/casenorm/casenorm.kshlib
+++ b/tests/zfs-tests/tests/functional/casenorm/casenorm.kshlib
@@ -65,14 +65,22 @@ function lookup_file
{
typeset name=$1
- zlook -l $TESTDIR $name >/dev/null 2>&1
+ if is_linux; then
+ test -f "${TESTDIR}/${name}" >/dev/null 2>&1
+ else
+ zlook -l $TESTDIR $name >/dev/null 2>&1
+ fi
}
function lookup_file_ci
{
typeset name=$1
- zlook -il $TESTDIR $name >/dev/null 2>&1
+ if is_linux; then
+ test -f "${TESTDIR}/${name}" >/dev/null 2>&1
+ else
+ zlook -il $TESTDIR $name >/dev/null 2>&1
+ fi
}
function lookup_any