unit tests fail due to missing fact for apache

Bug #1651522 reported by Alex Schultz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-mistral
Fix Released
Undecided
zhouxing
puppet-nova
Fix Released
High
Alex Schultz

Bug Description

The nova wsgi unit tests are failing under puppet 4 due to a missing operatingsystem fact for the wsgi module which is being used by apache.

2016-12-20 15:50:31.609607 | 1) nova::wsgi::apache on RedHat platforms configures apache serving nova with mod_wsgi should contain Service[httpd] with name => "httpd"
2016-12-20 15:50:31.609678 | Failure/Error: it { is_expected.to contain_service('httpd').with_name(platform_parameters[:httpd_service_name]) }
2016-12-20 15:50:31.609705 |
2016-12-20 15:50:31.609735 | Puppet::PreformattedError:
2016-12-20 15:50:31.609925 | Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. at /home/jenkins/workspace/gate-puppet-nova-puppet-unit-4.5-centos-7/spec/fixtures/modules/apache/manifests/mod.pp:53:48 at /home/jenkins/workspace/gate-puppet-nova-puppet-unit-4.5-centos-7/spec/fixtures/modules/apache/manifests/mod/wsgi.pp:24 on node centos-7-infracloud-vanilla-6304687
2016-12-20 15:50:31.610008 | Shared Example Group: "apache serving nova with mod_wsgi" called from ./spec/classes/nova_wsgi_apache_spec.rb:151

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

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

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

Reviewed: https://review.openstack.org/413181
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=7b897406aa8beb42286112385eb40990cc0561ac
Submitter: Jenkins
Branch: master

commit 7b897406aa8beb42286112385eb40990cc0561ac
Author: Alex Schultz <email address hidden>
Date: Tue Dec 20 10:06:47 2016 -0700

    Switch wsgi test to use rspec-puppet-facts

    The apache module expects the operatingsystem fact to be set and because
    the wsgi tests were not using rspec-puppet-facts the missing fact is
    causing failures. This change switches the wsgi test to leverage
    rspec-puppet-facts to ensure all the basic facts are being provided to
    resolve the unit test failures.

    Change-Id: Ic5d9bd9939ad153d92af2480742506c92acda2c6
    Closes-Bug: #1651522

Changed in puppet-nova:
status: In Progress → Fix Released
zhouxing (melodyzhou)
Changed in puppet-mistral:
assignee: nobody → zhouxing (melodyzhou)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to puppet-mistral (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/413603

Revision history for this message
zhouxing (melodyzhou) wrote :

i git clone puppet-nova code from review.openstack.org gerrit, and directly run spec on centos7, raise error:

Failures:

  1) nova::api on centos-7-x86_64 behaves like nova-api when running nova API in wsgi compute, and enabling metadata enable nova API service
     Failure/Error:
       is_expected.to contain_service('nova-api').with(
         :ensure => 'running',
         :name => platform_params[:nova_api_service],
         :enable => true,
         :tag => 'nova-service',
       )

     Puppet::PreformattedError:
       Evaluation Error: Error while evaluating a Function Call, Could not find class ::apache for puppet at line 1:1 on node puppet
     Shared Example Group: "nova-api" called from ./spec/classes/nova_api_spec.rb:363

may be also facts error.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to puppet-mistral (master)

Reviewed: https://review.openstack.org/413603
Committed: https://git.openstack.org/cgit/openstack/puppet-mistral/commit/?id=fe1385bef994ab5a9d60ca2784a6e96a793abf84
Submitter: Jenkins
Branch: master

commit fe1385bef994ab5a9d60ca2784a6e96a793abf84
Author: Xing Zhou <email address hidden>
Date: Wed Dec 21 20:42:07 2016 +0800

    Switch wsgi test to use rspec-puppet-facts

    The apache module expects the operatingsystem fact to be set and because
    the wsgi tests were not using rspec-puppet-facts the missing fact is
    causing failures. This change switches the wsgi test to leverage
    rspec-puppet-facts to ensure all the basic facts are being provided to
    resolve the unit test failures.

    Change-Id: Ief0e3889549cdd462758af0fee9e6d7b5aebc332
    Related-Bug: #1651522

zhouxing (melodyzhou)
Changed in puppet-mistral:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-nova 10.2.0

This issue was fixed in the openstack/puppet-nova 10.2.0 release.

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.