SA Bugzilla – Bug 8224
Net::DNS::Nameserver API change breaks t/dnsbl_subtests.t
Last modified: 2024-03-04 23:42:41 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.
% 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.