From: Tomas Krizek Date: Fri, 13 Dec 2019 14:32:29 +0000 (+0100) Subject: modules/http: fix net.listen in config tests X-Git-Tag: v5.0.0~16^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb33e7cb4dc95f8b52ed2c5df9cf171312d0fadb;p=thirdparty%2Fknot-resolver.git modules/http: fix net.listen in config tests --- diff --git a/modules/http/http.test.lua b/modules/http/http.test.lua index 0422c2d22..40447938f 100644 --- a/modules/http/http.test.lua +++ b/modules/http/http.test.lua @@ -20,7 +20,7 @@ else local bound for _ = 1,1000 do - bound = net.listen('127.0.0.1', math.random(20000, 29999), { kind = 'webtest'} ) + bound, _err = pcall(net.listen, '127.0.0.1', math.random(20000, 29999), { kind = 'webtest'}) if bound then break end diff --git a/modules/http/http_doh.test.lua b/modules/http/http_doh.test.lua index 467713eb6..a5bbb1114 100644 --- a/modules/http/http_doh.test.lua +++ b/modules/http/http_doh.test.lua @@ -88,7 +88,7 @@ else local bound for _ = 1,1000 do - bound = net.listen('127.0.0.1', math.random(30000, 39999), { kind = 'doh'} ) + bound, _err = pcall(net.listen, '127.0.0.1', math.random(30000, 39999), { kind = 'doh' }) if bound then break end diff --git a/modules/http/test_tls/tls.test.lua b/modules/http/test_tls/tls.test.lua index ccb6a2498..d0cd4e6ca 100644 --- a/modules/http/test_tls/tls.test.lua +++ b/modules/http/test_tls/tls.test.lua @@ -16,7 +16,7 @@ else local bound for _ = 1,1000 do - bound = net.listen('127.0.0.1', math.random(1025,65535), { kind = 'webmgmt'} ) + bound, _err = pcall(net.listen, '127.0.0.1', math.random(1025,65535), { kind = 'webmgmt' }) if bound then break end