test for osnailyfacter url_available tries to connect to external hosts

Bug #1570969 reported by Alex Schultz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
slava valyavskiy

Bug Description

The url_available function test in osnailyfacter actually attempts to validate urls. So for hosts without connectivity this test fails. We should mock out requests to prevent external access.

https://github.com/openstack/fuel-library/blob/master/deployment/puppet/osnailyfacter/spec/functions/url_available_spec.rb

We've had several failures in CI when hosts can't reach externally.

2016-04-15 13:01:03.403 | Failures:
2016-04-15 13:01:03.403 |
2016-04-15 13:01:03.403 | 1) the structure function with single values should be able to process a single value
2016-04-15 13:01:03.403 | Failure/Error: raise Puppet::Error, "ERROR: Unable to fetch url '#{uri}', error '#{e}'. Please verify node connectivity to this URL, or remove it from the settings page if it is invalid."
2016-04-15 13:01:03.404 |
2016-04-15 13:01:03.404 | Puppet::Error:
2016-04-15 13:01:03.404 | ERROR: Unable to fetch url 'http://archive.ubuntu.com/ubuntu/', error 'execution expired'. Please verify node connectivity to this URL, or remove it from the settings page if it is invalid.
2016-04-15 13:01:03.404 | # ./lib/puppet/parser/functions/url_available.rb:95:in `rescue in fetch'
2016-04-15 13:01:03.404 | # ./lib/puppet/parser/functions/url_available.rb:83:in `fetch'
2016-04-15 13:01:03.404 | # ./lib/puppet/parser/functions/url_available.rb:112:in `block in <top (required)>'
2016-04-15 13:01:03.404 | # /home/jenkins/workspace/gate-fuel-library-puppet-unit-3.8-centos-7/.bundled_gems/gems/puppet-3.8.6/lib/puppet/parser/functions.rb:164:in `block (2 levels) in newfunction'
2016-04-15 13:01:03.404 | # /home/jenkins/workspace/gate-fuel-library-puppet-unit-3.8-centos-7/.bundled_gems/gems/puppet-3.8.6/lib/puppet/util/profiler/around_profiler.rb:58:in `profile'
2016-04-15 13:01:03.404 | # /home/jenkins/workspace/gate-fuel-library-puppet-unit-3.8-centos-7/.bundled_gems/gems/puppet-3.8.6/lib/puppet/util/profiler.rb:51:in `profile'
2016-04-15 13:01:03.404 | # /home/jenkins/workspace/gate-fuel-library-puppet-unit-3.8-centos-7/.bundled_gems/gems/puppet-3.8.6/lib/puppet/parser/functions.rb:157:in `block in newfunction'
2016-04-15 13:01:03.405 | # /home/jenkins/workspace/gate-fuel-library-puppet-unit-3.8-centos-7/.bundled_gems/gems/puppet-3.8.6/lib/puppet/parser/scope.rb:860:in `method_missing'
2016-04-15 13:01:03.405 | # ./spec/functions/url_available_spec.rb:27:in `block (3 levels) in <top (required)>'

Dmitry Klenov (dklenov)
Changed in fuel:
status: New → Confirmed
Changed in fuel:
assignee: Fuel Library Team (fuel-library) → slava valyavskiy (slava-val-al)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (master)

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

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

Reviewed: https://review.openstack.org/308083
Committed: https://git.openstack.org/cgit/openstack/fuel-library/commit/?id=c267cd0fc12d07751fe114ad70ac1b763ed13819
Submitter: Jenkins
Branch: master

commit c267cd0fc12d07751fe114ad70ac1b763ed13819
Author: slava <email address hidden>
Date: Wed Apr 20 03:02:38 2016 +0300

    Mock http requests in tests

    Change-Id: I5262e83bd4baa042abfcd87596cf8b709071d47b
    Closes-Bug: #1570969

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