Commit Graph

19 Commits

Author SHA1 Message Date
ZhongShengping
b7ddd3b7eb Move to opendev
Change-Id: Ice7af4b556f71bd7bec4970e88a348639f0743c1
2019-04-21 14:44:49 +08:00
ZhongShengping
1808b236c1 Load puppet-openstack_spec_helper locally during tests
Change-Id: Ica57e2979f3c554c92d511750f099ecb9dda9489
Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
2018-02-12 10:53:40 +08:00
Alex Schultz
1430f8d6ef 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: Ie329c3abd7973a5d47af5e6d228b2a164a76107f
2017-05-17 09:49:03 -06:00
Emilien Macchi
683c303f94 Gemfile: rely on puppet-openstack_spec_helper for dependencies
Rely on puppet-openstack_spec_helper gemspec file for managing Gems
dependencies.

Change-Id: I4493e6b46db864ca9e1bca027a3f8fa776ca85fc
2016-03-29 21:37:36 -04:00
Emilien Macchi
d2e34ec91f 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: I65468b6abebafcd2240b4f5c5f968691a53d54c2
2016-01-22 10:12:41 -05:00
Alex Schultz
4f9b1c46ed 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: I4770ec921ee7bd608b46aa07eae8b173cb9d554e
2016-01-14 20:15:39 +03:00
Emilien Macchi
045d929556 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: I4b72eef7fd4d4ee7b226a5014b7d180506161f69
2015-10-08 15:20:39 -07:00
Cody Herriges
7145694b74 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: I1ed1e89127abb917c0a28d8d1e7d8beab05a71d9
2015-08-18 14:40:01 +02:00
Emilien Macchi
83e9d07a6a 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: Iff706a44f19dc620dc9f0cc39685adfadc785e2c
Co-Authored-By: Colleen Murphy <colleen@gazlene.net>
2015-06-30 17:00:23 -04:00
Colleen Murphy
8063a02c8f 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: If157cc889e98d6dd9b7ab4096589c93ff30b7d90
2015-06-08 14:08:47 -07:00
Martin Mágr
bd16e3dbe5 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_trove_spec: add case for repo configuration and support
  RH systems.

Change-Id: Iaf590e0040afe0a4dc58c52a9b1a8e83a0154792
Closes-bug: #1444736
2015-05-22 10:14:31 -07:00
Emilien Macchi
19731ad8f1 Beaker tests
Implement basic structure for beaker tests.

Change-Id: I7fc62d44b683b8f6f62f122ca5eced315422f943
Closes-bug: #1444736
2015-05-04 23:14:02 -04:00
Emilien Macchi
6058f2c7a9 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: I1d6b4fb422c499b840ff700a07768bb52415c134
2015-04-22 23:58:36 -04:00
Sebastien Badia
feee104f7f 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: I34c2eedd78868687613c7f89ce9aef92197f6c69
2015-03-16 18:41:48 +00:00
Sebastien Badia
53d51d8f35 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 new
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:

  * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
  * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0

Change-Id: I6e85576823fc93ac0b7a7dff06032d71682259ad
2015-02-25 05:15:02 +01:00
Sebastien Badia
b946d3d245 Fix lint issues (doc, metadata, manifests)
Add puppet parameters lint (with puppet-lint-param-docs gem) and fix
missing documentations, this commit also fix manifest lint issues
(due to puppet-lint upgrade) and metadata.json file (SPDX license,
and open dependencies).

Change-Id: Iab6f84f42e8874a10a5fcc886b4a6556fe3e1ed0
2015-02-25 04:51:00 +01:00
Sebastien Badia
6a8ce8a6b2 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: Id1c6d205f309d7480b15d086563a34f119535c42
Partial-bug: #1417604
2015-02-03 15:32:21 +01:00
Sebastien Badia
3644706d64 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.

Partial-Bug: #1326034
2014-06-20 16:29:03 +02:00
Emilien Macchi
c01ac0bb4f First commit
Contains basic files:
- fixtures for spec tests
- .gitreview file to move in Stackforge
- Gemfile
- LICENSE (Apache 2.0)
- README
- Rakefile

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
2014-05-18 01:38:51 -04:00