Retire openstack-chef: remove repo content
OpenStack-chef project is retiring - https://review.opendev.org/c/openstack/governance/+/905279 this commit remove the content of this project repo Depends-On: https://review.opendev.org/c/openstack/project-config/+/909134 Change-Id: I55dedc984bf004dd1bebb28bef197a77a90e3925
This commit is contained in:
parent
25839992da
commit
48c554d385
@ -1,9 +0,0 @@
|
||||
[local_phases]
|
||||
unit = 'rspec spec/'
|
||||
lint = 'cookstyle --display-cop-names --extra-details'
|
||||
syntax = "berks install -e integration"
|
||||
provision = "echo skipping"
|
||||
deploy = "echo skipping"
|
||||
smoke = "echo skipping"
|
||||
functional = "echo skipping"
|
||||
cleanup = "echo skipping"
|
9
.gitignore
vendored
9
.gitignore
vendored
@ -1,9 +0,0 @@
|
||||
.bundle/
|
||||
berks-cookbooks/
|
||||
.kitchen
|
||||
.vagrant
|
||||
.coverage/
|
||||
*.swp
|
||||
Berksfile.lock
|
||||
Vagrantfile
|
||||
Gemfile.lock
|
@ -1,4 +0,0 @@
|
||||
Chef/Modernize/FoodcriticComments:
|
||||
Enabled: true
|
||||
Chef/Style/CopyrightCommentFormat:
|
||||
Enabled: true
|
@ -1,3 +0,0 @@
|
||||
- project:
|
||||
templates:
|
||||
- openstack-chef-jobs
|
23
Berksfile
23
Berksfile
@ -1,23 +0,0 @@
|
||||
source 'https://supermarket.chef.io'
|
||||
|
||||
solver :ruby, :required
|
||||
|
||||
[
|
||||
%w(client dep),
|
||||
%w(-common dep),
|
||||
%w(-compute integration),
|
||||
%w(-dns dep),
|
||||
%w(-identity dep),
|
||||
%w(-image dep),
|
||||
%w(-network dep),
|
||||
%w(-ops-database integration),
|
||||
%w(-ops-messaging integration),
|
||||
].each do |cookbook, group|
|
||||
if Dir.exist?("../cookbook-openstack#{cookbook}")
|
||||
cookbook "openstack#{cookbook}", path: "../cookbook-openstack#{cookbook}", group: group
|
||||
else
|
||||
cookbook "openstack#{cookbook}", git: "https://opendev.org/openstack/cookbook-openstack#{cookbook}", group: group
|
||||
end
|
||||
end
|
||||
|
||||
metadata
|
176
LICENSE
176
LICENSE
@ -1,176 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
113
README.rst
113
README.rst
@ -1,107 +1,10 @@
|
||||
OpenStack Chef Cookbook - integration-test
|
||||
==========================================
|
||||
This project is no longer maintained.
|
||||
|
||||
.. image:: https://governance.openstack.org/badges/cookbook-openstack-integration-test.svg
|
||||
:target: https://governance.openstack.org/reference/tags/index.html
|
||||
The contents of this repository are still available in the Git
|
||||
source code management system. To see the contents of this
|
||||
repository before it reached its end of life, please check out the
|
||||
previous commit with "git checkout HEAD^1".
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
This cookbook installs the OpenStack Integration Test Suite **Tempest**
|
||||
as part of an OpenStack reference deployment Chef for OpenStack. The
|
||||
`OpenStack chef-repo`_ contains documentation for using this cookbook in
|
||||
the context of a full OpenStack deployment. Tempest is currently
|
||||
installed from git and pip.
|
||||
|
||||
.. _OpenStack chef-repo: https://opendev.org/openstack/openstack-chef
|
||||
|
||||
https://docs.openstack.org/tempest/latest/
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
- Chef 16 or higher
|
||||
- Chef Workstation 21.10.640 for testing (also includes Berkshelf for
|
||||
cookbook dependency resolution)
|
||||
|
||||
Cookbooks
|
||||
---------
|
||||
|
||||
The following cookbooks are dependencies:
|
||||
|
||||
- 'bind', '~> 3.0'
|
||||
- 'openstackclient'
|
||||
- 'openstack-common', '>= 20.0.0'
|
||||
- 'openstack-dns', '>= 20.0.0'
|
||||
- 'openstack-image', '>= 20.0.0'
|
||||
- 'resolver', '>= 3.0'
|
||||
|
||||
Recipes
|
||||
=======
|
||||
|
||||
create_network
|
||||
--------------
|
||||
|
||||
- Create a test network and subnet for use in kitchen tests
|
||||
|
||||
dns
|
||||
---
|
||||
|
||||
- Setup environment for testing designate
|
||||
|
||||
orchestration
|
||||
-------------
|
||||
|
||||
- Setup environment for testing heat
|
||||
|
||||
run_tempest
|
||||
-----------
|
||||
|
||||
- Run tempest for use in kitchen tests
|
||||
|
||||
setup
|
||||
-----
|
||||
|
||||
- Install and configure Tempest
|
||||
|
||||
Attributes
|
||||
==========
|
||||
|
||||
Please refer to the ``attributes/default.rb`` for attribute details.
|
||||
|
||||
Testing
|
||||
=======
|
||||
|
||||
Please refer to the `TESTING.md`_ for instructions for testing the
|
||||
cookbook.
|
||||
|
||||
.. _TESTING.md: cookbook-openstack-integration-test/src/branch/master/TESTING.md
|
||||
|
||||
License and Author
|
||||
==================
|
||||
|
||||
+-----------------+-------------------------------------------------+
|
||||
| **Author** | Matt Thompson (matt.thompson@rackspace.co.uk) |
|
||||
+-----------------+-------------------------------------------------+
|
||||
| **Author** | Lance Albertson (lance.osuosl.org) |
|
||||
+-----------------+-------------------------------------------------+
|
||||
|
||||
+-----------------+--------------------------------------------------+
|
||||
| **Copyright** | Copyright (c) 2014, Rackspace US, Inc. |
|
||||
+-----------------+--------------------------------------------------+
|
||||
| **Copyright** | Copyright (c) 2017-2021, Oregon State University |
|
||||
+-----------------+--------------------------------------------------+
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
::
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
For any further questions, please email
|
||||
openstack-discuss@lists.openstack.org or join #openstack-dev on
|
||||
OFTC.
|
||||
|
39
Rakefile
39
Rakefile
@ -1,39 +0,0 @@
|
||||
task default: ['test']
|
||||
|
||||
task test: [:syntax, :lint, :unit]
|
||||
|
||||
desc 'Vendor the cookbooks in the Berksfile'
|
||||
task :berks_prep do
|
||||
sh %(chef exec berks vendor)
|
||||
end
|
||||
|
||||
desc 'Run FoodCritic (syntax) tests'
|
||||
task :syntax do
|
||||
sh %(chef exec foodcritic --exclude spec -f any .)
|
||||
end
|
||||
|
||||
desc 'Run RuboCop (lint) tests'
|
||||
task :lint do
|
||||
sh %(chef exec cookstyle)
|
||||
end
|
||||
|
||||
desc 'Run RSpec (unit) tests'
|
||||
task unit: :berks_prep do
|
||||
sh %(chef exec rspec --format documentation)
|
||||
end
|
||||
|
||||
desc 'Remove the berks-cookbooks directory and the Berksfile.lock'
|
||||
task :clean do
|
||||
rm_rf [
|
||||
'berks-cookbooks',
|
||||
'Berksfile.lock',
|
||||
]
|
||||
end
|
||||
|
||||
desc 'All-in-One Neutron build Infra using Common task'
|
||||
task :integration do
|
||||
# Use the common integration task
|
||||
sh %(wget -nv -t 3 -O Rakefile-Common https://opendev.org/openstack/cookbook-openstack-common/raw/branch/master/Rakefile)
|
||||
load './Rakefile-Common'
|
||||
Rake::Task['common_integration'].invoke
|
||||
end
|
43
TESTING.md
43
TESTING.md
@ -1,43 +0,0 @@
|
||||
# Testing the Cookbook #
|
||||
|
||||
This cookbook uses [chefdk](https://downloads.chef.io/chef-dk/) and [berkshelf](http://berkshelf.com/) to isolate dependencies. Make sure you have chefdk and the header files for `gecode` installed before continuing. Make sure that you're using gecode version 3. More info [here](https://github.com/opscode/dep-selector-libgecode/tree/0bad63fea305ede624c58506423ced697dd2545e#using-a-system-gecode-instead). For more detailed information on what needs to be installed, you can have a quick look into the bootstrap.sh file in this repository, which does install all the needed things to get going on ubuntu trusty. The tests defined in the Rakefile include lint, style and unit. For integration testing please refere to the [openstack-chef-repo](https://github.com/openstack/openstack-chef-repo).
|
||||
|
||||
We have four test suites which you can run either, individually (there are three rake tasks):
|
||||
|
||||
$ chef exec rake lint
|
||||
$ chef exec rake style
|
||||
$ chef exec rake knife
|
||||
$ chef exec rake unit
|
||||
|
||||
or altogether:
|
||||
|
||||
$ chef exec rake
|
||||
|
||||
The `rake` tasks will take care of installing the needed cookbooks with `berkshelf`.
|
||||
|
||||
## Rubocop ##
|
||||
|
||||
[Rubocop](https://github.com/bbatsov/rubocop) is a static Ruby code analyzer, based on the community [Ruby style guide](https://github.com/bbatsov/ruby-style-guide). We are attempting to adhere to this where applicable, slowly cleaning up the cookbooks until we can turn on Rubocop for gating the commits.
|
||||
|
||||
### Attribute Rules ###
|
||||
|
||||
Since there are slight style differences between the coding of attributes, recipes and metadata files there are specific `.rubocop.yml` files for each of:
|
||||
|
||||
[Gemfile and metadata.rb](.rubocop.yml)
|
||||
[attributes/*.rb](attributes/.rubocop.yml)
|
||||
[recipes/.rubocop.yml](recipes/.rubocop.yml)
|
||||
[spec/.rubocop.yml](spec/.rubocop.yml)
|
||||
|
||||
## Knife ##
|
||||
|
||||
[knife cookbook test](http://docs.opscode.com/chef/knife.html#test) is used to check the cookbook's Ruby and ERB files for basic syntax errors.
|
||||
|
||||
## Foodcritic ##
|
||||
|
||||
[Foodcritic](http://acrmp.github.io/foodcritic/) is a lint tool for Chef cookbooks. We ignore the following rules:
|
||||
|
||||
[FC003](http://acrmp.github.io/foodcritic/#FC003) these cookbooks are not intended for Chef Solo.
|
||||
|
||||
## Chefspec
|
||||
|
||||
[ChefSpec](http://code.sethvargo.com/chefspec/) is a unit testing framework for testing Chef cookbooks. ChefSpec makes it easy to write examples and get fast feedback on cookbook changes without the need for virtual machines or cloud servers.
|
@ -1,126 +0,0 @@
|
||||
#
|
||||
# Cookbook:: openstack-integration-test
|
||||
# Attributes:: default
|
||||
#
|
||||
# Copyright:: 2014-2021, Rackspace US, Inc.
|
||||
# Copyright:: 2017-2021, Oregon State University
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
default['openstack']['integration-test'] = {
|
||||
'branch' => nil,
|
||||
'disable_ssl_validation' => false,
|
||||
'use_dynamic_credentials' => true,
|
||||
'alt_ssh_user' => 'cirros',
|
||||
'ssh_user' => 'cirros',
|
||||
'fixed_network' => 'local_net',
|
||||
'heat_stack_user_role' => 'heat_stack_owner',
|
||||
'nova_user' => 'nova',
|
||||
'nova_group' => 'nova',
|
||||
'blacklist_regex' => [
|
||||
# TODO(ramereth): iSCSI service needs to be fixed in block-storage
|
||||
# due to missing tgtadm executable and functioning iscsid service.
|
||||
'tempest.api.compute.servers.test_create_server.ServersTestBootFromVolume',
|
||||
],
|
||||
'user1' => {
|
||||
'user_name' => 'tempest_user1',
|
||||
'password' => 'tempest_user1_pass',
|
||||
'project_name' => 'tempest_project1',
|
||||
'role' => 'Member',
|
||||
'domain_name' => 'Default',
|
||||
},
|
||||
'user2' => {
|
||||
'user_name' => 'tempest_user2',
|
||||
'password' => 'tempest_user2_pass',
|
||||
'project_name' => 'tempest_project2',
|
||||
'role' => 'Member',
|
||||
'domain_name' => 'Default',
|
||||
},
|
||||
'image1' => {
|
||||
'name' => 'cirros-test1',
|
||||
'id' => '1ac790f6-903a-4833-979f-a38f1819e3b1',
|
||||
'flavor' => 99,
|
||||
'source' => 'http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img',
|
||||
},
|
||||
'image2' => {
|
||||
'name' => 'cirros-test2',
|
||||
'id' => 'f7c2ac6d-0011-499f-a9ec-ca71348bf2e4',
|
||||
'flavor' => 99,
|
||||
'source' => 'http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img',
|
||||
},
|
||||
}
|
||||
|
||||
# platform-specific settings
|
||||
case node['platform_family']
|
||||
when 'rhel'
|
||||
case node['platform_version'].to_i
|
||||
when 8
|
||||
default['openstack']['integration-test']['platform'] = {
|
||||
tempest_packages:
|
||||
%w(
|
||||
curl
|
||||
git
|
||||
libffi-devel
|
||||
libxml2-devel
|
||||
libxslt-devel
|
||||
python3-ddt
|
||||
python3-gabbi
|
||||
python3-testrepository
|
||||
python3-testscenarios
|
||||
python36-devel
|
||||
),
|
||||
package_overrides: '',
|
||||
}
|
||||
when 7
|
||||
default['openstack']['integration-test']['platform'] = {
|
||||
tempest_packages:
|
||||
%w(
|
||||
curl
|
||||
git
|
||||
libffi-devel
|
||||
libxml2-devel
|
||||
libxslt-devel
|
||||
python-ddt
|
||||
python-devel
|
||||
python-gabbi
|
||||
python-testrepository
|
||||
python-testscenarios
|
||||
),
|
||||
package_overrides: '',
|
||||
}
|
||||
end
|
||||
when 'debian'
|
||||
default['openstack']['integration-test']['platform'] = {
|
||||
'tempest_packages' =>
|
||||
%w(
|
||||
curl
|
||||
git
|
||||
libffi-dev
|
||||
libffi-dev
|
||||
libpq-dev
|
||||
libssl-dev
|
||||
libxml2-dev
|
||||
libxml2-dev
|
||||
libxslt1-dev
|
||||
libxslt-dev
|
||||
python-ddt
|
||||
python-dev
|
||||
python-dev
|
||||
python-gabbi
|
||||
python-testscenarios
|
||||
testrepository
|
||||
),
|
||||
'package_overrides' => '',
|
||||
}
|
||||
end
|
@ -1,142 +0,0 @@
|
||||
default['openstack']['integration-test']['conf_secrets'] = {}
|
||||
default['openstack']['integration-test']['conf'].tap do |conf|
|
||||
conf['DEFAULT']['log_dir'] = '/opt/tempest/logs'
|
||||
conf['DEFAULT']['log_file'] = 'tempest.log'
|
||||
conf['auth']['use_dynamic_credentials'] = node['openstack']['integration-test']['use_dynamic_credentials']
|
||||
conf['auth']['default_credentials_domain_name'] = 'Default'
|
||||
conf['auth']['admin_domain_name'] = 'Default'
|
||||
conf['identity']['catalog_type'] = 'identity'
|
||||
conf['identity']['disable_ssl_certificate_validation'] =
|
||||
node['openstack']['integration-test']['disable_ssl_validation']
|
||||
conf['identity']['v3_endpoint_type'] = 'publicURL'
|
||||
conf['identity']['strategy'] = 'keystone'
|
||||
conf['identity']['region'] = 'RegionOne'
|
||||
conf['identity']['username'] = node['openstack']['integration-test']['user1']['user_name']
|
||||
conf['identity']['password'] = node['openstack']['integration-test']['user1']['password']
|
||||
conf['identity']['user_domain_name'] = 'Default'
|
||||
conf['identity']['project_domain_name'] = 'Default'
|
||||
conf['identity']['project_name'] = node['openstack']['integration-test']['user1']['project_name']
|
||||
conf['identity']['alt_username'] = node['openstack']['integration-test']['user2']['user_name']
|
||||
conf['identity']['alt_password'] = node['openstack']['integration-test']['user2']['password']
|
||||
conf['identity']['alt_project_name'] = node['openstack']['integration-test']['user2']['project_name']
|
||||
conf['identity']['default_domain_id'] = 'default'
|
||||
conf['identity']['admin_domain_scope'] = false
|
||||
conf['validation']['run_validation'] = false
|
||||
conf['validation']['image_alt_ssh_user'] = node['openstack']['integration-test']['alt_ssh_user']
|
||||
conf['validation']['image_ssh_user'] = node['openstack']['integration-test']['ssh_user']
|
||||
conf['compute']['flavor_ref'] = node['openstack']['integration-test']['image1']['flavor']
|
||||
conf['compute']['flavor_ref_alt'] = node['openstack']['integration-test']['image2']['flavor']
|
||||
conf['compute']['fixed_network_name'] = node['openstack']['integration-test']['fixed_network']
|
||||
conf['compute']['build_interval'] = 3
|
||||
conf['compute']['build_timeout'] = 400
|
||||
conf['compute']['run_ssh'] = false
|
||||
conf['compute']['ssh_user'] = node['openstack']['integration-test']['ssh_user']
|
||||
conf['compute']['ip_version_for_ssh']
|
||||
conf['compute']['ssh_timeout'] = 400
|
||||
conf['compute']['ssh_channel_timeout'] = 60
|
||||
conf['compute']['catalog_type'] = 'compute'
|
||||
conf['compute']['create_image_enabled'] = true
|
||||
conf['compute']['resize_available'] = true
|
||||
conf['compute']['change_password_available'] = false
|
||||
conf['compute']['live_migration_available'] = false
|
||||
conf['compute']['use_block_migration_for_live_migration'] = false
|
||||
conf['compute']['disk_config_enabled_override'] = true
|
||||
conf['identity-feature-enabled']['api_v3'] = true
|
||||
conf['identity-feature-enabled']['api_v2'] = false
|
||||
conf['whitebox']['whitebox_enabled'] = false
|
||||
conf['whitebox']['source_dir'] = '/usr/share/pyshared/nova'
|
||||
conf['whitebox']['config_path'] = '/etc/nova/nova.conf'
|
||||
conf['whitebox']['bin_dir'] = '/usr/bin'
|
||||
conf['whitebox']['path_to_private_key'] = ''
|
||||
conf['whitebox']['db_uri'] = ''
|
||||
conf['compute-feature-enabled']['api_v3'] = false
|
||||
conf['image']['catalog_type'] = 'image'
|
||||
conf['image']['api_version'] = 1
|
||||
conf['network']['api_version'] = 2.0
|
||||
conf['network']['catalog_type'] = 'network'
|
||||
conf['network']['project_network_cidr'] = '10.100.0.0/16'
|
||||
conf['network']['project_network_mask_bits'] = 28
|
||||
conf['network']['project_networks_reachable'] = false
|
||||
conf['network']['public_network_id'] = ''
|
||||
conf['network']['public_router_id'] = ''
|
||||
conf['network']['quantum_available'] = false
|
||||
conf['network-feature-enabled']['api_extensions'] = %w(
|
||||
address-scope
|
||||
agent
|
||||
allowed-address-pairs
|
||||
auto-allocated-topology
|
||||
availability_zone
|
||||
availability_zone_filter
|
||||
binding
|
||||
binding-extended
|
||||
default-subnetpools
|
||||
dhcp_agent_scheduler
|
||||
dvr
|
||||
empty-string-filtering
|
||||
ext-gw-mode
|
||||
external-net
|
||||
extra_dhcp_opt
|
||||
extraroute
|
||||
filter-validation
|
||||
fip-port-details
|
||||
flavors
|
||||
ip-substring-filtering
|
||||
l3-flavors
|
||||
l3-ha
|
||||
l3_agent_scheduler
|
||||
multi-provider
|
||||
net-mtu
|
||||
net-mtu-writable
|
||||
network-ip-availability
|
||||
network_availability_zone
|
||||
pagination
|
||||
port-mac-address-regenerate
|
||||
port-security-groups-filtering
|
||||
project-id
|
||||
provider
|
||||
quota_details
|
||||
quotas
|
||||
rbac-policies
|
||||
revision-if-match
|
||||
router
|
||||
router_availability_zone
|
||||
security-group
|
||||
service-type
|
||||
sorting
|
||||
standard-attr-description
|
||||
standard-attr-revisions
|
||||
standard-attr-tag
|
||||
standard-attr-timestamp
|
||||
subnet-service-types
|
||||
subnet_allocation).join(',')
|
||||
conf['volume']['catalog_type'] = 'volumev3'
|
||||
conf['volume']['build_interval'] = 3
|
||||
conf['volume']['build_timeout'] = 400
|
||||
conf['volume']['backup'] = false
|
||||
conf['volume-feature-enabled']['snapshot'] = false
|
||||
conf['object-storage']['catalog_type'] = 'object-storage'
|
||||
conf['object-storage']['container_sync_timeout'] = 120
|
||||
conf['object-storage']['container_sync_interval'] = 5
|
||||
conf['orchestration']['catalog_type'] = 'orchestration'
|
||||
conf['boto']['ssh_user'] = 'cirros'
|
||||
conf['boto']['ec2_url'] = ''
|
||||
conf['boto']['s3_url'] = ''
|
||||
conf['boto']['aws_access'] = ''
|
||||
conf['boto']['aws_secret'] = ''
|
||||
conf['boto']['s3_materials_path'] = '/opt/stack/devstack/files/images/s3-materials/cirros-0.3.0'
|
||||
conf['boto']['ari_manifest'] = 'cirros-0.3.0-x86_64-initrd.manifest.xml'
|
||||
conf['boto']['ami_manifest'] = 'cirros-0.3.0-x86_64-blank.img.manifest.xml'
|
||||
conf['boto']['aki_manifest'] = 'cirros-0.3.0-x86_64-vmlinuz.manifest.xml'
|
||||
conf['boto']['instance_type'] = 'm1.tiny'
|
||||
conf['boto']['http_socket_timeout'] = 30
|
||||
conf['boto']['num_retries'] = 1
|
||||
conf['boto']['build_timeout'] = 400
|
||||
conf['boto']['build_interval'] = 3
|
||||
conf['service_available']['cinder'] = false
|
||||
conf['service_available']['glance'] = true
|
||||
conf['service_available']['heat'] = true
|
||||
conf['service_available']['neutron'] = false
|
||||
conf['service_available']['nova'] = true
|
||||
conf['service_available']['swift'] = false
|
||||
conf['oslo_concurrency']['lock_path'] = '/opt/tempest/tempest_lock'
|
||||
end
|
File diff suppressed because it is too large
Load Diff
@ -1,26 +0,0 @@
|
||||
heat_template_version: rocky
|
||||
|
||||
description: Simple template to deploy a single compute instance
|
||||
|
||||
resources:
|
||||
private_net:
|
||||
type: OS::Neutron::Net
|
||||
properties:
|
||||
name: private
|
||||
private_subnet:
|
||||
type: OS::Neutron::Subnet
|
||||
properties:
|
||||
name: private-subnet
|
||||
network_id: { get_resource: private_net }
|
||||
cidr: 10.0.99.0/24
|
||||
allocation_pools:
|
||||
- start: 10.0.99.10
|
||||
end: 10.0.99.100
|
||||
my_instance:
|
||||
type: OS::Nova::Server
|
||||
properties:
|
||||
key_name: heat_key
|
||||
image: cirros
|
||||
flavor: m1.small
|
||||
networks:
|
||||
- network: { get_resource: private_net }
|
21
metadata.rb
21
metadata.rb
@ -1,21 +0,0 @@
|
||||
name 'openstack-integration-test'
|
||||
maintainer 'openstack-chef'
|
||||
maintainer_email 'openstack-discuss@lists.openstack.org'
|
||||
license 'Apache-2.0'
|
||||
description 'Installs and configures the Tempest Integration Test Suite'
|
||||
version '20.0.0'
|
||||
|
||||
%w(ubuntu redhat centos).each do |os|
|
||||
supports os
|
||||
end
|
||||
|
||||
depends 'bind', '~> 3.0'
|
||||
depends 'openstackclient'
|
||||
depends 'openstack-common', '>= 20.0.0'
|
||||
depends 'openstack-dns', '>= 20.0.0'
|
||||
depends 'openstack-image', '>= 20.0.0'
|
||||
depends 'resolver', '>= 3.0'
|
||||
|
||||
issues_url 'https://launchpad.net/openstack-chef'
|
||||
source_url 'https://opendev.org/openstack/cookbook-openstack-integration-test'
|
||||
chef_version '>= 16.0'
|
@ -1,53 +0,0 @@
|
||||
#
|
||||
# Cookbook:: openstack-integration-test
|
||||
# Recipe:: create_network
|
||||
#
|
||||
# Copyright:: 2020-2021, Oregon State University
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the 'License');
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an 'AS IS' BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Purpose: For use in kitchen tempest tests, create network/subnet identical to
|
||||
# openstack-chef/Rakefile _setup_local_network
|
||||
|
||||
class Chef::Recipe
|
||||
include ::Openstack
|
||||
end
|
||||
|
||||
class Chef::Resource::RubyBlock
|
||||
include ::Openstack
|
||||
end
|
||||
|
||||
admin_user = node['openstack']['identity']['admin_user']
|
||||
admin_project = node['openstack']['identity']['admin_project']
|
||||
netname = node['openstack']['integration-test']['fixed_network']
|
||||
subnetname = 'local_subnet'
|
||||
|
||||
# NOTE: This has to be done in a ruby_block so it gets executed at execution
|
||||
# time and not compile time (when nova does not yet exist).
|
||||
ruby_block 'create_shared_network_for_testing' do
|
||||
block do
|
||||
begin
|
||||
env = openstack_command_env(admin_user, admin_project, 'Default', 'Default')
|
||||
output = openstack_command('openstack', 'network list', env)
|
||||
unless output.include? netname
|
||||
openstack_command('openstack', "network create --share #{netname}", env)
|
||||
end
|
||||
output = openstack_command('openstack', 'subnet list', env)
|
||||
unless output.include? subnetname
|
||||
openstack_command('openstack', "subnet create --network #{netname} --subnet-range 192.168.180.0/24 #{subnetname}", env)
|
||||
end
|
||||
rescue RuntimeError => e
|
||||
Chef::Log.error("Could not create network/subnet. Error was #{e.message}")
|
||||
end
|
||||
end
|
||||
end
|
@ -1,78 +0,0 @@
|
||||
#
|
||||
# Cookbook:: openstack-integration-test
|
||||
# Recipe:: dns
|
||||
#
|
||||
# Copyright:: 2020-2021, Oregon State University
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
class ::Chef::Recipe
|
||||
include ::Openstack
|
||||
include BindCookbook::Helpers
|
||||
end
|
||||
|
||||
class ::Chef::Resource
|
||||
include BindCookbook::Helpers
|
||||
end
|
||||
|
||||
service 'systemd-resolved' do
|
||||
action [:stop, :disable]
|
||||
end
|
||||
|
||||
# Match what opendev/base-jobs uses for unbound:
|
||||
# https://opendev.org/opendev/base-jobs/src/branch/master/roles/configure-unbound/defaults/main.yaml#L1-L7
|
||||
|
||||
resolver_config '/etc/resolv.conf' do
|
||||
nameservers %w(1.0.0.1 8.8.8.8)
|
||||
end
|
||||
|
||||
# Disable and stop unbound so we can properly test Designate
|
||||
service 'unbound' do
|
||||
action [:disable, :stop]
|
||||
end
|
||||
|
||||
bind_service 'default' do
|
||||
action [:create, :start]
|
||||
end
|
||||
|
||||
rndc_secret = get_password 'token', 'designate_rndc'
|
||||
|
||||
template "#{default_property_for(:sysconfdir, false)}/rndc.key" do
|
||||
source 'rndc.key.erb'
|
||||
cookbook 'openstack-dns'
|
||||
owner default_property_for(:run_user, false)
|
||||
group default_property_for(:run_group, false)
|
||||
mode '440'
|
||||
sensitive true
|
||||
variables(
|
||||
secret: rndc_secret
|
||||
)
|
||||
notifies :restart, 'bind_service[default]'
|
||||
end
|
||||
|
||||
template "#{default_property_for(:sysconfdir, false)}/named.designate" do
|
||||
owner default_property_for(:run_user, false)
|
||||
group default_property_for(:run_group, false)
|
||||
variables(
|
||||
bind_sysconfig: default_property_for(:sysconfdir, false)
|
||||
)
|
||||
notifies :restart, 'bind_service[default]'
|
||||
end
|
||||
|
||||
bind_config 'default' do
|
||||
options [
|
||||
'allow-new-zones yes',
|
||||
]
|
||||
additional_config_files %w(named.designate)
|
||||
end
|
@ -1,26 +0,0 @@
|
||||
#
|
||||
# Cookbook:: openstack-integration-test
|
||||
# Recipe:: orchestration
|
||||
#
|
||||
# Copyright:: 2020-2021, Oregon State University
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
execute 'bash -c "source /root/openrc && openstack keypair create heat_key > /tmp/heat_key.priv"' do
|
||||
creates '/tmp/heat_key.priv'
|
||||
end
|
||||
|
||||
execute 'bash -c "source /root/openrc && openstack flavor create --ram 1024 --disk 15 --vcpus 1 m1.small"' do
|
||||
not_if 'bash -c "source /root/openrc && openstack flavor show m1.small"'
|
||||
end
|
||||
|
||||
cookbook_file '/tmp/heat.yml'
|
@ -1,30 +0,0 @@
|
||||
#
|
||||
# Cookbook:: openstack-integration-test
|
||||
# Recipe:: run_tempest
|
||||
#
|
||||
# Copyright:: 2020-2021, Oregon State University
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the 'License');
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an 'AS IS' BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Purpose: Run tempest like openstack-chef/Rakefile (used by kitchen)
|
||||
|
||||
execute 'run_tempest' do
|
||||
# Write log file to test VM's /root directory.
|
||||
command 'cd /opt/tempest; /opt/tempest-venv/tempest.sh'
|
||||
action :nothing
|
||||
end
|
||||
|
||||
# Run tempest after everything else.
|
||||
notify_group 'start_tempest' do
|
||||
notifies :run, 'execute[run_tempest]', :delayed
|
||||
end
|
218
recipes/setup.rb
218
recipes/setup.rb
@ -1,218 +0,0 @@
|
||||
#
|
||||
# Cookbook:: openstack-integration-test
|
||||
# Recipe:: setup
|
||||
#
|
||||
# Copyright:: 2014-2021, Rackspace US, Inc.
|
||||
# Copyright:: 2017-2021, Oregon State university
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the 'License');
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an 'AS IS' BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
class Chef::Recipe
|
||||
include ::Openstack
|
||||
end
|
||||
|
||||
class Chef::Resource::RubyBlock
|
||||
include ::Openstack
|
||||
end
|
||||
|
||||
platform_options = node['openstack']['integration-test']['platform']
|
||||
service_available = node['openstack']['integration-test']['conf']['service_available']
|
||||
|
||||
package platform_options['tempest_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
identity_endpoint = internal_endpoint 'identity'
|
||||
auth_url = identity_endpoint.to_s
|
||||
|
||||
admin_user = node['openstack']['identity']['admin_user']
|
||||
admin_pass = get_password 'user', admin_user
|
||||
admin_project = node['openstack']['identity']['admin_project']
|
||||
admin_domain = node['openstack']['identity']['admin_domain_name']
|
||||
admin_project_domain_name = node['openstack']['identity']['admin_project_domain']
|
||||
endpoint_type = node['openstack']['identity']['endpoint_type']
|
||||
|
||||
connection_params = {
|
||||
openstack_auth_url: auth_url,
|
||||
openstack_username: admin_user,
|
||||
openstack_api_key: admin_pass,
|
||||
openstack_project_name: admin_project,
|
||||
openstack_domain_name: admin_domain,
|
||||
openstack_endpoint_type: endpoint_type,
|
||||
}
|
||||
|
||||
%w(user1 user2).each do |user|
|
||||
service_user = node['openstack']['integration-test'][user]['user_name']
|
||||
service_project = node['openstack']['integration-test'][user]['project_name']
|
||||
service_role = node['openstack']['integration-test'][user]['role']
|
||||
service_domain = node['openstack']['integration-test'][user]['domain_name']
|
||||
service_pass = node['openstack']['integration-test'][user]['password']
|
||||
|
||||
openstack_project service_project do
|
||||
connection_params connection_params
|
||||
end
|
||||
|
||||
openstack_user service_user do
|
||||
role_name service_role
|
||||
project_name service_project
|
||||
domain_name service_domain
|
||||
password service_pass
|
||||
connection_params connection_params
|
||||
action [:create, :grant_role, :grant_domain]
|
||||
end
|
||||
end
|
||||
|
||||
openstack_role node['openstack']['integration-test']['heat_stack_user_role'] do
|
||||
connection_params connection_params
|
||||
only_if { service_available['heat'] }
|
||||
end
|
||||
|
||||
include_recipe 'openstack-common'
|
||||
build_essential 'tempest'
|
||||
|
||||
tempest_path = '/opt/tempest'
|
||||
venv_path = '/opt/tempest-venv'
|
||||
|
||||
case node['platform_family']
|
||||
when 'debian'
|
||||
venv_cmd = 'virtualenv -p python3'
|
||||
when 'fedora', 'rhel'
|
||||
venv_cmd = 'virtualenv'
|
||||
end
|
||||
|
||||
execute 'create virtualenv for tempest' do
|
||||
command "#{venv_cmd} #{venv_path}"
|
||||
creates venv_path
|
||||
end
|
||||
|
||||
if platform_family?('rhel') && node['platform_version'].to_i == 7
|
||||
# TODO(ramereth): RDO Train ships a cacert.pem which contains the expired LetsEncrypt root cert
|
||||
cookbook_file "#{venv_path}/lib/python2.7/site-packages/pip/_vendor/requests/cacert.pem"
|
||||
end
|
||||
|
||||
# Note(jh): Make sure to keep the constraint definition in sync with
|
||||
# the tempest version
|
||||
tempest_ver = '22.1.0'
|
||||
constraint = '-c https://opendev.org/openstack/requirements/raw/branch/stable/train/upper-constraints.txt'
|
||||
|
||||
execute 'install tempest' do
|
||||
action :nothing
|
||||
command "#{venv_path}/bin/pip install #{constraint} tempest==#{tempest_ver}"
|
||||
cwd tempest_path
|
||||
end
|
||||
|
||||
git tempest_path do
|
||||
repository 'https://opendev.org/openstack/tempest'
|
||||
reference tempest_ver
|
||||
depth 1
|
||||
action :sync
|
||||
notifies :run, 'execute[install tempest]', :immediately
|
||||
end
|
||||
|
||||
template "#{venv_path}/tempest.sh" do
|
||||
source 'tempest.sh.erb'
|
||||
user 'root'
|
||||
group 'root'
|
||||
mode '755'
|
||||
variables(
|
||||
venv_path: venv_path
|
||||
)
|
||||
end
|
||||
|
||||
%w(image1 image2).each do |img|
|
||||
image_name = node['openstack']['integration-test'][img]['name']
|
||||
image_id = node['openstack']['integration-test'][img]['id']
|
||||
openstack_image_image img do
|
||||
identity_user admin_user
|
||||
identity_pass admin_pass
|
||||
identity_tenant admin_project
|
||||
identity_uri auth_url
|
||||
identity_user_domain_name admin_domain
|
||||
identity_project_domain_name admin_project_domain_name
|
||||
image_name image_name
|
||||
image_id image_id
|
||||
image_url node['openstack']['integration-test'][img]['source']
|
||||
only_if { service_available['glance'] }
|
||||
end
|
||||
end
|
||||
|
||||
# NOTE: This has to be done in a ruby_block so it gets executed at execution
|
||||
# time and not compile time (when nova does not yet exist).
|
||||
ruby_block 'Create nano flavor 99' do
|
||||
block do
|
||||
begin
|
||||
env = openstack_command_env(admin_user, admin_project, 'Default', 'Default')
|
||||
output = openstack_command('openstack', 'flavor list', env)
|
||||
unless output.include? 'm1.nano'
|
||||
openstack_command('openstack', 'flavor create --id 99 --vcpus 1 --ram 64 --disk 1 m1.nano', env)
|
||||
end
|
||||
rescue RuntimeError => e
|
||||
Chef::Log.error("Could not create flavor m1.nano. Error was #{e.message}")
|
||||
end
|
||||
end
|
||||
only_if { service_available['nova'] }
|
||||
end
|
||||
|
||||
node.default['openstack']['integration-test']['conf'].tap do |conf|
|
||||
conf['compute']['image_ref'] = node['openstack']['integration-test']['image1']['id']
|
||||
conf['compute']['image_ref_alt'] = node['openstack']['integration-test']['image2']['id']
|
||||
conf['identity']['uri_v3'] = identity_endpoint.to_s
|
||||
conf['identity']['v3_endpoint_type'] = endpoint_type
|
||||
end
|
||||
|
||||
node.default['openstack']['integration-test']['conf_secrets'].tap do |conf_secrets|
|
||||
conf_secrets['auth']['admin_username'] = admin_user
|
||||
conf_secrets['auth']['admin_password'] = admin_pass
|
||||
conf_secrets['auth']['admin_project_name'] = admin_project
|
||||
end
|
||||
|
||||
# merge all config options and secrets to be used in the tempest.conf.erb
|
||||
integration_test_conf_options = merge_config_options 'integration-test'
|
||||
|
||||
template '/opt/tempest/etc/tempest-blacklist'
|
||||
|
||||
# create the keystone.conf from attributes
|
||||
template '/opt/tempest/etc/tempest.conf' do
|
||||
source 'openstack-service.conf.erb'
|
||||
cookbook 'openstack-common'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '600'
|
||||
variables(
|
||||
service_config: integration_test_conf_options
|
||||
)
|
||||
end
|
||||
|
||||
directory '/opt/tempest/logs' do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '755'
|
||||
action :create
|
||||
end
|
||||
|
||||
# execute discover_hosts again before running tempest
|
||||
execute 'discover_hosts' do
|
||||
user node['openstack']['integration-test']['nova_user']
|
||||
group node['openstack']['integration-test']['nova_group']
|
||||
command 'nova-manage cell_v2 discover_hosts'
|
||||
only_if { service_available['nova'] }
|
||||
end
|
||||
|
||||
# delete all secrets saved in the attribute
|
||||
# node['openstack']['identity']['conf_secrets'] after creating the keystone.conf
|
||||
ruby_block "delete all attributes in node['openstack']['integration-test']['conf_secrets']" do
|
||||
block do
|
||||
node.rm(:openstack, :'integration-test', :conf_secrets)
|
||||
end
|
||||
end
|
@ -1,74 +0,0 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-integration-test::dns' do
|
||||
ALL_RHEL.each do |p|
|
||||
context "redhat #{p[:version]}" do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(p) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) do
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
include_context 'tempest-stubs'
|
||||
|
||||
it do
|
||||
expect(chef_run).to set_resolver_config('/etc/resolv.conf').with(
|
||||
nameservers: %w(1.0.0.1 8.8.8.8)
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to disable_service('unbound')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to stop_service('unbound')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_bind_service('default')
|
||||
expect(chef_run).to start_bind_service('default')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_template('/etc/named/rndc.key').with(
|
||||
source: 'rndc.key.erb',
|
||||
owner: 'named',
|
||||
group: 'named',
|
||||
mode: '440',
|
||||
sensitive: true,
|
||||
variables: {
|
||||
secret: 'rndc-key',
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run.template('/etc/named/rndc.key')).to notify('bind_service[default]').to(:restart)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_template('/etc/named/named.designate').with(
|
||||
owner: 'named',
|
||||
group: 'named',
|
||||
variables: {
|
||||
bind_sysconfig: '/etc/named',
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run.template('/etc/named/named.designate')).to notify('bind_service[default]').to(:restart)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_bind_config('default').with(
|
||||
options: [
|
||||
'allow-new-zones yes',
|
||||
],
|
||||
additional_config_files: %w(named.designate)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,77 +0,0 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-integration-test::dns' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) do
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
include_context 'tempest-stubs'
|
||||
|
||||
it do
|
||||
expect(chef_run).to stop_service('systemd-resolved')
|
||||
expect(chef_run).to disable_service('systemd-resolved')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to set_resolver_config('/etc/resolv.conf').with(
|
||||
nameservers: %w(1.0.0.1 8.8.8.8)
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to disable_service('unbound')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to stop_service('unbound')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_bind_service('default')
|
||||
expect(chef_run).to start_bind_service('default')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_template('/etc/bind/rndc.key').with(
|
||||
source: 'rndc.key.erb',
|
||||
owner: 'bind',
|
||||
group: 'bind',
|
||||
mode: '440',
|
||||
sensitive: true,
|
||||
variables: {
|
||||
secret: 'rndc-key',
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run.template('/etc/bind/rndc.key')).to notify('bind_service[default]').to(:restart)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_template('/etc/bind/named.designate').with(
|
||||
owner: 'bind',
|
||||
group: 'bind',
|
||||
variables: {
|
||||
bind_sysconfig: '/etc/bind',
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run.template('/etc/bind/named.designate')).to notify('bind_service[default]').to(:restart)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_bind_config('default').with(
|
||||
options: [
|
||||
'allow-new-zones yes',
|
||||
],
|
||||
additional_config_files: %w(named.designate)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
@ -1,40 +0,0 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-integration-test::orchestration' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) do
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
before do
|
||||
stub_command('bash -c "source /root/openrc && openstack flavor show m1.small"').and_return(false)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to \
|
||||
run_execute('bash -c "source /root/openrc && openstack keypair create heat_key > /tmp/heat_key.priv"')
|
||||
.with(creates: '/tmp/heat_key.priv')
|
||||
end
|
||||
it do
|
||||
expect(chef_run).to \
|
||||
run_execute('bash -c "source /root/openrc && openstack flavor create --ram 1024 --disk 15 --vcpus 1 m1.small"')
|
||||
end
|
||||
context 'flavor already exists' do
|
||||
cached(:chef_run) do
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
before do
|
||||
stub_command('bash -c "source /root/openrc && openstack flavor show m1.small"').and_return(true)
|
||||
end
|
||||
it do
|
||||
expect(chef_run).to_not \
|
||||
run_execute('bash -c "source /root/openrc && openstack flavor create --ram 1024 --disk 15 --vcpus 1 m1.small"')
|
||||
end
|
||||
end
|
||||
it do
|
||||
expect(chef_run).to create_cookbook_file('/tmp/heat.yml')
|
||||
end
|
||||
end
|
||||
end
|
@ -1,26 +0,0 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-integration-test::setup' do
|
||||
ALL_RHEL.each do |p|
|
||||
context "redhat #{p[:version]}" do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(p) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) do
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
include_context 'tempest-stubs'
|
||||
|
||||
case p
|
||||
when REDHAT_7
|
||||
it 'installs tempest dependencies' do
|
||||
expect(chef_run).to upgrade_package %w(curl git libffi-devel libxml2-devel libxslt-devel python-ddt python-devel python-gabbi python-testrepository python-testscenarios)
|
||||
end
|
||||
when REDHAT_8
|
||||
it 'installs tempest dependencies' do
|
||||
expect(chef_run).to upgrade_package %w(curl git libffi-devel libxml2-devel libxslt-devel python3-ddt python3-gabbi python3-testrepository python3-testscenarios python36-devel)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,239 +0,0 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-integration-test::setup' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) do
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
include_context 'tempest-stubs'
|
||||
|
||||
connection_params = {
|
||||
openstack_auth_url: 'http://127.0.0.1:5000/v3',
|
||||
openstack_username: 'admin',
|
||||
openstack_api_key: 'admin',
|
||||
openstack_project_name: 'admin',
|
||||
openstack_domain_name: 'default',
|
||||
openstack_endpoint_type: 'internalURL',
|
||||
}
|
||||
|
||||
it 'installs tempest dependencies' do
|
||||
expect(chef_run).to upgrade_package %w(curl git libffi-dev libffi-dev libpq-dev libssl-dev libxml2-dev libxml2-dev libxslt1-dev libxslt-dev python-ddt python-dev python-dev python-gabbi python-testscenarios testrepository)
|
||||
end
|
||||
|
||||
it 'registers tempest_project1 Project' do
|
||||
expect(chef_run).to create_openstack_project(
|
||||
'tempest_project1'
|
||||
).with(
|
||||
connection_params: connection_params
|
||||
)
|
||||
end
|
||||
|
||||
it 'registers service user' do
|
||||
expect(chef_run).to create_openstack_user(
|
||||
'tempest_user1'
|
||||
).with(
|
||||
domain_name: 'Default',
|
||||
role_name: 'Member',
|
||||
project_name: 'tempest_project1',
|
||||
password: 'tempest_user1_pass',
|
||||
connection_params: connection_params
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to grant_role_openstack_user(
|
||||
'tempest_user1'
|
||||
).with(
|
||||
project_name: 'tempest_project1',
|
||||
role_name: 'Member',
|
||||
password: 'tempest_user1_pass',
|
||||
connection_params: connection_params
|
||||
)
|
||||
end
|
||||
|
||||
it 'registers tempest_project2 Project' do
|
||||
expect(chef_run).to create_openstack_project(
|
||||
'tempest_project2'
|
||||
).with(
|
||||
connection_params: connection_params
|
||||
)
|
||||
end
|
||||
|
||||
it 'registers service user' do
|
||||
expect(chef_run).to create_openstack_user(
|
||||
'tempest_user2'
|
||||
).with(
|
||||
domain_name: 'Default',
|
||||
role_name: 'Member',
|
||||
project_name: 'tempest_project2',
|
||||
password: 'tempest_user2_pass',
|
||||
connection_params: connection_params
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to grant_role_openstack_user(
|
||||
'tempest_user2'
|
||||
).with(
|
||||
project_name: 'tempest_project2',
|
||||
role_name: 'Member',
|
||||
password: 'tempest_user2_pass',
|
||||
connection_params: connection_params
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to run_execute('create virtualenv for tempest').with(creates: '/opt/tempest-venv')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to nothing_execute('install tempest')
|
||||
.with(
|
||||
command: '/opt/tempest-venv/bin/pip install -c https://opendev.org/openstack/requirements/raw/branch/stable/train/upper-constraints.txt tempest==22.1.0',
|
||||
cwd: '/opt/tempest'
|
||||
)
|
||||
end
|
||||
|
||||
it 'syncs /opt/tempest from github' do
|
||||
expect(chef_run).to sync_git(
|
||||
'/opt/tempest'
|
||||
).with(
|
||||
repository: 'https://opendev.org/openstack/tempest',
|
||||
reference: '22.1.0',
|
||||
depth: 1
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run.git('/opt/tempest')).to notify('execute[install tempest]').to(:run).immediately
|
||||
end
|
||||
|
||||
it 'uploads image1' do
|
||||
expect(chef_run).to upload_openstack_image_image('image1').with(
|
||||
identity_user: 'admin',
|
||||
identity_pass: 'admin',
|
||||
identity_tenant: 'admin',
|
||||
identity_uri: 'http://127.0.0.1:5000/v3',
|
||||
identity_user_domain_name: 'default',
|
||||
identity_project_domain_name: 'default',
|
||||
image_name: 'cirros-test1',
|
||||
image_id: '1ac790f6-903a-4833-979f-a38f1819e3b1',
|
||||
image_url: 'http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img'
|
||||
)
|
||||
end
|
||||
|
||||
it 'uploads image2' do
|
||||
expect(chef_run).to upload_openstack_image_image('image2').with(
|
||||
identity_user: 'admin',
|
||||
identity_pass: 'admin',
|
||||
identity_tenant: 'admin',
|
||||
identity_uri: 'http://127.0.0.1:5000/v3',
|
||||
identity_user_domain_name: 'default',
|
||||
identity_project_domain_name: 'default',
|
||||
image_name: 'cirros-test2',
|
||||
image_id: 'f7c2ac6d-0011-499f-a9ec-ca71348bf2e4',
|
||||
image_url: 'http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img'
|
||||
)
|
||||
end
|
||||
|
||||