Bug 8224 - Net::DNS::Nameserver API change breaks t/dnsbl_subtests.t
Summary: Net::DNS::Nameserver API change breaks t/dnsbl_subtests.t
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Regression Tests (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: All All
: P2 normal
Target Milestone: 4.0.1
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-04 23:38 UTC by Sidney Markowitz
Modified: 2024-03-04 23:42 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
Patch to fix bug patch None Sidney Markowitz [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Sidney Markowitz 2024-03-04 23:38:31 UTC
Created attachment 5937 [details]
Patch to fix bug

Net::DNS had some big changes between version 1.37 and 1.38, then a bit of instability in the API in versions leading up to the current 1.44. First it introduced a method start_server, then stop_server, and deprecated main_loop. Some of the focus of the most recent versions was on getting it to work under Windows. Net::DNS::Nameserver still does not seem to work completely reliably in Windows, but the developer seems to have settled on the current state as good enough.

For our purposes, we only make use of Net::DNS::Nameserver to set up a local nameserver on 127.0.0.1 for testing in t/dnsbl_subtests.t. It is sufficient to not run those tests on Windows with the newer versions of Net::DNS that break. There does not seem to be a problem with the use of Net::DNS anywhere in SpamAssassin itself.

The attached patch modifies t/dnsbl_subtests.t so it checks for the methods added by the various API changes and runs the test nameserver accordingly. It also skip running when under Windows with an incompatible version of Net::DNS::Nameserver, as determined by the existence of the newer methods rather than checking the version number.
Comment 1 Sidney Markowitz 2024-03-04 23:42:19 UTC
% svn ci -m "Bug 8224 - Handle different API versions of Net::DNS::Nameserver in dnsbl_subtests.t tests" t/dnsbl_subtests.t 
Sending        t/dnsbl_subtests.t
Transmitting file data .done
Committing transaction...
Committed revision 1916112.