Commit Graph

21 Commits

Author SHA1 Message Date
Tobias Urdin bfe8eba051 Use openstack_spec_helper from zuul checkout
Change-Id: I891936c8504087192e0f9ed73545688f390d15df
2020-08-30 22:54:47 +02:00
ZhongShengping 4b11aa42aa Move to opendev
Change-Id: I1a6f467fdd253e2868520776441ccd4f395e5479
2019-04-21 14:44:48 +08:00
ZhongShengping 1b36ffa493 Load puppet-openstack_spec_helper locally during tests
Change-Id: Ic457f708c58e2c019b8c2b15dd6187d72403ae9d
Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
2018-02-12 10:53:35 +08:00
Alex Schultz a1c79a54b3 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: I0b6c659900ffef06c83a262ec8eb0ebe37b1b51a
2017-05-17 08:22:50 -06:00
Emilien Macchi 19e1debd12 Gemfile: rely on puppet-openstack_spec_helper for dependencies
Rely on puppet-openstack_spec_helper gemspec file for managing Gems
dependencies.

Depends-On: Iaf01f0aed5a34fb83a27678e7e8bb4d2a84d6428
Change-Id: Ib2fd3b2c69d3dad6a8301393e83975b640f5425f
2016-03-30 11:44:34 -04:00
Emilien Macchi ec9f7d095e 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: I067f8c327635880c0fe46fc66c4c515f99070ff0
2016-01-22 09:34:03 -05:00
Alex Schultz a337e0188d 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: I2c34915be8cdb376d1120cc70f1d12454561f0af
2016-01-14 21:21:14 +03:00
Emilien Macchi aa16baf9a4 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: Ie8f0709bf360d9c4af2559b3278f26cd2cb191f5
Depends-On: I228683aea1a8def46eaac63704e41617ba892438
2015-10-09 17:25:32 +00:00
Cody Herriges 9948a9b252 Initial msync run for all Puppet OpenStack modules
This patch is the initial modulesync run, its 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
* spec: added rspec coverage report

Change-Id: If1902135ecb45e84d25d5b6ddd5698dd98c87646
2015-08-06 20:41:13 +02:00
Emilien Macchi 624d58dec6 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: If77faa655f1831a7c9ad2c8d5c42ea712a4b651d
Co-Authored-By: Colleen Murphy <colleen@gazlene.net>
2015-06-30 16:50:56 -04:00
Colleen Murphy 7d0a36f79e 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: I69f7cfe293fa26a8bd43aef2af898db262872bc7
2015-06-19 14:30:52 +00:00
Emilien Macchi bee3621298 Bring Redhat support to acceptance tests
OpenStack Infra has jobs to run this on both Ubuntu Trusty and CentOS7.

* 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
* don't try to install designate on centos (packaging not ready)

Change-Id: I687e6b274938d622860063cb1a2494f0e7f4635f
Closes-bug: #1444736
2015-05-14 13:18:35 -04:00
Emilien Macchi d6e7965bc1 Beaker tests
Implement basic structure for beaker tests.

Change-Id: I8b5db1c81dd5816080617ea2c773574312b3d23d
Closes-bug: #1444736
2015-05-01 17:28:47 -04:00
Emilien Macchi f8ab42bc8a 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: Ic767e9cab6cee5d72df9d05199603198f41eb3ba
2015-04-22 23:47:02 -04:00
Sebastien Badia 7e3ab60b8a Fix metadata lint issues and aligning Gemfile with other projects
Update license name to match a valid SPDX ID, and fix open-ended deps.
https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html
This commit also clean gemfile in order to aligning with other projects

Change-Id: Icf1547cc521c6cfa20cdb0f644cb5712efe45718
2015-02-25 04:27:00 +01:00
Clayton O'Neill 11151dfa75 Aligning Gemfile with other projects
Part of the Trello card to align all Gemfile puppet-lint configuration.
https://trello.com/c/tC7ZhPtN

Change-Id: Ifbdcc33e36c1180f562529cbc10b3c40be461b30
2015-02-19 16:34:26 -05:00
Clayton O'Neill c0650b1d7b Add puppet-lint param docs check
This ensures that all parameters are documented and includes fixes to
existing undocumented parameters or incorrectly formatted docs.

Change-Id: I14c093214e45ad3b14123e16ee8ccf309ba45978
2015-02-17 16:03:46 +00:00
Clayton O'Neill 4ce3c0558b 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: I3b16baf063746024cb8dc89a931dae2f604258f6
2015-02-17 14:53:22 +00:00
Sebastien Badia 8be5919026 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: I5c2422e70dd081fc0b37485c263291c0f47942df
Partial-bug: #1417604
2015-02-03 15:32:20 +01:00
Clayton O'Neill 060a01db1a 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: I0354bbbe4b55ff31d373c73a76abf1c39312257e
Partial-Bug: #1326034
2014-06-20 09:14:36 -04:00
Xingchao Yu 709728b1a8 Add README and related files 2013-10-15 11:16:23 +08:00