Start Stein development
- Update references from Rocky to Stein. - Switch to using chef-workstation - Exclude integration group from Berksfile. This is to ensure ChefSpec tests should always work regardless if we're working on integration related cookbooks that don't interact with those tests. - Temporarily disable voting for integration tests due to cookbook version conflicts - Add tests for openstack-common::etcd and openstack-common::completions - Update tests for Stein - Update OVS port to check - Add tests for lbaas but only for kitchen, not for CI pipeline - Add suite and tests for integration-test Change-Id: Id451b08e361acc709879a65d0d92b35640a5dba9
This commit is contained in:
parent
1fe9d31295
commit
5111603bb5
|
@ -1,5 +1,5 @@
|
||||||
[local_phases]
|
[local_phases]
|
||||||
unit = 'berks vendor cookbooks'
|
unit = 'berks vendor -e integration cookbooks'
|
||||||
lint = 'cookstyle --display-cop-names --extra-details'
|
lint = 'cookstyle --display-cop-names --extra-details'
|
||||||
syntax = "./scripts/json_check.sh"
|
syntax = "./scripts/json_check.sh"
|
||||||
provision = "echo skipping"
|
provision = "echo skipping"
|
||||||
|
|
19
.kitchen.yml
19
.kitchen.yml
|
@ -65,6 +65,7 @@ suites:
|
||||||
run_list:
|
run_list:
|
||||||
- recipe[openstack_test]
|
- recipe[openstack_test]
|
||||||
- role[common]
|
- role[common]
|
||||||
|
- role[common_test]
|
||||||
- name: openstackclient
|
- name: openstackclient
|
||||||
run_list:
|
run_list:
|
||||||
- recipe[openstack_test]
|
- recipe[openstack_test]
|
||||||
|
@ -90,8 +91,21 @@ suites:
|
||||||
- name: network
|
- name: network
|
||||||
run_list:
|
run_list:
|
||||||
- recipe[openstack_test]
|
- recipe[openstack_test]
|
||||||
|
- role[identity]
|
||||||
|
- recipe[openstack-network::lbaas]
|
||||||
- role[network]
|
- role[network]
|
||||||
- role[network_test]
|
- role[network_test]
|
||||||
|
attributes:
|
||||||
|
openstack:
|
||||||
|
network:
|
||||||
|
conf:
|
||||||
|
DEFAULT:
|
||||||
|
service_plugins: 'router,neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2'
|
||||||
|
network_lbaas:
|
||||||
|
enabled: true
|
||||||
|
verifier:
|
||||||
|
inspec_tests:
|
||||||
|
- path: test/integration/network-optional/inspec
|
||||||
- name: compute
|
- name: compute
|
||||||
run_list:
|
run_list:
|
||||||
- recipe[openstack_test]
|
- recipe[openstack_test]
|
||||||
|
@ -127,3 +141,8 @@ suites:
|
||||||
- recipe[openstack_test]
|
- recipe[openstack_test]
|
||||||
- role[dashboard]
|
- role[dashboard]
|
||||||
- role[dashboard_test]
|
- role[dashboard_test]
|
||||||
|
- name: integration
|
||||||
|
run_list:
|
||||||
|
- recipe[openstack_test]
|
||||||
|
- role[integration]
|
||||||
|
- role[integration_test]
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
inherit_from: .rubocop_todo.yml
|
|
||||||
|
|
||||||
AllCops:
|
AllCops:
|
||||||
Include:
|
Include:
|
||||||
- '**/*.rb'
|
- '**/*.rb'
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
# This configuration was generated by
|
|
||||||
# `rubocop --auto-gen-config`
|
|
||||||
# on 2017-12-22 17:48:38 -0800 using RuboCop version 0.49.1.
|
|
||||||
# The point is for the user to remove these configuration records
|
|
||||||
# one by one as the offenses are removed from the code base.
|
|
||||||
# Note that changes in the inspected code, or installation of new
|
|
||||||
# versions of RuboCop, may require this file to be generated again.
|
|
||||||
|
|
||||||
# Offense count: 1
|
|
||||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
||||||
# SupportedStyles: for, each
|
|
||||||
Style/For:
|
|
||||||
Exclude:
|
|
||||||
- 'Rakefile'
|
|
29
.zuul.yaml
29
.zuul.yaml
|
@ -6,7 +6,6 @@
|
||||||
pre-run: playbooks/pre-delivery.yaml
|
pre-run: playbooks/pre-delivery.yaml
|
||||||
run: playbooks/delivery.yaml
|
run: playbooks/delivery.yaml
|
||||||
timeout: 1800
|
timeout: 1800
|
||||||
voting: false
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: openstack-chef-integration-ubuntu
|
name: openstack-chef-integration-ubuntu
|
||||||
|
@ -18,7 +17,7 @@
|
||||||
run: playbooks/integration.yaml
|
run: playbooks/integration.yaml
|
||||||
post-run: playbooks/post.yaml
|
post-run: playbooks/post.yaml
|
||||||
timeout: 5400
|
timeout: 5400
|
||||||
voting: false
|
voting: false # TODO(ramereth): Remove after this gets merged
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: openstack-chef-minimal-integration-ubuntu
|
name: openstack-chef-minimal-integration-ubuntu
|
||||||
|
@ -42,7 +41,7 @@
|
||||||
run: playbooks/integration.yaml
|
run: playbooks/integration.yaml
|
||||||
post-run: playbooks/post.yaml
|
post-run: playbooks/post.yaml
|
||||||
timeout: 5400
|
timeout: 5400
|
||||||
voting: false
|
voting: false # TODO(ramereth): Remove after this gets merged
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: openstack-chef-minimal-integration-centos
|
name: openstack-chef-minimal-integration-centos
|
||||||
|
@ -56,6 +55,20 @@
|
||||||
timeout: 5400
|
timeout: 5400
|
||||||
voting: false
|
voting: false
|
||||||
|
|
||||||
|
- project-template:
|
||||||
|
name: openstack-chef-repo-jobs
|
||||||
|
check:
|
||||||
|
jobs:
|
||||||
|
- openstack-chef-delivery
|
||||||
|
- openstack-chef-integration-ubuntu
|
||||||
|
- openstack-chef-integration-centos
|
||||||
|
gate:
|
||||||
|
queue: openstack-chef
|
||||||
|
jobs:
|
||||||
|
- openstack-chef-delivery
|
||||||
|
#- openstack-chef-integration-ubuntu
|
||||||
|
#- openstack-chef-integration-centos
|
||||||
|
|
||||||
- project-template:
|
- project-template:
|
||||||
name: openstack-chef-jobs
|
name: openstack-chef-jobs
|
||||||
check:
|
check:
|
||||||
|
@ -69,13 +82,13 @@
|
||||||
queue: openstack-chef
|
queue: openstack-chef
|
||||||
jobs:
|
jobs:
|
||||||
- openstack-chef-delivery
|
- openstack-chef-delivery
|
||||||
- openstack-chef-integration-ubuntu
|
#- openstack-chef-integration-ubuntu
|
||||||
- openstack-chef-integration-centos
|
#- openstack-chef-integration-centos
|
||||||
- openstack-chef-minimal-integration-ubuntu
|
#- openstack-chef-minimal-integration-ubuntu
|
||||||
- openstack-chef-minimal-integration-centos
|
#- openstack-chef-minimal-integration-centos
|
||||||
|
|
||||||
- project:
|
- project:
|
||||||
templates:
|
templates:
|
||||||
- deploy-guide-jobs
|
- deploy-guide-jobs
|
||||||
- publish-openstack-docs-pti
|
- publish-openstack-docs-pti
|
||||||
- openstack-chef-jobs
|
- openstack-chef-repo-jobs
|
||||||
|
|
12
README.rst
12
README.rst
|
@ -17,7 +17,7 @@ Architectures and a sane example on how to start with OpenStack using
|
||||||
Chef.
|
Chef.
|
||||||
|
|
||||||
With the ``master`` branch of the cookbooks, which is currently tied to
|
With the ``master`` branch of the cookbooks, which is currently tied to
|
||||||
the base OpenStack Rocky release, this supports deploying to Ubuntu
|
the base OpenStack Stein release, this supports deploying to Ubuntu
|
||||||
18.04 and CentOS 7 in monolithic, or allinone, and non-HA multinode
|
18.04 and CentOS 7 in monolithic, or allinone, and non-HA multinode
|
||||||
configurations with Neutron. The cookbooks support a fully HA
|
configurations with Neutron. The cookbooks support a fully HA
|
||||||
configuration, but we do not test for that as there are far numerous
|
configuration, but we do not test for that as there are far numerous
|
||||||
|
@ -30,10 +30,10 @@ Prerequisites
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
- Chef 15 or higher
|
- Chef 15 or higher
|
||||||
- `ChefDK`_ 3.2.30 or later
|
- `Chef Workstation`_ 0.15.18 or later
|
||||||
- `Vagrant`_ 2.0 or later with `VirtualBox>`_ or some other provider
|
- `Vagrant`_ 2.0 or later with `VirtualBox>`_ or some other provider
|
||||||
|
|
||||||
.. _ChefDK: https://downloads.chef.io/chef-dk/
|
.. _Chef Workstation: https://downloads.chef.io/chef-workstation/
|
||||||
.. _Vagrant: https://www.vagrantup.com/downloads.html
|
.. _Vagrant: https://www.vagrantup.com/downloads.html
|
||||||
.. _VirtualBox: https://www.virtualbox.org/wiki/Downloads
|
.. _VirtualBox: https://www.virtualbox.org/wiki/Downloads
|
||||||
|
|
||||||
|
@ -79,8 +79,8 @@ proof of concept deployments.
|
||||||
Kitchen Test Scenarios
|
Kitchen Test Scenarios
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
Initialize the ChefDK
|
Initialize Chef Workstation
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ Verifying OpenStack With Tempest
|
||||||
If you log in to the ``controller`` machine you can test via the most
|
If you log in to the ``controller`` machine you can test via the most
|
||||||
recent `Tempest`_ release.
|
recent `Tempest`_ release.
|
||||||
|
|
||||||
.. _Tempest: https://github.com/openstack/tempest
|
.. _Tempest: https://opendev.org/openstack/tempest
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
|
|
6
Rakefile
6
Rakefile
|
@ -165,14 +165,12 @@ task integration: %i(create_key berks_vendor) do
|
||||||
'minimal'
|
'minimal'
|
||||||
when 'cookbook_openstackclient'
|
when 'cookbook_openstackclient'
|
||||||
'openstackclient'
|
'openstackclient'
|
||||||
|
when 'integration_test'
|
||||||
|
'integration'
|
||||||
else
|
else
|
||||||
project_name
|
project_name
|
||||||
end
|
end
|
||||||
if ENV['CHEF_MINIMAL'] == 'yes'
|
if ENV['CHEF_MINIMAL'] == 'yes'
|
||||||
if project_name == 'minimal'
|
|
||||||
puts 'Project is openstack-chef, no need to run this job twice so exiting...'
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
# If CHEF_MINIMAL is set, then let's assume we're running the full minimal suite
|
# If CHEF_MINIMAL is set, then let's assume we're running the full minimal suite
|
||||||
project_name = 'minimal'
|
project_name = 'minimal'
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,25 +18,29 @@ Releases Summary
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
| 9.y.z | Icehouse | no - EOL (2015-07-02) |
|
| 9.y.z | Icehouse | no - EOL (2015-07-02) |
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
| 10.z.y | Juno | no - EOL (2015-12-07) |
|
| 10.y.z | Juno | no - EOL (2015-12-07) |
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
| 11.z.y | Kilo | no - EOL (2016-05-02) |
|
| 11.y.z | Kilo | no - EOL (2016-05-02) |
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
| 12.z.y | Liberty | no - EOL (2016-11-17) |
|
| 12.y.z | Liberty | no - EOL (2016-11-17) |
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
| 13.z.y | Mitaka | no - EOL (2017-04-10) |
|
| 13.y.z | Mitaka | no - EOL (2017-04-10) |
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
| 14.z.y | Newton | no - EOL (2017-10-11) |
|
| 14.y.z | Newton | no - EOL (2017-10-11) |
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
| 15.z.y | Ocata | no - Extended Maint. |
|
| 15.y.z | Ocata | no - EOL (2019-12-12) |
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
| 16.z.y | Pike | yes |
|
| 16.y.z | Pike | no - EOL (2019-12-12) |
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
| 17.z.y | Queens | yes |
|
| 17.y.z | Queens | yes |
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
| 18.z.y | Rocky | yes (current master) |
|
| 18.y.z | Rocky | yes |
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
| 19.z.y | Stein | Future |
|
| 19.y.z | Stein | yes (current master) |
|
||||||
|
+----------------------------+------------------------------+------------------------+
|
||||||
|
| 20.y.z | Train | Future |
|
||||||
|
+----------------------------+------------------------------+------------------------+
|
||||||
|
| 21.y.z | Ussuri | Future |
|
||||||
+----------------------------+------------------------------+------------------------+
|
+----------------------------+------------------------------+------------------------+
|
||||||
|
|
||||||
Supermarket releases
|
Supermarket releases
|
||||||
|
@ -51,8 +55,8 @@ How to release Chef cookbooks
|
||||||
|
|
||||||
- A core member will create the new branch based on the desired SHA.
|
- A core member will create the new branch based on the desired SHA.
|
||||||
Example: https://review.openstack.org/#/admin/projects/openstack/cookbook-openstack-compute,branches
|
Example: https://review.openstack.org/#/admin/projects/openstack/cookbook-openstack-compute,branches
|
||||||
- For all cookbooks to be released: update .gitreview, Berksfile,
|
- For all cookbooks to be released: update .gitreview and Berksfile
|
||||||
and bootstrap.sh to stable/<release>
|
to stable/<release>
|
||||||
Example: https://review.openstack.org/547505
|
Example: https://review.openstack.org/547505
|
||||||
- Create a review with the above and propose it against the stable/<release> branch.
|
- Create a review with the above and propose it against the stable/<release> branch.
|
||||||
- Solicit for reviews and approval.
|
- Solicit for reviews and approval.
|
||||||
|
|
|
@ -4,14 +4,12 @@ Supported Platforms
|
||||||
The following operating systems and versions are supported by the OpenStack cookbooks:
|
The following operating systems and versions are supported by the OpenStack cookbooks:
|
||||||
|
|
||||||
* Ubuntu 18.04 LTS (Bionic Beaver)
|
* Ubuntu 18.04 LTS (Bionic Beaver)
|
||||||
|
* CentOS 7
|
||||||
|
|
||||||
The cookbooks are tested and verified to work on the Chef stable track using
|
The cookbooks are tested and verified to work on the Chef stable track using
|
||||||
the `Chef Development Kit <https://docs.chef.io/about_chefdk.html>`_.
|
the `Chef Workstation <https://www.chef.sh/docs/chef-workstation/getting-started/>`_.
|
||||||
|
|
||||||
Support for RHEL / CentOS 7 is mostly still present, but currently not maintained or
|
Your success rate may vary with the bleeding edge. Chef 14 and older is NOT
|
||||||
tested. Contributions are welcome.
|
|
||||||
|
|
||||||
Your success rate may vary with the bleeding edge. Chef 12 and older is NOT
|
|
||||||
supported.
|
supported.
|
||||||
|
|
||||||
Have a look at
|
Have a look at
|
||||||
|
|
|
@ -19,8 +19,8 @@ import openstackdocstheme
|
||||||
# -- Chef OpenStack configuration --------------------------------------------
|
# -- Chef OpenStack configuration --------------------------------------------
|
||||||
target_name = 'openstack-chef'
|
target_name = 'openstack-chef'
|
||||||
description = 'Chef OpenStack uses Chef to deploy OpenStack environments.'
|
description = 'Chef OpenStack uses Chef to deploy OpenStack environments.'
|
||||||
previous_series_name = 'queens'
|
previous_series_name = 'rocky'
|
||||||
current_series_name = 'rocky'
|
current_series_name = 'stein'
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,15 @@
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"openstack": {
|
||||||
|
"network": {
|
||||||
|
"conf": {
|
||||||
|
"DEFAULT": {
|
||||||
|
"service_plugins": "router"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"yum": {
|
"yum": {
|
||||||
"epel": {
|
"epel": {
|
||||||
"baseurl": "http://epel.osuosl.org/7/$basearch",
|
"baseurl": "http://epel.osuosl.org/7/$basearch",
|
||||||
|
@ -37,13 +46,6 @@
|
||||||
"mq": {
|
"mq": {
|
||||||
"user": "admin"
|
"user": "admin"
|
||||||
},
|
},
|
||||||
"network": {
|
|
||||||
"conf": {
|
|
||||||
"DEFAULT": {
|
|
||||||
"service_plugins": "router"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"image": {
|
"image": {
|
||||||
"image_upload": true
|
"image_upload": true
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,16 +6,19 @@
|
||||||
|
|
||||||
- hosts: all
|
- hosts: all
|
||||||
vars:
|
vars:
|
||||||
release: 3.2.30
|
release: 0.15.18
|
||||||
chefdk: chefdk_{{ release }}-1_amd64.deb
|
chef_workstation: chef-workstation_{{ release }}-1_amd64.deb
|
||||||
tasks:
|
tasks:
|
||||||
- name: Fetch chefdk package
|
- name: Fetch chef-workstation package
|
||||||
get_url:
|
get_url:
|
||||||
dest: /tmp/{{ chefdk }}
|
dest: /tmp/{{ chef_workstation }}
|
||||||
url: https://packages.chef.io/files/stable/chefdk/{{ release }}/ubuntu/18.04/{{ chefdk }}
|
url: https://packages.chef.io/files/stable/chef-workstation/{{ release }}/ubuntu/18.04/{{ chef_workstation }}
|
||||||
- name: Install chefdk package
|
- name: Install chef-workstation package
|
||||||
shell: dpkg -i /tmp/{{ chefdk }}
|
shell: dpkg -i /tmp/{{ chef_workstation }}
|
||||||
|
become: yes
|
||||||
|
- name: Show chef environment, accept chef license as side effect
|
||||||
|
shell: chef env --chef-license accept
|
||||||
become: yes
|
become: yes
|
||||||
- name: Install newer fog-openstack gem
|
- name: Install newer fog-openstack gem
|
||||||
shell: chef gem install fog-openstack --version '~> 1.0.0' --no-user-install --no-ri --no-rdoc
|
shell: chef gem install fog-openstack --version '~> 1.0.0' --no-user-install -N
|
||||||
become: yes
|
become: yes
|
||||||
|
|
|
@ -3,5 +3,7 @@
|
||||||
"description": "common cookbook tests",
|
"description": "common cookbook tests",
|
||||||
"override_attributes": {},
|
"override_attributes": {},
|
||||||
"run_list": [
|
"run_list": [
|
||||||
|
"openstack-common::etcd",
|
||||||
|
"openstack-common::completions"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"name": "integration",
|
||||||
|
"description": "Run integration-test cookbook",
|
||||||
|
"run_list": [
|
||||||
|
"role[compute]",
|
||||||
|
"recipe[openstack-integration-test::create_network]",
|
||||||
|
"recipe[openstack-integration-test::dns]",
|
||||||
|
"recipe[openstack-integration-test::orchestration]",
|
||||||
|
"recipe[openstack-integration-test::setup]"
|
||||||
|
]
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
# Use OSUOSL mirrors as they are more stable than upstream
|
# Use OSUOSL mirrors as they are more stable than upstream
|
||||||
execute 'Update /etc/apt/sources.list' do
|
execute 'Update /etc/apt/sources.list' do
|
||||||
command 'sed -i -e "s/archive.ubuntu.com/ubuntu.osuosl.org/g" /etc/apt/sources.list'
|
command 'sed -i -e "s/archive.ubuntu.com/ubuntu.osuosl.org/g" /etc/apt/sources.list'
|
||||||
only_if { node['platform_family'] == 'debian' }
|
only_if { platform_family?('debian') }
|
||||||
not_if 'grep -q ubuntu.osuosl.org /etc/apt/sources.list'
|
not_if 'grep -q ubuntu.osuosl.org /etc/apt/sources.list'
|
||||||
action :nothing
|
action :nothing
|
||||||
end.run_action(:run)
|
end.run_action(:run)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
../../common/inspec/common_spec.rb
|
|
@ -29,7 +29,7 @@ end
|
||||||
|
|
||||||
describe command "#{openrc} cinder-manage db version\"" do
|
describe command "#{openrc} cinder-manage db version\"" do
|
||||||
its('exit_status') { should eq 0 }
|
its('exit_status') { should eq 0 }
|
||||||
its('stdout') { should match /^123$/ }
|
its('stdout') { should match /^128$/ }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe command "#{openrc} openstack user list -f value -c Name\"" do
|
describe command "#{openrc} openstack user list -f value -c Name\"" do
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
# openstack-common::etcd
|
||||||
|
describe service 'etcd-openstack' do
|
||||||
|
it { should be_enabled }
|
||||||
|
it { should be_running }
|
||||||
|
end
|
||||||
|
|
||||||
|
# openstack-common::etcd
|
||||||
|
describe package 'bash-completion' do
|
||||||
|
it { should be_installed }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe file '/etc/bash_completion.d/osc.bash_completion' do
|
||||||
|
it { should exist }
|
||||||
|
its('content') { should match /_openstack/ }
|
||||||
|
end
|
|
@ -10,10 +10,11 @@ os_family = os.family
|
||||||
|
|
||||||
describe command 'openstack --version' do
|
describe command 'openstack --version' do
|
||||||
its('exit_status') { should eq 0 }
|
its('exit_status') { should eq 0 }
|
||||||
|
# RHEL sends output to stderr while Ubuntu sends it to stdout
|
||||||
if os_family == 'redhat'
|
if os_family == 'redhat'
|
||||||
its('stderr') { should match /^openstack 3.16.[0-9]+$/ }
|
its('stderr') { should match /^openstack 3.18.[0-9]+$/ }
|
||||||
else
|
else
|
||||||
its('stdout') { should match /^openstack 3.16.[0-9]+$/ }
|
its('stdout') { should match /^openstack 3.18.[0-9]+$/ }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -33,12 +34,12 @@ if os.family == 'redhat'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe yum.repo('RDO-rocky') do
|
describe yum.repo('RDO-stein') do
|
||||||
it { should exist }
|
it { should exist }
|
||||||
it { should be_enabled }
|
it { should be_enabled }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe yum.repo('RDO-rocky-deps') do
|
describe yum.repo('RDO-stein-deps') do
|
||||||
it { should_not exist }
|
it { should_not exist }
|
||||||
it { should_not be_enabled }
|
it { should_not be_enabled }
|
||||||
end
|
end
|
||||||
|
@ -60,7 +61,7 @@ else
|
||||||
|
|
||||||
# apt InSpec resource is not working properly
|
# apt InSpec resource is not working properly
|
||||||
describe file '/etc/apt/sources.list.d/openstack-ppa.list' do
|
describe file '/etc/apt/sources.list.d/openstack-ppa.list' do
|
||||||
its('content') { should include 'http://ubuntu-cloud.archive.canonical.com/ubuntu bionic-updates/rocky main' }
|
its('content') { should include 'http://ubuntu-cloud.archive.canonical.com/ubuntu bionic-updates/stein main' }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe file '/etc/apt/sources.list.d/openstack-ppa-proposed.list' do
|
describe file '/etc/apt/sources.list.d/openstack-ppa-proposed.list' do
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
../../common/inspec/common_spec.rb
|
|
@ -40,12 +40,12 @@ openrc = 'bash -c "source /root/openrc && '
|
||||||
|
|
||||||
describe command "#{openrc} nova-manage version\"" do
|
describe command "#{openrc} nova-manage version\"" do
|
||||||
its('exit_status') { should eq 0 }
|
its('exit_status') { should eq 0 }
|
||||||
its('stdout') { should match /^18.[0-9]+/ }
|
its('stdout') { should match /^19.[0-9]+/ }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe command "#{openrc} nova-manage db version\"" do
|
describe command "#{openrc} nova-manage db version\"" do
|
||||||
its('exit_status') { should eq 0 }
|
its('exit_status') { should eq 0 }
|
||||||
its('stdout') { should match /^390$/ }
|
its('stdout') { should match /^391$/ }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe command "#{openrc} openstack user list -f value -c Name\"" do
|
describe command "#{openrc} openstack user list -f value -c Name\"" do
|
||||||
|
|
|
@ -36,7 +36,7 @@ end
|
||||||
|
|
||||||
describe command "#{openrc} designate-manage database version\"" do
|
describe command "#{openrc} designate-manage database version\"" do
|
||||||
its('exit_status') { should eq 0 }
|
its('exit_status') { should eq 0 }
|
||||||
its('stdout') { should match /^Current: 100 Latest: 100$/ }
|
its('stdout') { should match /^Current: 102 Latest: 102$/ }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe command "#{openrc} openstack dns service list -f value -c service_name -c status\"" do
|
describe command "#{openrc} openstack dns service list -f value -c service_name -c status\"" do
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
../../common/inspec/common_spec.rb
|
|
@ -0,0 +1 @@
|
||||||
|
../../common/inspec/common_spec.rb
|
|
@ -0,0 +1,96 @@
|
||||||
|
openrc = 'bash -c "source /root/openrc && '
|
||||||
|
|
||||||
|
describe command "#{openrc} openstack network show local_net -f shell -c admin_state_up -c status\"" do
|
||||||
|
its('exit_status') { should eq 0 }
|
||||||
|
its('stdout') { should include 'admin_state_up="UP"' }
|
||||||
|
its('stdout') { should include 'status="ACTIVE"' }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe command "#{openrc} openstack subnet show local_subnet -f shell -c enable_dhcp -c cidr -c allocation_pools\"" do
|
||||||
|
its('exit_status') { should eq 0 }
|
||||||
|
its('stdout') { should include 'allocation_pools="192.168.180.2-192.168.180.254"' }
|
||||||
|
its('stdout') { should include 'cidr="192.168.180.0/24"' }
|
||||||
|
its('stdout') { should include 'enable_dhcp="True"' }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe port '53' do
|
||||||
|
it { should be_listening }
|
||||||
|
its('processes') { should include 'named' }
|
||||||
|
its('protocols') { should include 'tcp' }
|
||||||
|
its('protocols') { should include 'udp' }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe port '953' do
|
||||||
|
it { should be_listening }
|
||||||
|
its('processes') { should include 'named' }
|
||||||
|
its('protocols') { should include 'tcp' }
|
||||||
|
end
|
||||||
|
|
||||||
|
os_family = os.family
|
||||||
|
|
||||||
|
case os_family
|
||||||
|
when 'redhat'
|
||||||
|
service_name = 'named'
|
||||||
|
service_path = 'named'
|
||||||
|
service_user = 'named'
|
||||||
|
when 'debian'
|
||||||
|
service_name = 'bind9'
|
||||||
|
service_path = 'bind'
|
||||||
|
service_user = 'bind'
|
||||||
|
end
|
||||||
|
|
||||||
|
describe service service_name do
|
||||||
|
it { should be_enabled }
|
||||||
|
it { should be_running }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe file "/etc/#{service_path}/rndc.key" do
|
||||||
|
its('owner') { should cmp service_user }
|
||||||
|
its('group') { should cmp service_user }
|
||||||
|
its('mode') { should cmp '0440' }
|
||||||
|
its('content') { should match /secret "nN4XQnMMhIeWpQHz0l6qG5UUj1WMEKLqHJSwl8fcR1I=";/ }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe file "/etc/#{service_path}/named.designate" do
|
||||||
|
its('owner') { should cmp service_user }
|
||||||
|
its('group') { should cmp service_user }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe file '/etc/resolv.conf' do
|
||||||
|
its('content') { should match /nameserver 1.0.0.1/ }
|
||||||
|
its('content') { should match /nameserver 8.8.8.8/ }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe file '/tmp/heat_key.priv' do
|
||||||
|
its('content') { should match /BEGIN RSA PRIVATE KEY/ }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe command "#{openrc} openstack flavor show m1.small\"" do
|
||||||
|
its('exit_status') { should eq 0 }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe file '/tmp/heat.yml' do
|
||||||
|
it { should exist }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe command '/opt/tempest-venv/bin/tempest --version' do
|
||||||
|
its('exit_status') { should eq 0 }
|
||||||
|
case os_family
|
||||||
|
when 'redhat'
|
||||||
|
its('stderr') { should match /^tempest 22.1.0$/ }
|
||||||
|
when 'debian'
|
||||||
|
its('stdout') { should match /^tempest 22.1.0$/ }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe file '/opt/tempest-venv/tempest.sh' do
|
||||||
|
its('mode') { should cmp '0755' }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe file '/opt/tempest/etc/tempest-blacklist' do
|
||||||
|
it { should exist }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe file '/opt/tempest/etc/tempest.conf' do
|
||||||
|
it { should exist }
|
||||||
|
end
|
|
@ -0,0 +1,53 @@
|
||||||
|
openrc = 'bash -c "source /root/openrc && '
|
||||||
|
uuid = /[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}/
|
||||||
|
|
||||||
|
describe command "#{openrc} neutron lbaas-loadbalancer-create --name test-lb -f shell local_subnet\"" do
|
||||||
|
its('exit_status') { should eq 0 }
|
||||||
|
[
|
||||||
|
/^admin_state_up="True"$/,
|
||||||
|
/^name="test-lb"$/,
|
||||||
|
/^provider="haproxy"$/,
|
||||||
|
/^vip_address="192.168.180.[0-9]+"$/,
|
||||||
|
].each do |line|
|
||||||
|
its('stdout') { should match line }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe command "#{openrc} neutron lbaas-loadbalancer-show -f shell test-lb\"" do
|
||||||
|
its('exit_status') { should eq 0 }
|
||||||
|
[
|
||||||
|
/^operating_status="ONLINE"$/,
|
||||||
|
/^provisioning_status="ACTIVE"$/,
|
||||||
|
].each do |line|
|
||||||
|
its('stdout') { should match line }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
lb_listener_opts = '--name test-lb-http --loadbalancer test-lb --protocol HTTP --protocol-port 80 -f shell'
|
||||||
|
describe command "#{openrc} neutron lbaas-listener-create #{lb_listener_opts}\"" do
|
||||||
|
its('exit_status') { should eq 0 }
|
||||||
|
[
|
||||||
|
/^admin_state_up="True"$/,
|
||||||
|
/^loadbalancers="\[{u?'id': u?'#{uuid}'}\]"$/,
|
||||||
|
/^name="test-lb-http"$/,
|
||||||
|
/^protocol="HTTP"$/,
|
||||||
|
/^protocol_port="80"$/,
|
||||||
|
].each do |line|
|
||||||
|
its('stdout') { should match line }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe command "#{openrc} openstack extension list --network -f value -c Alias\"" do
|
||||||
|
its('exit_status') { should eq 0 }
|
||||||
|
%w(
|
||||||
|
hm_max_retries_down
|
||||||
|
l7
|
||||||
|
lbaas_agent_schedulerv2
|
||||||
|
lbaasv2
|
||||||
|
lb-graph
|
||||||
|
lb_network_vip
|
||||||
|
shared_pools
|
||||||
|
).each do |ext|
|
||||||
|
its('stdout') { should match /^#{ext}$/ }
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1 @@
|
||||||
|
../../common/inspec/common_spec.rb
|
|
@ -2,7 +2,7 @@ openrc = 'bash -c "source /root/openrc && '
|
||||||
|
|
||||||
%w(
|
%w(
|
||||||
9696
|
9696
|
||||||
6633
|
6640
|
||||||
).each do |p|
|
).each do |p|
|
||||||
describe port p do
|
describe port p do
|
||||||
it { should be_listening }
|
it { should be_listening }
|
||||||
|
@ -65,6 +65,7 @@ describe command "#{openrc} openstack extension list --network -f value -c Alias
|
||||||
%w(
|
%w(
|
||||||
address-scope
|
address-scope
|
||||||
agent
|
agent
|
||||||
|
agent-resources-synced
|
||||||
allowed-address-pairs
|
allowed-address-pairs
|
||||||
auto-allocated-topology
|
auto-allocated-topology
|
||||||
availability_zone
|
availability_zone
|
||||||
|
@ -79,13 +80,14 @@ describe command "#{openrc} openstack extension list --network -f value -c Alias
|
||||||
ext-gw-mode
|
ext-gw-mode
|
||||||
extra_dhcp_opt
|
extra_dhcp_opt
|
||||||
extraroute
|
extraroute
|
||||||
filter-validation
|
|
||||||
fip-port-details
|
fip-port-details
|
||||||
flavors
|
flavors
|
||||||
|
floatingip-pools
|
||||||
ip-substring-filtering
|
ip-substring-filtering
|
||||||
l3_agent_scheduler
|
l3_agent_scheduler
|
||||||
l3-flavors
|
l3-flavors
|
||||||
l3-ha
|
l3-ha
|
||||||
|
l3-port-ip-change-not-allowed
|
||||||
multi-provider
|
multi-provider
|
||||||
net-mtu
|
net-mtu
|
||||||
net-mtu-writable
|
net-mtu-writable
|
||||||
|
@ -99,6 +101,7 @@ describe command "#{openrc} openstack extension list --network -f value -c Alias
|
||||||
quota_details
|
quota_details
|
||||||
quotas
|
quotas
|
||||||
rbac-policies
|
rbac-policies
|
||||||
|
rbac-security-groups
|
||||||
revision-if-match
|
revision-if-match
|
||||||
router
|
router
|
||||||
router_availability_zone
|
router_availability_zone
|
||||||
|
@ -110,6 +113,7 @@ describe command "#{openrc} openstack extension list --network -f value -c Alias
|
||||||
standard-attr-tag
|
standard-attr-tag
|
||||||
standard-attr-timestamp
|
standard-attr-timestamp
|
||||||
subnet_allocation
|
subnet_allocation
|
||||||
|
subnet_onboard
|
||||||
subnet-service-types
|
subnet-service-types
|
||||||
).each do |ext|
|
).each do |ext|
|
||||||
its('stdout') { should match /^#{ext}$/ }
|
its('stdout') { should match /^#{ext}$/ }
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
../../common/inspec/common_spec.rb
|
|
@ -0,0 +1 @@
|
||||||
|
../../common/inspec/common_spec.rb
|
|
@ -3,7 +3,7 @@
|
||||||
# Test patches against the testing repo
|
# Test patches against the testing repo
|
||||||
#
|
#
|
||||||
# Author: Mark Vanderwiel (<vanderwl@us.ibm.com>)
|
# Author: Mark Vanderwiel (<vanderwl@us.ibm.com>)
|
||||||
# Copyright (c) 2015, IBM, Corp.
|
# Copyright:: (c) 2015, IBM, Corp.
|
||||||
|
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'English'
|
require 'English'
|
||||||
|
|
Loading…
Reference in New Issue