From c42e3583f932412346bb977645c401698f9c114b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Mon, 30 Sep 2019 09:04:59 +0200 Subject: [PATCH] Test of valid A-label in locale that cannot display it only with non-broken idn2 The libidn2 library on Ubuntu Bionic is broken and idn2_to_unicode_8zlz() does't fail when it should. This commit ensures that we don't run the system test for valid A-label in locale that cannot display with the buggy libidn2 as it would break the tests. --- bin/tests/system/idna/tests.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/tests/system/idna/tests.sh b/bin/tests/system/idna/tests.sh index 0d96c8bd7f..fe8ae5551d 100644 --- a/bin/tests/system/idna/tests.sh +++ b/bin/tests/system/idna/tests.sh @@ -254,12 +254,14 @@ idna_enabled_test() { # The "+[no]idnout" flag has no effect in these cases. text="Checking valid A-label in C locale" label="xn--nxasmq6b.com" - LC_ALL=C idna_test "$text" "" "$label" "$label." - LC_ALL=C idna_test "$text" "+noidnin +noidnout" "$label" "$label." - LC_ALL=C idna_test "$text" "+noidnin +idnout" "$label" "$label." - LC_ALL=C idna_test "$text" "+idnin +noidnout" "$label" "$label." - LC_ALL=C idna_test "$text" "+idnin +idnout" "$label" "$label." - LC_ALL=C idna_test "$text" "+noidnin +idnout" "$label" "$label." + if command -v idn2 >/dev/null && ! LC_ALL=C idn2 -d "$label" >/dev/null 2>/dev/null; then + LC_ALL=C idna_test "$text" "" "$label" "$label." + LC_ALL=C idna_test "$text" "+noidnin +noidnout" "$label" "$label." + LC_ALL=C idna_test "$text" "+noidnin +idnout" "$label" "$label." + LC_ALL=C idna_test "$text" "+idnin +noidnout" "$label" "$label." + LC_ALL=C idna_test "$text" "+idnin +idnout" "$label" "$label." + LC_ALL=C idna_test "$text" "+noidnin +idnout" "$label" "$label." + fi