Autopkgtest failure with HTTP proxy

Bug #1953344 reported by Olivier Gayot
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libwww-mechanize-shell-perl (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hello,

Autopktest is failing for libwww-machanize-shell-perl.
Since it is a reverse dependency of libwww-perl, the latter is blocked on proposed migration (jammy).
https://autopkgtest.ubuntu.com/results/autopkgtest-jammy/jammy/amd64/libw/libwww-mechanize-shell-perl/20211206_012815_4c3bd@/log.gz

The tests that fail are meant to execute HTTP queries to the loopback interface, for instance:

# get http://[::1]:49619/basic_auth/foo/bar
[...]
not ok 1 - Request without credentials gives 401

# Failed test 'Request without credentials gives 401'
# at t/13-command-au.t line 39.
# got: '503'
# expected: '401'
# Page location : http://[::1]:49619/basic_auth/foo/bar
# get http://[::1]:49619/basic_auth/foo/bar
not ok 2 - Wrong password still results in a 401

The issue seems to be caused by the HTTP proxy that is passed in the environment when running autopkgtest. Although we define a no_proxy variable that includes some of the addresses/hostnames of the loopback interface, it does not contain the IPv6 loopback address i.e., ::1 being used here.

no_proxy=127.0.0.1,127.0.1.1,localhost,localdomain[...]

Debian does not have the issue. They seem to run autopkgtest without a proxy.

Some of the tests from the upstream include the following directive, which unsets the HTTP proxy variables when running the tests:

delete @ENV{qw(HTTP_PROXY http_proxy CGI_HTTP_PROXY)};

The tests that fail don't have this directive. I suggest to add the directive for all tests that query a local HTTP server.

Thanks,
Olivier

Revision history for this message
Olivier Gayot (ogayot) wrote :
Changed in libwww-mechanize-shell-perl (Ubuntu):
assignee: nobody → Olivier Gayot (ogayot)
assignee: Olivier Gayot (ogayot) → nobody
status: New → In Progress
Revision history for this message
Olivier Gayot (ogayot) wrote :

Attaching debdiff.
The patch unsets the HTTP-proxy related variables for tests that use local HTTP server.

Test procedure run on my end
Without the patch:
$ pull-lp-source --distro ubuntu --pull source libwww-mechanize-shell-perl jammy
$ autopkgtest libwww-mechanize-shell-perl-0.59/ \
  --no-built-binaries \
  --apt-pocket proposed \
  --apt-upgrade \
  --env=http_proxy=http://localhost:1234 \
  -- schroot jammy-amd64
> autodep8-perl-build-deps FAIL non-zero exit status 1

With the patch:
$ pull-lp-source --distro ubuntu --pull source libwww-mechanize-shell-perl jammy
$ debdiff-apply < 1-0.59-1.1.debdiff libwww-mechanize-shell-perl-0.59/
$ autopkgtest libwww-mechanize-shell-perl-0.59/ \
  --no-built-binaries \
  --apt-pocket proposed \
  --apt-upgrade \
  --env=http_proxy=http://localhost:1234 \
  -- schroot jammy-amd64
> autodep8-perl-build-deps PASS

Thanks,
Olivier

Revision history for this message
Olivier Gayot (ogayot) wrote :

Uploading new debdiff with the following changes:

* Updated Maintainer to Ubuntu Developers
* Changed version number from 0.59-1.1 (NMU / Debian specific) to 0.59-1ubuntu1.
* Mentioned LP bug in the changelog.

Tests rerun with new debdiff.

Revision history for this message
gregor herrmann (gregoa) wrote : Re: [Pkg-perl-maintainers] [Bug 1953344] Re: Autopkgtest failure with HTTP proxy

On Mon, 06 Dec 2021 15:45:36 -0000, Olivier Gayot wrote:

> ** Patch added: "2-0.59-1ubuntu1.debdiff"
> https://bugs.launchpad.net/ubuntu/+source/libwww-mechanize-shell-perl/+bug/1953344/+attachment/5545722/+files/2-0.59-1ubuntu1.debdiff

Thanks, applied in Debian and forwarded upstream.

Cheers,
gregor

--
 .''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
 `. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `- NP: The Eagles: Heartache Tonight

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libwww-mechanize-shell-perl - 0.59-2

---------------
libwww-mechanize-shell-perl (0.59-2) unstable; urgency=medium

  [ Debian Janitor ]
  * Bump debhelper from old 12 to 13.
  * Update standards version to 4.5.1, no changes needed.

  [ Olivier Gayot ]
  * Unset HTTP proxy environment variables when running tests against
    local HTTP server. (LP: #1953344)

  [ gregor herrmann ]
  * Drop http_proxy handling from debian/rules.
  * Update years of packaging copyright.
  * Declare compliance with Debian Policy 4.6.0.

 -- gregor herrmann <email address hidden> Mon, 06 Dec 2021 19:04:16 +0100

Changed in libwww-mechanize-shell-perl (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.