21 Commits

Author SHA1 Message Date
ZhongShengping
9aca38c0e3 Load puppet-openstack_spec_helper locally during tests
Change-Id: I2d449b714764236a84d2df9f1733e375ce964ffb
Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
2018-02-12 10:53:38 +08:00
Alex Schultz
f7d43fd832 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: I5e38f9490f06e189c60e1ddb390f2eed5e2e7889
2017-05-17 08:30:11 -06:00
Emilien Macchi
4c9d173197 Gemfile: rely on puppet-openstack_spec_helper for dependencies
Rely on puppet-openstack_spec_helper gemspec file for managing Gems
dependencies.

Change-Id: I819370f2f46a36baa4971c7c1f971405a7bc0770
2016-03-29 21:37:06 -04:00
Emilien Macchi
8d374c39a2 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: I9a131fb79ba112a5dc1b774e31c5b5381d46d2ee
2016-01-22 09:58:49 -05:00
Alex Schultz
b04e0dbd6e 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: Id2b35992bfe360a12412652270c738423f857906
2016-01-14 20:09:51 +03:00
Emilien Macchi
fcb34662d8 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: I4a2926f2a80eab35a654400b1f451b5b8ee3e869
2015-10-08 15:11:36 -07:00
Cody Herriges
4fe3a9e5bd 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: I9a858f29644b3519d5b19fb9a0c45589968537ef
2015-08-18 14:33:53 +02:00
Colleen Murphy
b4f3e89ed9 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: I2cb734defce21ed1709e80bd0f0b0d965b772a9d
2015-07-07 14:58:00 -07:00
Colleen Murphy
2f76f651b2 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: I66f40027265fabf3868398213d72e40d62880004
2015-06-08 13:46:47 -07:00
Martin Mágr
d0de990f92 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
* rabbitmq_spec: add support for RH systems.
* mysql_spec: removed .my.cnf dependency

Change-Id: Ic4864e6e1a23a09057a332b6b6536e4ef4e3af00
Closes-bug: #1444736
2015-05-22 16:58:15 +02:00
Jenkins
b7657a4bd3 Merge "Beaker tests" 2015-04-27 16:20:32 +00:00
Emilien Macchi
0110075f44 Beaker tests
Implement basic structure for beaker tests.
Closes-bug: #1444736

Change-Id: I4921d84012b9b2a8cd4b676769ca025da4d8bd6d
2015-04-24 18:19:29 -04:00
Emilien Macchi
c614b04b90 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: Id8d45ac880cddb7bb91112fd047602e4dfcb1c6c
2015-04-22 23:55:38 -04:00
Gael Chamoulaud
3fa6399cad 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: Ice356e35a65204a62e47f49dd4f5816208a6dace
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-31 12:13:33 +02:00
Gael Chamoulaud
62cdb1ae91 Add puppet-lint-param-docs plugins to puppet-lint
- This puppet-lint plugin checks if all parameters are documented
- Fix all the undocumented parameters.

Change-Id: I2f24ebc7c1493572f0e638da3b7a9dc73784a8aa
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-31 12:08:46 +02:00
Gael Chamoulaud
65d88bb1eb 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: Ia6697eba8318a81dcf489ffd02316cb1b0ec6f0f
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-31 12:06:02 +02:00
Gael Chamoulaud
b5c7a00f01 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: I4f96d4dc285bd6aa0ae5e4294ccd730cc4ee5c45
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-31 12:04:50 +02:00
Colleen Murphy
ed58789665 Move openstackclient parent provider to openstacklib
This patch abandons the use of the Aviator library for interacting with
the openstack APIs in favor of the universal openstack client[1]. This
work has already been implemented in the keystone module. This patch
moves that work into openstacklib in order to make it available for the
other modules.

[1] https://wiki.openstack.org/wiki/OpenStackClient

Change-Id: I68705c28955a54e26d98f1de718016691c64e4b1
2015-03-05 11:39:19 -08:00
Sebastien Badia
b7d3c8eaaf 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: I5517a8c21acfb879a8210487748d8f2d049d0b9d
Partial-bug: #1417604
2015-02-03 15:32:20 +01:00
Colleen Murphy
612fa7e121 Implement base aviator provider
This patch adds a dependency on the aimonb/aviator module and adds
functionality to support interactions with the OpenStack services' API
via aviator.

The patch adds a parent provider that is intended for other providers
to inherit from. The parent provider has methods to authenticate to
openstack services, create session objects, and make requests. The
authenticate method can accept credentials as an argument hash or infer
credentials from the environment.

It also adds a stub type parameter that allows types to incorporate
basic parameters they need in order to support using aviator.

Change-Id: I56b0d07ae8f4738037eda486b75a0f6e24fe80e7
Implements: blueprint use-aviator-in-module-resources
2014-09-30 21:01:28 -07:00
Colleen Murphy
474a3bbabe Create basic module structure with required files
Change-Id: I9984ffa0e5f0fa379fae559b44457c34fa10ccd2
2014-07-01 08:37:43 -07:00