Commit Graph

25 Commits

Author SHA1 Message Date
Tobias Urdin c90097ce5a Use openstack_spec_helper from zuul checkout
Change-Id: I5c04e7f8c7a6d5964ba71e92e6863bc17794a4a1
2020-08-30 22:54:05 +02:00
ZhongShengping 268fa768d2 Move to opendev
Change-Id: If8ad86483c7a27630bc8f5e3f0718a2eded72a6d
2019-04-21 14:44:48 +08:00
ZhongShengping f3a6830e5c Load puppet-openstack_spec_helper locally during tests
Change-Id: I45b92db459f47b11439b97e0e7a5539942137e14
Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
2018-02-12 10:53:34 +08:00
Alex Schultz 2ec8284d63 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: Ic78a2f24efa4b43e5ce17014dfb9ad0923a2442c
2017-05-17 08:21:58 -06:00
Emilien Macchi d5ec471beb 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: I6b7a60528112de6abe7411a23b60baad484c5c7e
2016-03-30 11:44:18 -04:00
Emilien Macchi 1e8792f748 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: I9ff26afd08e14544ed7d9fa0b5bd51ca19fb96b9
2016-01-22 09:33:25 -05:00
Denis Egorenko 688e2b0847 Use openstack spec helper for spec defaults
* Add puppet-openstack_spec_helper to Gemfile
* Use puppet-openstack_spec_helper/defaults in spec_helper
* Delete spec/defaults.rb, useless now

Change-Id: I8c2fd0e6a75984276b29b93357cc4d22abf4b9f4
2016-01-14 21:08:28 +03:00
Alex Schultz b8967f3ec4 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: Id6357ffb1a47ea78760e4af181da3797d7ec8fe8
2016-01-08 09:57:50 -07:00
Emilien Macchi e9a95581dd 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: Iadcef8079efb8c94282c5cdefb91bfa3920f3919
2015-10-09 17:53:16 +02:00
Cody Herriges 8a2dc3c2f2 Initial msync run for all Puppet OpenStack modules
This patch is the initial modulesync run, it impacts:

* 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: Idd56a02fda7d7d84cf1a3711e6c233c3d9e2d053
2015-08-06 20:42:33 +02:00
Emilien Macchi 488a6bf0b9 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: I7775e4ad2ce2fa83c034b36c0b0921fc2ab538ba
Co-Authored-By: Colleen Murphy <colleen@gazlene.net>
2015-06-30 16:49:27 -04:00
Colleen Murphy 8bf7756ee1 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: If45543eeda29b2bd53c6370956012c348ca40f3e
2015-06-08 13:04:30 -07:00
Emilien Macchi 4b95903f09 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
* basic_keystone_spec: add case for repo configuration and support
  RH systems.
* rabbitmq: install module from source
* apt: pin the module

Change-Id: Idb91dd3d3599a4bea9a106d09be2f41052fb3cca
Closes-bug: #1444736
2015-05-14 09:11:56 -04:00
Emilien Macchi 4d8736b1f7 Clean Gemfile: drop rspec-puppet and rake
Both of rspec-puppet and rake get pulled in by puppetlabs_spec_helper
so there is no need to keep them in the Gemfile.

Change-Id: I6eec0cd69b34689db1b3adbe48cca43874cc7d9d
2015-05-06 11:56:08 -04:00
Emilien Macchi e09f3c41ab Beaker tests
Implement basic structure for beaker tests.

Change-Id: I95445fa177ee09bffdcfb9b06df78fe91a4892b5
Closes-bug: #1444736
2015-05-04 22:14:28 -04:00
Emilien Macchi 9bb2361d4b 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: Ie69446936b46b30694391927e36b75cfdcf488ea
2015-04-22 23:45:06 -04:00
Sebastien Badia 4224fdd12e 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
in order to be prepared for rspec 3.x move.

In details:

  * 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
  * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
  * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper)

Change-Id: Id5b428fb518f40cf92cd27078d36f19b6d60226b
Card: https://trello.com/c/eHXc1Ryd/4-investigate-the-necessary-change-to-be-rspec-puppet-2-0-0-compliant
2015-03-11 17:58:49 +01:00
Clayton O'Neill 6c47d9f4bc 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: I6a4e08d91f8cc19eb1e59af03a2a7d14716ddc38
2015-02-21 12:09:04 +01:00
Sebastien Badia 155017859a 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: I1ceae5bc5232d859a11c87a567a2456acf3c8be8
Partial-bug: #1417604
2015-02-03 15:32:20 +01:00
Gael Chamoulaud 7e5cd1d265 Add puppet-lint-param-docs plugins to puppet-lint
- This puppet-lint plugin checks if all parameters are documented\
- Fix some unaligned arrows
- Remove trailing whitespace!
- Add missing doc
- https://github.com/domcleal/puppet-lint-param-docs

Change-Id: I8f089eceb3ce3532d763807e5e412d1cc1d07b6b
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2014-12-02 09:32:19 +01:00
Clayton O'Neill 2553e6d1b2 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: I8870d6cb3a1a895aac53ec3c096c413a52d02d19
Partial-Bug: #1326034
2014-06-20 09:14:20 -04:00
Chris Hoge 9b9e216802 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: I7b4495364221fbe99e2212df75772a5853f4cbac
2014-03-24 15:31:20 -07:00
Mathieu Gagné 64bb46a3cc Add puppet-lint to Gemfile
Change-Id: I256918c7fc083ca621f75ccb73ad76fd4005063d
2013-05-09 18:06:58 -04:00
Mathieu Gagné 3d8e1c0e9e 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: Idb85b842a0c147ec2eec688061bc4ec81f1372f8
2013-05-02 16:20:06 -04:00
William Van Hevelingen 009d708270 Add ruby19 and puppet3 to travis matrix 2013-02-09 02:33:28 -08:00