13 Commits

Author SHA1 Message Date
Alex Schultz
7fd6288cdf Move rspec-puppet-facts to spec helper
This change updates the module to use the rspec-puppet-facts as defined
in the puppet-openstack_spec_helper.

Change-Id: I417934616be717d1b357bf8c16a029b75f439c2b
2016-09-30 14:03:24 -06:00
Denis Egorenko
08ee5866a6 Use OpenstackClient for nova providers auth
This patch changes the nova providers to use puppet-openstacklib's
authentication methods, which use python-openstackclient as an interface,
instead of the nova command line client.

The benefits of this is a code reduction. This patch reduces the amount
of code in the nova parent provider and nova providers by reusing code from
Puppet::Provider::Openstack instead of implementing authentication,
retries, and response parsing in the provider.

This patch doesn't affect next providers:

 * nova_network and nova_floating:
   openstack client has small functionality for managing nova floatings
   and doesn't provide possibility to manage nova-networks,
   so keeping old format of auth for this providers.
   Also Nova-Network is deprecated.
 * nova_cell:
   openstack client doesn't provide possibility to manage cells;
 * nova security groups - will be done in separate patch;

Additional reasoning for this change is in the blueprint.

Also added new tests for providers.

blueprint use-openstackclient-in-module-resources

Change-Id: Ifa09aeb71ba0bcc425eece314803a0d1609bed9f
2016-03-22 18:42:40 +03:00
Emilien Macchi
68421d782b 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: I2e7f4fafded59db7e4810d943f6de68394e9c98e
2016-01-22 09:55:59 -05:00
Denis Egorenko
238d880e9b 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: I8110efa360070060d3321dbf05b69f0756891dcc
2016-01-14 21:01:51 +03:00
Alex Schultz
cdfddf82bc 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: I5e91cec849886e5320e1e2a264af66c5b8bfe95c
2016-01-08 16:02:58 -07:00
Iury Gregory Melo Ferreira
2a4e110a7e Switch Nova to $::os_service_default - Part1
Switch Nova to use $::os_service_default
Change logging.pp, db.pp and tests.

Change-Id: I928a93534c6d27c020b7afb5b7dda32c379e9d62
Related-bug: #1515273
2015-12-01 12:31:22 +00:00
Cody Herriges
e7444b9a14 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: If5a69a08a8599acb66cf97d2f1d1b1610ea67a82
2015-08-18 14:21:06 +02:00
Gael Chamoulaud
a5dcd4d34c Add rspec coverage output
- This checks which Puppet resources have been explicitly checked as
  part of the current test run and outputs both a coverage percentage
  and a list of untouched resources.

Change-Id: Ie273f5e4f3bbeb8dac52ab8ba5f09c5145a231c1
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-04-07 12:12:14 +02:00
Mathieu Gagné
baeb98d5f8 Cleanup rspec tests of nova::compute::libvirt
Change-Id: Ie410ac8f2fc2d0ebd9e79a869f51e9b7bb315a6e
2014-01-31 10:34:41 -05:00
Emilien Macchi
75453a40fc Add Nova Cells support
Bring nova-cells support into puppet-nova.

Cells is a feature introduced in Grizzly and improved in Havana.
This patch configures nodes to be part of a parent or child
cell.

It also adds "it_configures" in spec_helper.

Work in progress: do not merge.

Implements: blueprint cells-support
Change-Id: I10b6a0080cfbefeddf6a19fc661a3ddfaf3da218
Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
2013-09-23 19:36:37 +00:00
Branan Purvine-Riley
afba13ed26 Update to use puppetlabs_spec_helper gem
* Automatically populate fixtures directory on spec runs
* Avoid duplicating spec_helper and Rakefile between modules
* Prepend fixtures to modulepath instead of overriding
* Remove recursive symlink in fixtures dir
2012-05-31 17:28:20 -07:00
Dan Bode
acb77d9ada Add spec tests 2012-04-23 19:41:56 -07:00
François Charlier
3d33743b2e 'nova' user conflicts with package-created user
In Debian/Ubuntu, the 'nova' user is now created as a system user, which
makes sense.
The 'nova' user created in the 'nova' class is not created as a system
user and is created before the 'nova-common' package is installed and
prevents the installation of the package.
So, require the package to be installed before puppet checks the user
existence and create the 'nova' user as a system user.

Signed-off-by: François Charlier <francois.charlier@enovance.com>
2012-03-16 18:37:24 +01:00