Recent update in rspec-puppet removed some of the config interfaces for
old puppet versions[1]. This drops usage of these interfaces to resolve
the following error in unit tests.
```
An error occurred while loading ./spec/unit/provider/manila_spec.rb.
Failure/Error: c.manifest_dir = File.join(fixture_path, 'manifests')
NoMethodError:
undefined method `manifest_dir='...
```
This also removes explicit setting of mock module. The definition is
no longer required since we bumped puppetlabs_spec_helper to v 5.0.0.
[1] 316d95923c
Change-Id: I3077eed14d4e4e2e29cb947ec4ec1fa06abd6229
puppetlabs_spec_helper recommends rspec-mocks instead of mocha[1] and
it uses rspec-mocks by default instead of mocha since v 5.0.0[2]
This is the prep work to adapt to that migration.
[1] https://github.com/puppetlabs/puppetlabs_spec_helper/#mock_with
[2] 493f0cbc1c
Closes-Bug: #2004135
Change-Id: I3c6ee8bb85efcb2169a0248ce11e750991799d63
This change refactors how the dependent libraries are loaded during
unit tests, and load the libraries in the base spec_helper to avoid
duplicate and redundant implementations.
Change-Id: I92ba82bfba4ab4e47e0f704ea71433cd98fc03d2
This change defines manifest_dir and module_path expicitly in unit
tests so that modules installed under fixtures directory is properly
loaded.
Closes-Bug: #1930403
Change-Id: I83fd4739397ce8c4b4ec3f806b5a91fb10867caf
This change updates the module to use the rspec-puppet-facts as defined
in the puppet-openstack_spec_helper.
Change-Id: Ia38009a890b0e11fa90f7747e82fd10bd7fe1954
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: I427b83d65ac850329e227310a2e3888d5c8c5cd1
* Add puppet-openstack_spec_helper to Gemfile
* Use puppet-openstack_spec_helper/defaults in spec_helper
* Delete spec/defaults.rb, useless now
Change-Id: Ic30d5f0a4e9e4674b378bb74c140dc7b5d81f7b4
This change adds possibility to use the os_service_default
fact for configuration options that default to '<SERVICE DEFAULT>'.
this change is done by analogy with cinder
commit 667e6c0850672dbbf99381eb92468f95e5591913
Change-Id: Ie5c8909bcc1c9a6a7a9ab1b59eec4637751ffd74
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: I05e2e4c13bd264c65fad8bade1886e23a50184d9
This patch changes the glance_image provider to use
puppet-openstacklib's authentication methods, which use
python-openstackclient as an interface, instead of the glance command
line client. The benefits of this is:
- Code reduction. This patch reduces the amount of code in the
glance parent provider and glance_image provider by reusing code from
Puppet::Provider::Openstack instead of implementing authentication,
retries, and response parsing in the provider.
- Presumed reduction in sudden API changes that require quick fixes in
this module, such as f377c0229c.
- Ability to set project-based access control for images
Additional reasoning for this change is in the blueprint.
Important note: this change does not work on Ubuntu under Juno due to a
major bug in the version of python-openstackclient shipped in UCA [1].
This change targets the Kilo releases.
Note about performance: the self.instances and instances methods make
API requests for each image found in the list of instances. This is not
a change from how this was implemented before. The --long formatted
list, either from the glance client or openstackclient, does not
provide all information needed to query an instance and populate
setters. Future patches could possibly improve on this.
Other details of this change:
- Removes auth_glance method, replaced by the request and
glance_request methods
- Removes auth_glance_stdin method which was not being used
- Removes parse_table which is now unnecessary because openstackclient
formats its responses as CSV and Puppet::Provider::Openstack#request
returns the results a hash
- Removes remove_warnings methods which are handled by
Puppet::Provider::Openstack#request
- Removes list_glance_images and get_glance_image_attr which are
sufficiently replaced by using the 'list' and 'show' commands with
Puppet::Provider::Openstack's request method.
- Removed self.prefetch since we can't populate auth parameters during
a prefetch. Instead we prepopulate the list via the instances method.
- Added a flush method to do updates more efficiently
- Changed is_public property to accept true/false in addition to yes/no
and to munge to a symbol instead of a capitalized string, for
consistency with keystone_tenant's enabled property
- Move the reset method into the spec tests since it is only necessary
for testing
- Added tests for glance_image, which did not exist before
- Removed connection retry test since this is taken care of in
openstacklib
[1] https://bugs.launchpad.net/python-openstackclient/+bug/1269821
blueprint use-openstackclient-in-module-resources
Change-Id: Iceab5e1c6138e7aba0f883ed4acb8f7ecbcd2830
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: Ibd0333dc3c0959e846edfbad51fb48e8dfb8fbe9
Card: https://trello.com/c/eHXc1Ryd/4-investigate-the-necessary-change-to-be-rspec-puppet-2-0-0-compliant
Cinder is an potiential backend in Glance.
This patchs aims to:
- create glance::backend::cinder
- improve spec_helper using shared_examples
Change-Id: I15e5de8281ff2e60465fedda97d9c9ccf808386c
Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
These changes make it easier for both humans and computers to run the spec tests
* Add `rake spec_full` and friends, which automatically checkout dependency modules
prior to running spec tests
* Prepend fixtures modulepath instead of overriding
* Add a Travis-CI configuration file to enable easy CI
This commit resolves failing tests from
glance::api and glance::registry related to recent
refactors.
It also adds tests for all of the new api fragment
classes/defines.