Skip to contentSkip to conversation

tcl8: Fix http-4.15 ptest failure

PATCH New Khem Raj 1 participant 1 message Oct 31

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 tcl8: Fix http-4.15 ptest failure

From: Khem Raj <[email protected]>

The test expects the DNS lookup of the bogus host not_a_host.tcl.tk to fail, but tcl.tk now has a wildcard DNS record, so the request succeeds with a "301 Moved Permanently" reply and the test fails. Backport the upstream Tcl 9 change to use a host in a non-existent TLD instead.

Tested with core-image-ptest-tcl8 on qemux86-64 with glibc and musl.

---
 ...t-Do-not-rely-on-tk-TLD-in-http-4.15.patch | 35 +++++++++++++++++++
 meta/recipes-devtools/tcltk8/tcl8_8.6.18.bb   |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta/recipes-devtools/tcltk8/tcl8/0001-http.test-Do-not-rely-on-tk-TLD-in-http-4.15.patch
meta/recipes-devtools/tcltk8/tcl8/0001-http.test-Do-not-rely-on-tk-TLD-in-http-4.15.patch new file +35 -0
new file mode 100644
index 0000000000..28eb6c9436
@@ -0,0 +1,35 @@
+From 54accd2a65ec689be9f0bbed6870d231a8d35f90 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 31 Oct 2026 02:56:00 +0000
+Subject: [PATCH] http.test: Do not rely on tk TLD in http-4.15
+
+http-4.15 expects the lookup of the bogus host not_a_host.tcl.tk to
+fail, but tcl.tk now has a wildcard DNS record, so the request
+succeeds with a "301 Moved Permanently" reply and the test fails:
+
+---- Test completed normally; Return code was: 0
+---- Return code should have been one of: 1
+
+Use a host in a non-existent TLD instead and increase the timeout so a
+slow negative DNS lookup does not confound the test, as done upstream
+for Tcl 9 in [bbaf69c3dd].
+
+Upstream-Status: Backport [https://github.com/tcltk/tcl/commit/0a97f6d1c55f4158bafd1539dc1b20cce6188857]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tests/http.test | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/http.test b/tests/http.test
+index 6406675..d6b3537 100644
+--- a/tests/http.test
++++ b/tests/http.test
+@@ -624,7 +624,7 @@ test http-4.14 {http::Event} -body {
+ test http-4.15 {http::Event} -body {
+     # This test may fail if you use a proxy server. That is to be
+     # expected and is not a problem with Tcl.
+-    set token [http::geturl //not_a_host.tcl.tk -timeout 3000 -command \#]
++    set token [http::geturl //not-a-host.nodns. -timeout 30000 -command \#]
+     http::wait $token
+     http::status $token
+     # error codes vary among platforms.
meta/recipes-devtools/tcltk8/tcl8_8.6.18.bb +1 -0
index 5e296cc7e6..8d2aa34acb 100644
@@ -23,6 +23,7 @@ SRC_URI = "${BASE_SRC_URI} \
            file://alter-includedir.patch \
            file://run-ptest \
            file://0001-generic-tcl.h-use-Tcl_WideInt-for-seconds-in-Tcl_Tim.patch \
+           file://0001-http.test-Do-not-rely-on-tk-TLD-in-http-4.15.patch \
            "
 SRC_URI[sha256sum] = "1880b6337de72431174511419550bb4cf1327b7c8200a5466d1c4eb3ecac5132"