Commit Graph

20 Commits

Author SHA1 Message Date
Tobias Urdin e1951ebe8c Use openstack_spec_helper from zuul checkout
Change-Id: Idba1ab07dcba24d5662f46d00acbac531c6cbab2
2020-08-30 22:57:45 +02:00
ZhongShengping d38cd7c3d0 Move to opendev
Change-Id: If09bb551ac4fe334ebc9285abe99cf98ef04f1ab
2019-04-22 08:54:01 +08:00
ZhongShengping 4f1de31adc Load puppet-openstack_spec_helper locally during tests
Change-Id: I5361f520c035870a4c5b07b12d2b0c15e7ed90ee
Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
2018-02-12 10:53:36 +08:00
Alex Schultz e36254ad6d 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: I9c4482dfde0928829d0f7976ddddadaa37c81b20
2017-05-17 08:26:13 -06:00
Emilien Macchi e28d585b49 Gemfile: rely on puppet-openstack_spec_helper for dependencies
Rely on puppet-openstack_spec_helper gemspec file for managing Gems
dependencies.

Change-Id: I72f77ac3f57cfec4a86e22417874e1e463315d6c
2016-03-30 16:36:29 -04:00
Alex Schultz 4dd2bff699 Fix duplicate parameters and drop mock
This change removes the duplicate parameters from the main ironic class.
With the update to 3.8.5, this now shows up as a syntax error in the
syntax jobs. We should only define these parameters once.

Also 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: Iaa6acafdc771118c74f85f3332f01b58d233743b
Closes-Bug: #1537251
Co-Authored-By: Emilien Macchi <emilien@redhat.com>
2016-01-23 09:42:57 -07:00
Alex Schultz e502288176 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: I009ff5c65c90e2d88c2c8cfdbdf9faef951fedbd
2016-01-14 20:28:51 +03:00
Emilien Macchi faba2b9163 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: I42fb3d11d65e261bd5fb0ccb757a68965699a693
2015-10-08 14:58:58 -07:00
Cody Herriges 5e258816b2 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: I036b24b059b2ac8af1e984db4ce88602b530586c
2015-08-06 20:39:29 +02:00
Colleen Murphy 4ef5ff1f4d 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: I366f6b607e348d2fdd1fd59afbbe4908f485aab3
2015-07-07 13:52:49 -07:00
Colleen Murphy 34ffde4902 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: I867012fd6296aff407683250a2f65334a6be0e99
2015-06-08 13:53:44 -07:00
Emilien Macchi 78e0dc117e 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 run tests on RH, packages are not ready yet

Change-Id: I45d9cbd30c414abd7fc9f6cfc100b30430273318
Closes-bug: #1444736
2015-05-14 14:36:55 -04:00
Emilien Macchi 0c859d8fc9 Beaker tests
Implement basic structure for beaker tests.

Change-Id: I83014943b8d7c8dcf94835dc6c364aea68a35a88
Closes-bug: #1444736
2015-05-04 15:28:18 -04:00
Emilien Macchi 0957f83d54 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: Ie6445bdb9433b343c104d0ff69744319bb9a27b4
2015-04-22 23:52:11 -04:00
Gael Chamoulaud f1ca7eb98a 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
 * 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: Iabbf445ef82037dcf2ece0477f3c82d449ac689a
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-24 17:34:33 +00:00
Gael Chamoulaud 1b44b7d826 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: Ic47d53384592637dd27c3d0851fe24861ee1ed81
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-20 17:15:32 +01:00
Gael Chamoulaud ed805386c3 Fix metadata.json lint issues
Update license name to match a valid SPDX ID.
https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html

Change-Id: I3f488928da7f2120d6a750121d7343a948bfb00d
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-20 15:02:11 +01:00
Sebastien Badia 6733465482 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: I4789fcf8280e724853faf8f0140de673e5a92841
Partial-bug: #1417604
2015-02-03 15:32:20 +01:00
Clayton O'Neill 4dc53fd12b 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.

This also removes the Gemfile.lock, since this is the only stackforge
puppet module that has one.

Change-Id: I2f55a7a5339c177e3c1d19a9e165b5c5fe602d4c
Partial-Bug: #1326034
2014-06-20 09:15:22 -04:00
Emilien Macchi e5b4e458ab First commit with basic manifests
Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
2013-11-25 20:59:48 +01:00