From: Petr Špaček Date: Tue, 13 Oct 2020 10:54:16 +0000 (+0200) Subject: tests: adapt config tests to new map() X-Git-Tag: v5.2.0~6^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83b93637258b9f1b63c7092dc87e5df572c6717c;p=thirdparty%2Fknot-resolver.git tests: adapt config tests to new map() 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. --- diff --git a/modules/daf/daf.test.lua b/modules/daf/daf.test.lua index c0aceecac..2a46393bc 100644 --- a/modules/daf/daf.test.lua +++ b/modules/daf/daf.test.lua @@ -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') diff --git a/modules/daf/daf_http.test.lua b/modules/daf/daf_http.test.lua index fc1b50eb0..d89b180db 100644 --- a/modules/daf/daf_http.test.lua +++ b/modules/daf/daf_http.test.lua @@ -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') diff --git a/modules/http/http.test.lua b/modules/http/http.test.lua index 4d1e0fecc..2d0752fff 100644 --- a/modules/http/http.test.lua +++ b/modules/http/http.test.lua @@ -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')