Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 328899 - dev-perl/Test-WWW-Mechanize fails tests due to unexpected DNS resolution success.
Summary: dev-perl/Test-WWW-Mechanize fails tests due to unexpected DNS resolution succ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Perl team
URL: http://code.google.com/p/www-mechaniz...
Whiteboard:
Keywords:
Depends on:
Blocks: perl-testfailure
  Show dependency tree
 
Reported: 2010-07-19 03:52 UTC by Kent Fredric (IRC: kent\n)
Modified: 2014-01-20 19:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
DNS Resolution patch. (fix_dns.patch,2.72 KB, patch)
2010-07-19 03:55 UTC, Kent Fredric (IRC: kent\n)
Details | Diff
dev-perl/Test-WWW-Mechanize/Test-WWW-Mechanize-1.30.ebuild (Test-WWW-Mechanize-1.30-r1.ebuild,734 bytes, text/plain)
2010-07-19 11:41 UTC, Kent Fredric (IRC: kent\n)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Fredric (IRC: kent\n) gentoo-dev 2010-07-19 03:52:51 UTC
<herd>Perl</herd>

This will also occur if you have the following setup.

1: A dns record with a wildcard in it ie:  *.foo.bar => 192.157.1.1
2. A default DNS search of 'foo.bar'.

In this configuration, non-fully-qualified domains result in a fallback, so wango.nonexistent.xx-only-testing expands as wango.nonexistent.xx-only-testing.foo.bar ,which then matches the wildcard record, resolving the IP.

The solution is straightforward, but little known. All one has to do is put a '.' at the right hand end of the domain name to mark it a "fully qualified" so that search path resolution doesn't happen.

I have a working patch for the test suite that I have submitted to upstream for review.


t/back_ok.t ............. 8/11 
#   Failed test 'sanity check: we can't load NONEXISTENT.html'
#   at t/back_ok.t line 52.
t/back_ok.t ............. 9/11 
#   Failed test 'Fails to get nonexistent URI and reports failure'
#   at t/back_ok.t line 59.
# STDOUT is:
# ok 1 - Try to get bad URL
# 
# not:
# not ok 1 - Try to get bad URL
# 
# as expected
# STDERR is:
# 
# not:
# /#\s+Failed\ test.*?\n?.*?at\ t\/back_ok\.t line 58.*\n?/
# 
# # 500
# 
# # Can't connect to wango.nonexistent.xx-only-testing:80 (Bad hostname 'wango.nonexistent.xx-only-testing')
# 
# as expected

#   Failed test 'And the result should be false'
#   at t/back_ok.t line 62.
t/back_ok.t ............. Failed 3/11 subtests 
t/click_ok.t ............ 1/? bind to *:13432: Address already in use at t/click_ok.t line 17
t/click_ok.t ............ ok   
t/content_contains.t .... 1/5 bind to *:13432: Address already in use at t/content_contains.t line 16
t/content_contains.t .... ok   
t/content_lacks.t ....... 1/5 bind to *:13432: Address already in use at t/content_lacks.t line 16
t/content_lacks.t ....... ok   
t/follow_link_ok.t ...... 1/5 bind to *:13432: Address already in use at t/follow_link_ok.t line 16
t/follow_link_ok.t ...... ok   
t/followable_links.t .... 1/3 bind to *:13432: Address already in use at t/followable_links.t line 16
t/followable_links.t .... ok   
t/get_ok-parms.t ........ ok     
t/get_ok.t .............. 1/11 bind to *:13432: Address already in use at t/get_ok.t line 26
t/get_ok.t .............. 8/11 
#   Failed test 'sanity check: we can't load NONEXISTENT.html'
#   at t/get_ok.t line 53.
t/get_ok.t .............. 9/11 
#   Failed test 'Fails to get nonexistent URI and reports failure'
#   at t/get_ok.t line 60.
# STDOUT is:
# ok 1 - Try to get bad URL
# 
# not:
# not ok 1 - Try to get bad URL
# 
# as expected
# STDERR is:
# 
# not:
# /#\s+Failed\ test.*?\n?.*?at\ t\/get_ok\.t line 59.*\n?/
# 
# # 500
# 
# # Can't connect to wango.nonexistent.xx-only-testing:80 (Bad hostname 'wango.nonexistent.xx-only-testing')
# 
# as expected

#   Failed test 'And the result should be false'
#   at t/get_ok.t line 63.
t/get_ok.t .............. Failed 3/11 subtests 
t/has_tag.t ............. 1/7 bind to *:13432: Address already in use at t/has_tag.t line 16
t/has_tag.t ............. ok   
t/head_ok-parms.t ....... ok     
t/head_ok.t ............. 1/11 bind to *:13432: Address already in use at t/head_ok.t line 25
t/head_ok.t ............. 8/11 
#   Failed test 'sanity check: we can't load NONEXISTENT.html'
#   at t/head_ok.t line 52.
t/head_ok.t ............. 9/11 
#   Failed test 'Fails to HEAD nonexistent URI and reports failure'
#   at t/head_ok.t line 59.
# STDOUT is:
# ok 1 - Try to HEAD bad URL
# 
# not:
# not ok 1 - Try to HEAD bad URL
# 
# as expected
# STDERR is:
# 
# not:
# /#\s+Failed\ test.*?\n?.*?at\ t\/head_ok\.t line 58.*\n?/
# 
# # 500
# 
# # Can't connect to wango.nonexistent.xx-only-testing:80 (Bad hostname 'wango.nonexistent.xx-only-testing')
# 
# as expected

#   Failed test 'And the result should be false'
#   at t/head_ok.t line 62.
Comment 1 Kent Fredric (IRC: kent\n) gentoo-dev 2010-07-19 03:55:29 UTC
Created attachment 239333 [details, diff]
DNS Resolution patch.
Comment 2 Kent Fredric (IRC: kent\n) gentoo-dev 2010-07-19 11:41:46 UTC
Created attachment 239373 [details]
dev-perl/Test-WWW-Mechanize/Test-WWW-Mechanize-1.30.ebuild

Patched ( barely ) ebuild that passes all tests on my machine.
Comment 3 Kent Fredric (IRC: kent\n) gentoo-dev 2010-09-14 13:43:38 UTC
This bug is resolved for me in WWW-Mechanize 1.66 with the smarter test code. Marked as WORKSFORME.
Comment 4 Kent Fredric (IRC: kent\n) gentoo-dev 2010-09-14 13:47:01 UTC
Er, Ignore that last one, the problem is still there, I'm just stupid. I had the same issue with WWW::Mechanize and I didn't see completely. 
Comment 5 Torsten Veller (RETIRED) gentoo-dev 2011-06-04 08:54:44 UTC
I've disabled the tests in 1.320.0.
Tests were failing for me in contrast to the "Fixed in TWM 1.31_01" message of URL :/
Comment 6 Torsten Veller (RETIRED) gentoo-dev 2012-04-14 07:51:41 UTC
(In reply to comment #5)
> I've disabled the tests in 1.320.0.

I've enable the tests in 1.400.0 again.
Comment 7 Mikle Kolyada archtester Gentoo Infrastructure gentoo-dev Security 2014-01-20 19:58:02 UTC
Should be fine now with last stable (1.730.0)