Commit Graph

24 Commits

Author SHA1 Message Date
Tobias Urdin 6e4eae1770 Use openstack_spec_helper from zuul checkout
Change-Id: I9315b0d464a7ce89eb03abb0a2a250539a8252b3
2020-08-30 22:57:05 +02:00
ZhongShengping df7648cafc Move to opendev
Change-Id: Ibcef2a1096e9c1cbce3b6aa11da4c8ba39d14c09
2019-04-21 14:44:48 +08:00
ZhongShengping b18944bb27 Load puppet-openstack_spec_helper locally during tests
Change-Id: I3481a4615312c4c8f9440e9beb35120be46e7e05
Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
2018-02-12 10:53:36 +08:00
Alex Schultz 2889c8d617 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: Ie379443f911e4c010437d2d42b50d890b2e53b8b
2017-05-17 08:25:26 -06:00
Emilien Macchi 648ded372b Gemfile: rely on puppet-openstack_spec_helper for dependencies
Rely on puppet-openstack_spec_helper gemspec file for managing Gems
dependencies.

Change-Id: I60eb604764690921e571cc6a52d94a532ac5854a
2016-03-29 21:36:19 -04:00
Emilien Macchi 5b938affec 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: I227fb1c5203a90d3929d99042e543d3ecc8590ee
2016-01-22 09:45:34 -05:00
Alex Schultz ae2e7760b3 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: If05b890b9d1b60a4f0561f35e525259e66895360
2016-01-14 18:52:27 +03:00
Emilien Macchi 6e52509101 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: If983dae0260ea2a1df49b4bdb0ada3c5223012c9
2015-10-08 14:54:10 -07:00
Cody Herriges 4fa9985f2a 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: Ib75add2af3380d0b1d4ce320b58df22b6c3ffa57
2015-08-18 14:37:18 +02:00
Emilien Macchi 9d0bd501db 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: I0a1fb7df6bcc7deb611f37e12ecf8bc2f7a8c9dc
Co-Authored-By: Colleen Murphy <colleen@gazlene.net>
2015-06-30 16:53:17 -04:00
Colleen Murphy 2aaab3d4d5 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: I4064e8fe27eb2a2c2be6d8437ce7f97709529b45
2015-06-08 13:43:51 -07:00
Emilien Macchi 01004884a1 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
* heat encryption key parameter: use a valid length for the key

Change-Id: If9820a65f1310fe85ff43b32468b746268c04ea0
Closes-bug: #1444736
2015-05-14 13:20:13 -04:00
Emilien Macchi 2eaa030fe8 Beaker tests
Implement basic structure for beaker tests.

Change-Id: I2824af6868222b1c31b2031194a956308ec1b4b6
Closes-bug: #1444736
2015-05-01 17:36:34 -04:00
Emilien Macchi 32fe930012 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: Id85ab649da7d1d75076404d77ec4e7bfe165c38f
2015-04-22 23:49:35 -04:00
Sebastien Badia 44e1bbf039 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: If5f03538be85cee4a1d3b4c9a87eae1230432114
2015-03-02 13:54:32 +01:00
Sebastien Badia d7e9fe0e7a 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)
  * Remove un-used puppet-lint (name_containing_dash config)

Change-Id: I1b82e4f6ec0b1bbf52e86c5d127413a26277ae8c
Card: https://trello.com/c/eHXc1Ryd/4-investigate-the-necessary-change-to-be-rspec-puppet-2-0-0-compliant
2015-03-02 13:54:32 +01:00
Sebastien Badia 3d32a5289b 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: If038d97ca2e0fb6701de7f3c47b5800356aa423d
Partial-bug: #1417604
2015-02-03 15:32:20 +01:00
Jenkins 50ae53a95b Merge "Implement Keystone domain creation" 2014-12-23 03:26:21 +00:00
Gael Chamoulaud 45a35dc2ec Add puppet-lint-param-docs plugins to puppet-lint
- This puppet-lint plugin checks if all parameters are documented
- Fix some unaligned arrows
- https://github.com/domcleal/puppet-lint-param-docs

Change-Id: I5e73747b726191bc4fc55e6e227892507e185871
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2014-11-13 12:42:40 +01:00
Martin Magr 41608dc6c8 Implement Keystone domain creation
Keystone domain has to be created for Heat. This patch implements this
via helper script [1] since we don't have support for Keystone v3 API
in puppet-keystone yet. This implementation should be refactored as soon
as we will have v3 API available in puppet-keystone. For more info
please check [2].

[1] https://github.com/openstack/heat/blob/master/bin/heat-keystone-setup-domain
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1076172

Change-Id: I036a84eee6b9d0afa9a9ed96849494324ba4c4db
2014-09-18 12:27:20 +02:00
Chris Hoge 4728af770d 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: I8a2c9ff2b33d7fda7818d063fd5a855284aaf089
2014-03-24 15:32:25 -07:00
Mathieu Gagné ddbfc1e7a5 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.

Change-Id: I63d0497d96a210ac9b6e01a9f0bd4fb4b4f14d9f
2013-08-02 12:21:49 -04:00
Francesco Vollero cfb2d06175 Added puppet-lint to Gemfile 2013-07-22 18:18:04 +02:00
Émilien Macchi b63a40b030 Basic structure + DB + Client support 2013-05-30 15:20:11 +02:00