From 83b93637258b9f1b63c7092dc87e5df572c6717c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20=C5=A0pa=C4=8Dek?= Date: Tue, 13 Oct 2020 12:54:16 +0200 Subject: [PATCH] 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. --- modules/daf/daf.test.lua | 4 ++++ modules/daf/daf_http.test.lua | 4 ++++ modules/http/http.test.lua | 4 ++++ 3 files changed, 12 insertions(+) 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') -- 2.47.2