]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test of valid A-label in locale that cannot display it only with non-broken idn2
authorOndřej Surý <ondrej@sury.org>
Mon, 30 Sep 2019 07:04:59 +0000 (09:04 +0200)
committerOndřej Surý <ondrej@sury.org>
Mon, 30 Sep 2019 10:19:56 +0000 (12:19 +0200)
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.

(cherry picked from commit c42e3583f932412346bb977645c401698f9c114b)

bin/tests/system/idna/tests.sh

index b1eccdbab6e9a909cede7615895e5cff5afcfb0f..a3bfc62c64b093662e875204f9ae9c79d50a5ded 100644 (file)
@@ -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