]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/http: fix net.listen in config tests
authorTomas Krizek <tomas.krizek@nic.cz>
Fri, 13 Dec 2019 14:32:29 +0000 (15:32 +0100)
committerPetr Špaček <petr.spacek@nic.cz>
Fri, 20 Dec 2019 14:13:50 +0000 (15:13 +0100)
modules/http/http.test.lua
modules/http/http_doh.test.lua
modules/http/test_tls/tls.test.lua

index 0422c2d22d9eb3472f0d1444334ca82d00728183..40447938f62def94b8c0d7f61e532d0d0deabc50 100644 (file)
@@ -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
index 467713eb63e9ebfc4bda42935dedfaa6fccc20ac..a5bbb11144e95e9f12ef6a477a9891279bbf9f1b 100644 (file)
@@ -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
index ccb6a24980a0b5ebac47ae802e2c24412db3ff52..d0cd4e6ca65e7f850111b48fb97ac6bfab9ee397 100644 (file)
@@ -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