diff options
Diffstat (limited to 'test/functional/lua/rspamadm/test_dns_client.lua')
-rw-r--r-- | test/functional/lua/rspamadm/test_dns_client.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/functional/lua/rspamadm/test_dns_client.lua b/test/functional/lua/rspamadm/test_dns_client.lua new file mode 100644 index 0000000..c54d594 --- /dev/null +++ b/test/functional/lua/rspamadm/test_dns_client.lua @@ -0,0 +1,30 @@ +local rspamd_dns = require "rspamd_dns" +local logger = require "rspamd_logger" + +local config_path = rspamd_paths['CONFDIR'] .. '/rspamd.conf' +local _r,err = rspamd_config:load_ucl(config_path) + +if not _r then + logger.errx('cannot parse %s: %s (r=%s)', config_path, err, _r) + os.exit(1) +end + +_r,err = rspamd_config:parse_rcl({'logging', 'worker'}) +if not _r then + logger.errx('cannot process %s: %s (r=%s)', config_path, err, _r) + os.exit(1) +end + +rspamd_config:init_subsystem('dns', rspamadm_ev_base) + + +local is_ok, results = rspamd_dns.request({ + config = rspamd_config, + session = rspamadm_session, + + type = 'txt', + name = 'test._domainkey.example.com', + -- name = '_dmarc.google.com', + }) + +print(is_ok, results[1]) |