]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests: adapt config tests to new map()
authorPetr Špaček <petr.spacek@nic.cz>
Tue, 13 Oct 2020 10:54:16 +0000 (12:54 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Mon, 26 Oct 2020 13:25:13 +0000 (14:25 +0100)
map() now depends on presence of control sockets, and by default config
tests are executed with KRESD_NO_LISTEN=1 env var which prevents control
sockets from being created. Tests for features which depend on map() now
explicitly create their own control socket.

modules/daf/daf.test.lua
modules/daf/daf_http.test.lua
modules/http/http.test.lua

index c0aceecac22a46c7234657d5a069b56f2e6c5544..2a46393bc8a9e07900ac2d0b75ee9845542a7a62 100644 (file)
@@ -6,6 +6,10 @@ net.ipv6 = false
 -- do not listen, test is driven by config code
 env.KRESD_NO_LISTEN = true
 
+local path = worker.cwd..'/control/'..worker.pid
+same(true, net.listen(path, nil, {kind = 'control'}),
+       'new control sockets were created so map() can work')
+
 modules.load('hints > iterate')
 modules.load('daf')
 
index fc1b50eb020116886aa847e21d2b60dfaebe9458..d89b180db1daaa88c9b5d532607338d568e000e9 100644 (file)
@@ -5,6 +5,10 @@ if not has_http then
        -- skipping daf module test because http its not installed
        os.exit(77)
 else
+       local path = worker.cwd..'/control/'..worker.pid
+       same(true, net.listen(path, nil, {kind = 'control'}),
+               'new control sockets were created so map() can work')
+
        local request = require('http.request')
 
        modules.load('http')
index 4d1e0fecc12f65d9f382c0425668c469277074bb..2d0752fffb53a2f6ac2faca39c90a06823c3f596 100644 (file)
@@ -5,6 +5,10 @@ if not has_http then
        -- skipping http module test because its not installed
        os.exit(77)
 else
+       local path = worker.cwd..'/control/'..worker.pid
+       same(true, net.listen(path, nil, {kind = 'control'}),
+               'new control sockets were created so map() can work')
+
        local request = require('http.request')
 
        modules.load('http')