Commit Graph

26 Commits

Author SHA1 Message Date
Tobias Urdin 387671c74d Use openstack_spec_helper from zuul checkout
Change-Id: Iec5799cffd3c02b16b55e135dc85bb015bf62b49
2020-08-30 23:00:30 +02:00
ZhongShengping c73d43aa9a Move to opendev
Change-Id: Ic949ac460f66a1324b325f3ded62d041ff111166
2019-04-21 14:44:49 +08:00
ZhongShengping 810a408cae Load puppet-openstack_spec_helper locally during tests
Change-Id: I28482068e2d148b5145727cc1cc43e7953bd84d6
Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
2018-02-12 15:13:00 +00:00
Alex Schultz 8a86e501b0 Update tox configuration
Update the tox configuration to pull in the openstack
upper-constraints.txt when running releasenotes. This will
fix the releasenotes job that is currently failing due to
a new version of sphinx. Additionally this change includes
updates from puppet-modulesync-configs.

Change-Id: I212837f51e01591562fb57e4566a6c02e56c7003
2017-05-17 08:28:16 -06:00
Emilien Macchi 3052df173e Gemfile: rely on puppet-openstack_spec_helper for dependencies
Rely on puppet-openstack_spec_helper gemspec file for managing Gems
dependencies.

Change-Id: I301bb472131ba56ac05c3191fa9cddae33e999c1
2016-03-29 21:36:48 -04:00
Emilien Macchi 8ceda15976 drop mock dependency
mock is not used anywhere in the module, let's drop it.
This patch will help to hit this bug:
https://launchpad.net/bugs/1492636

Change-Id: Ide132846ecf1f1feb0a6d829002a150e1ffb6607
2016-01-22 09:54:30 -05:00
Alex Schultz 0491d085bb Add rspec-puppet-facts to the spec_helper
This change adds the rspec-puppet-facts gem to the spec helper so that
we can centralize the management of the base operating systems that we
support. rspec-puppet-facts allows us to simplify our unit tests and
provides a more complete list of Operating Systems and their associated
facts for the unit tests.  With this change we can now loop over and
test CentOS, Debian, Fedora, RedHat, and Ubuntu by simply providing a
list of supported os to rspec-puppet-facts.

Additionally this change includes a central object for managing our
supported os list for rspec-puppet-facts and providing our default facts
like os_service_default. This central object should replace the usage of
@default_facts within the unit tests for each module.

Change-Id: Idd13701ae1d3c396b9a97bb17ef0e0a02032c489
2016-01-14 20:21:48 +03:00
Emilien Macchi ee10d14987 Try to use zuul-cloner to prepare fixtures
In OpenStack Infra, we would like to run Puppet unit tests that
sometimes depends on other Puppet OpenStack modules.
Example: a patch in puppet-openstacklib that needs to be tested in puppet-nova.

This patch modifies the Rakefile to:
* clean spec_prep and spec_clean Rake tasks
* use openstack/puppet-openstack-integration/install_modules_unit.sh script
  to clone modules.
* do not use .fixtures.yaml file to clone modules and rely on
  zuul-cloner or git.
* Add openstack/ in gitignore so we never commit the
  puppet-openstack-integration repository (can happen when spec_clean
  did not run but you want to submit the patch anyway)
* Allow to run a custom Puppetfile if PUPPETFILE env is exported. It
  will allow people to test the module with the dependencies they like,
  feature we had with .fixtures.yaml.

Also add 'r10k' to Gemfile.

That way, we will be able to use zuul dependencies and run tests accross
modules like we do with functional testing.

Change-Id: I555bdeba198b1b468884ffce3702f5b06247d573
2015-10-08 15:08:52 -07:00
Sebastien Badia 9034bb2c18 Initial msync run for all Puppet OpenStack modules
This patch is the initial modulesync run, it impact:

* gitignore: just a sync between projects
* gemfile:
  - update and allow to setup facter version and gem source
  - split beaker gems with a dedicated group
  - switch to rspec-puppet 2.2.0
* rakefile:
  - use the new syntax for lint configuration
  - add a acceptance target
* acceptance:
  - sync nodesets
  - update tests in order to use zuul-cloner
* spec: added rspec coverage report

Change-Id: I481931358bff8f87b43a18c849e3b4feef36bd6a
2015-08-18 13:58:21 +02:00
Emilien Macchi b7d7799863 Use beaker-puppet_install_helper to install puppet
When running with BEAKER_provision=no, the following happens:

In Trusty: beaker is running dpkg with '--force' option so even
if Puppet is already installed, the return code will be 0.
In CentOS: beaker is running 'rpm -ivh' the second time and since
the package is already here, the return code will be 1.

Using the new puppet install helper will abort installing puppet
if BEAKER_provision is no, so tests will continue as normal.

Change-Id: I74117c30d2eae269ac3e1e578943fefbd42b55b1
Co-Authored-By: Colleen Murphy <colleen@gazlene.net>
2015-06-30 16:56:46 -04:00
Cody Herriges e0b04137d9 Sync up module with latest msync commit.
Msync commit to push all our managed modules to the default set of
  configs.  Being done for two reason: to address a helper library
  loading issue that is addressed in
  d4278834d5
  and to make all module contents consistent.

Change-Id: I747e589369a7ce187dc11c981f5d327af0cf73f5
2015-06-16 08:40:37 -07:00
Colleen Murphy 0d31b8f804 Unpin beaker-rspec
The latest version of beaker tries to manage sshd_config[1] in order to
pass through environment variables. JJB also tries to manage
sshd_config by adding Match blocks to securely allow root SSH[2]. When
beaker tries to append the PermitUserEnvironment line after the Match
blocks, SSH fails to open port 22 and beaker can't SSH in to the
node[3]. This patch unpins beaker-rspec and adds set_env: false to the
nodepool nodesets so that the set_env method is never called and does
not try to mess with the sshd_config.

[1] https://github.com/puppetlabs/beaker/blob/master/lib/beaker/host_prebuilt_steps.rb#L528
[2] http://git.openstack.org/cgit/openstack-infra/project-config/tree/jenkins/jobs/puppet-module-jobs.yaml#n42
[3] http://logs.openstack.org/61/185161/1/check/gate-puppet-nova-puppet-beaker-rspec-dsvm-centos7/cd81608/console.html.gz#_2015-05-22_22_05_46_933
[4] https://github.com/puppetlabs/beaker/blob/master/lib/beaker/host_prebuilt_steps.rb#L502

Change-Id: I48426b705732de9c310664fe7d1f5e6da82a0a5c
2015-06-08 13:45:24 -07:00
Emilien Macchi e74a84f4eb Bring Redhat support to acceptance tests
OpenStack Infra has jobs to run this on both Ubuntu Trusty and
OS7.

* Add minitest to Gemfile (dependency to run beaker on centos - see
  http://projects.theforeman.org/issues/2650 for details)
* separate nodepool files to have trusty & centos7 support in OS
* infra
* spec: add case for repo configuration and support
  RH systems.
* rabbitmq: install module from source
* apt: pin the module
* configure device_driver for LBaaS (update in Kilo)

Change-Id: If6c724243ba2e4932b1121b7b7f148d8b5a3f187
Closes-bug: #1444736
2015-05-21 12:17:34 +02:00
Emilien Macchi f0f92f5b3b Beaker tests
Implement basic structure for beaker tests.

Change-Id: I746dc7834b268fc64cd0c65b1388505ae4c20b8d
Closes-bug: #1444736
2015-05-04 13:33:46 -04:00
Emilien Macchi 3352b09895 Bump rspec-puppet to 2.1.0
rspec-puppet 2.1.0 includes Puppet 4.0 support [1].

[1] https://github.com/rodjek/rspec-puppet/commits/v2.1.0

Change-Id: Ic9c58968570b2b16e0d8ed977c12067c48b80672
2015-04-22 23:54:10 -04:00
Gael Chamoulaud ac06cb7c96 spec: updates for rspec-puppet 2.x and rspec 3.x
This patch aim to update our specs test in order to work with the
rspec-puppet release 2.0.0, in the mean time, we update rspec syntax
order to be prepared for rspec 3.x move.

In details:

 * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
 * Use shared_examples "a Puppet::Error" for puppet::error tests *
 * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x) *
 * Fix spec tests for rspec-puppet 2.0.0
 * Clean Gemfile (remove over-specificication of runtime deps of
   puppetlabs_spec_helper)

Change-Id: Ida94605916fe26dd4c5fb328f79c4e787d29dcf5
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-19 16:57:59 +01:00
Gael Chamoulaud 9c3ac6f5fe Fix metadata.json lint issues
Update license name to match a valid SPDX ID, and fix open-ended deps.
https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html

Change-Id: Ib0f2ff88b40eec33c58e9ffb39127f50608356e1
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-18 18:49:42 +01:00
Clayton O'Neill 25a5ede55b Add Puppet 4.x lint checks
This changes the puppet-lint requirement to 1.1.x, so that we can use
puppet-lint plugins.  Most of these plugins are for 4.x compat, but some
just catch common errors.

Change-Id: I44cb4ffbbc8ccd9f310240a4b1eb6fdfdb435831
2015-02-17 09:01:36 -05:00
Sebastien Badia b561004004 spec: pin rspec-puppet to 1.0.1
rspec-puppet (2.0.0) was released yesterday[1], this new version broke
puppet-openstack unit tests (undefined method `resource')[2] as talked on
and in a second time to update your specs to 2.0.0 and rspec 3.x`)

[1] 8459e14807
[2] http://logs.openstack.org/45/105245/6/check/gate-puppet-nova-puppet-unit-3.3/3682541/console.html

Change-Id: I711cc3c99565edbf4bebf9f5f36a387ebe1665c7
Partial-bug: #1417604
2015-02-03 15:32:20 +01:00
Clayton O'Neill 3379806554 Normalize Gemfile & pin tests to rspec < 2.99
Pin to rspec < 2.99 until rspec-puppet officially supports rspec 3.x.
This is to avoid warnings due to deprecated matchers in the
rspec-puppet gem.

This change is also intended to normalize the Gemfile for all stackforge
puppet modules.  This should facilitate pinning gem versions when
releasing new stable branches, since the same diff can be used for all
repos.

Change-Id: Id8595fc2fd8b4e4bec4ba60d85696983fb632a18
Partial-Bug: #1326034
2014-06-20 09:12:51 -04:00
Clayton O'Neill dd301f635a Pin tests to rspec < 2.99
Pin to rspec < 2.99 until rspec-puppet officially supports rspec 3.x.
This is to avoid warnings due to deprecated matchers in the
rspec-puppet gem.

This patch also reverts the change of be_false to be_falsey that was
temporarily required for rspec 3 compability.

Partial-Bug: #1326034
Change-Id: I1f7a754cf285c598169059e757c1a905762e2ce0
2014-06-18 16:20:26 +00:00
Lars Kellogg-Stedman f9b3d184a0 Neutron Nova Interactions Support
Recent versions of Neutron are able to provide active notifications to
Nova about changes to port status and data.  This change adds the
neutron::server::notifications class to allow Puppet to configure this
feature when setting up a Neutron server.

neutron.conf requires a tenant UUID for communicating with Nova.  This
changes adds adds a custom type and provider to translate an admin
tenant name to the required UUID.

Co-Authored-By: emilienm <emilien.macchi@enovance.com>
Change-Id: I57af7cb47a12adabed9b1ee65e1c352b3e5fc2de
Closes-bug: 1306694
2014-04-22 09:57:21 -04:00
Chris Hoge a5e7d49832 Fixed gate by Updating Gemfile to pin Rake to 10.1.1
The latest Rake update requires Ruby >= 1.9. Bundler in the
current gate uses 1.8.x. This update fixes the gate by pinning
Rake to the last known working version.

Change-Id: I40fe97eefedbb58ad5e192193511cb94a09fc19c
2014-03-24 15:37:48 -07:00
Mathieu Gagné f45be92f34 Add puppet-lint to Gemfile
Change-Id: Ic0642f90f3ab9209bfa00f37c77e7deb5d291707
2013-05-21 19:42:48 -04:00
Mathieu Gagné 610e5a24dc Replace deprecated :rubygems source
Fix deprecation warnings thrown by bundler:

  The source :rubygems is deprecated because HTTP requests are insecure.
  Please change your source to 'https://rubygems.org' if possible,
  or 'http://rubygems.org' if not.

Fixes: bug #1175767
Change-Id: I75e2f79fecac49e7e0d9a94e604368489214b7c9
2013-05-02 16:20:59 -04:00
Mathieu Gagné 4074952a96 Add rabbit_hosts parameter
Preserve rabbit_host parameter for backward compatibility.
rabbit_hosts allows the configuration of quantum with rabbit HA support.
Add rspec tests and fix various typos/bugs.
2013-04-12 18:18:11 -04:00