Certain tests require network access to http://example.com

Bug #1508868 reported by Domen Kožar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Kairat Kushaev

Bug Description

Following tests require networking and they actually request http://example.com

    sed -i 's/test_get_image_data_http/noop/' glance/tests/unit/common/scripts/test_scripts_utils.py
    sed -i 's/test_set_image_data_http/noop/' glance/tests/unit/common/scripts/image_import/test_main.py
    sed -i 's/test_create_image_with_nonexistent_location_url/noop/' glance/tests/unit/v1/test_api.py
    sed -i 's/test_upload_image_http_nonexistent_location_url/noop/' glance/tests/unit/v1/test_api.py

Is that intentional (that unittest actually trigger a request?).

I'm packaging OpenStack for https://nixos.org and we don't allow netowork access during testing phase.

Revision history for this message
Louis Taylor (kragniz) wrote :

Hi Domen, I'm rather excited about openstack in NixOS!

This has also been an issue in the past (see https://bugs.launchpad.net/glance/+bug/1298918), but I'm not sure people are currently looking out for these sort of things.

Changed in glance:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

> Is that intentional?

No.

Changed in glance:
assignee: nobody → Kairat Kushaev (kkushaev)
Revision history for this message
Domen Kožar (ielectric+) wrote :

Thanks. I've packaged Glance/Nova/Neutron/Keystone for NixOS (https://github.com/NixOS/nixpkgs/pull/10399), but I'm seeing transient errors even for Glance (basically all OpenStack software).

Could be a problem somewhere in test toolsing or quite some open stack packages have time-dependent tests.

See https://bugs.launchpad.net/python-neutronclient/+bug/1508547

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/238503

Changed in glance:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/238503
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=21d5657640359d6b545d87252cc383e73f6b9a1c
Submitter: Jenkins
Branch: master

commit 21d5657640359d6b545d87252cc383e73f6b9a1c
Author: kairat_kushaev <email address hidden>
Date: Thu Oct 22 16:27:49 2015 +0300

    Remove requests to example.com during unit testing

    When unit tests are launched some of these tests are attempting
    to access http://example.com. This is not convenient in case
    if somebody doesn't have an access to internet.
    In order to fix this
    - some tests in test_script_utils were deleted
      cause they tested urllib instead of glance
    - Some responses were replaced with FakeHTTPResponses
    - Some requests were redirected to local http server

    Change-Id: I66c3d67ae4bff474a4ef5a2d5469cfe04f36cdf9
    Closes-bug: #1508868

Changed in glance:
status: In Progress → Fix Committed
Changed in glance:
status: Fix Committed → 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.