[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[no subject]



On 23 January 2017 at 22:45, gregor herrmann <gregoa@debian.org> wrote:
> On Mon, 23 Jan 2017 22:45:24 +0100, Andreas Tille wrote:
>
>> > The first is from a missing dependency (Bio::ASN1::EntrezGene),
>> > which is really optional (the comp test should skip that
>> > directory). The other is from XML::Simple, which is unusual; I’m
>> > wondering whether the underlying XML parser is checking the XML
>> > schema for the test reports. Any idea what the specific XML::SAX
>> > backend parser module used was?
>>
>> Sorry, I've sended a wrong version of the log with missing
>> Build-Depends.  Please check again.
>
> The tests fail for me as well, in a chroot with networking firewalled
> off.
>
> The errors are slightly different, probably because I have http_proxy
> set:
>
> http error : Operation in progress
> XML::Simple called at /build/libbio-eutilities-perl-1.75/blib/lib/Bio/Tools/EUtilities.pm line 140.
> # Looks like your test exited with 255 before it could output anything.
> t/egquery.t .................
> 1..18
> Dubious, test returned 255 (wstat 65280, 0xff00)
> Failed 18/18 subtests
>
> etc. for all t/e*.t tests
>
> /*
> With http_proxy unset I get:
>
> http error : Unknown IO error
> http error : connection refused
> XML::Simple called at /build/libbio-eutilities-perl-1.75/blib/lib/Bio/Tools/EUtilities.pm line 140.
> # Looks like your test exited with 255 before it could output anything.
> t/egquery.t .................
> 1..18
> Dubious, test returned 255 (wstat 65280, 0xff00)
> Failed 18/18 subtests
>
> */
>
> Anyway, it's quite clear that the tests try to access the internet
> which is forbidden by Debian policy (regardless of the fact if the
> fail gracefully or not), so they have to be skipped.
>
> [...]
> Of course an upstream fix, e.g. skipping tests if
> $ENV{NETWORK_TESTING} is not set etc., would be nicer.

I have managed to replicate the issue and found that it indeed comes
from XML::Simple (which Bio::EUtilities uses to parse the cml files)
and because it tries to connect to www.ncbi.nlm.nih.gov where the DTD
is.  I setup pbuilder with a hook to drop me on the chroot where the
tests were failing to investigate as described.

The only change I did was installing iptables (I guess there must
another way to block connections but I don't know how)

Everything works fine at the start in the chroot:

    # iptables -L
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination

    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination

    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    # perl -MXML::Simple -e 'XMLin("t/data/eutils/egquery.xml"); print
"hello\n"'
    hello
    # perl -Ilib -I. t/egquery.t
    1..18
    [...]

After blocking connections to www.ncbi.nlm.nih.gov, things fail:

    # iptables -A INPUT -s 130.14.29.110 -j DROP
    # perl -MXML::Simple -e 'XMLin("t/data/eutils/egquery.xml"); print
"hello\n"'
    http error : Operation in progress
    http error : unreachable network
    XML::Simple called at -e line 1.
    # perl -Ilib -I. t/egquery.t
    1..18
    http error : Operation in progress
    http error : unreachable network
    XML::Simple called at lib/Bio/Tools/EUtilities.pm line 140.
    # Looks like your test exited with 255 before it could output anything.

And dropping the iptables rule rescues the behaviour:

    # perl -MXML::Simple -e 'XMLin("t/data/eutils/egquery.xml"); print
"hello\n"'
    hello
    # perl -Ilib -I. t/egquery.t
    1..18
    ok 1 - get_db
    [...]

Blocking the connection but removing the DOCTYPE line from the xml
file also fixes it:

    # iptables -A INPUT -s 130.14.29.110 -j DROP
    # grep -n DOCTYPE t/data/eutils/egquery.xml
    2:<!DOCTYPE Result PUBLIC "-//NLM//DTD eSearchResult, January
2004//EN" "http://www.ncbi.nlm.nih.gov/entrez/query/DTD/egquery.dtd";>
    # sed -ie '2d' t/data/eutils/egquery.xml
    # perl -MXML::Simple -e 'XMLin("t/data/eutils/egquery.xml"); print
"hello\n"'
    hello

As upstream I could inline the DTD to avoid this.  I would prefer to
avoid have them as author only tests since that would cause them to be
skipped by CPAN testers.  Any opinions?

Carnë


Reply to: