Updates for Train
Added: - Placement service Changed: - Update release to train - Cookstyle fixes - Update to mariadb ~> 4.0 Removed: - Unused rubocop rules Fixed: - ChefSpec for wrapper now correctly works with node.role? Depends-On: https://review.opendev.org/731849 Change-Id: I3e809350541e9c7beab311e5b3e768df1612d9f5
This commit is contained in:
parent
7a370737ba
commit
a45cea15d7
18
.rubocop.yml
18
.rubocop.yml
@ -1,19 +1 @@
|
||||
inherit_from: .rubocop_todo.yml
|
||||
|
||||
AllCops:
|
||||
Include:
|
||||
- ./metadata.rb
|
||||
- ./Gemfile
|
||||
- attributes/**/*
|
||||
- libraries/**/*
|
||||
- providers/**/*
|
||||
- recipes/**/*
|
||||
- resources/**/*
|
||||
- spec/**/*
|
||||
Exclude:
|
||||
- .cookbooks/**/*
|
||||
- berks-cookbooks/**/*
|
||||
- .bundle/**/*
|
||||
|
||||
ChefModernize/DefinesChefSpecMatchers:
|
||||
Enabled: false
|
||||
|
@ -1,11 +1,19 @@
|
||||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config`
|
||||
# on 2020-02-05 22:58:21 +0000 using RuboCop version 0.75.1.
|
||||
# on 2020-05-29 17:26:38 -0700 using RuboCop version 0.82.0.
|
||||
# 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
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: Include.
|
||||
# Include: **/libraries/*.rb
|
||||
ChefModernize/DefinesChefSpecMatchers:
|
||||
Exclude:
|
||||
- 'libraries/matchers.rb'
|
||||
|
||||
# Offense count: 2
|
||||
Lint/NestedMethodDefinition:
|
||||
Exclude:
|
||||
|
@ -24,7 +24,7 @@ Requirements
|
||||
============
|
||||
|
||||
- Chef 15 or higher
|
||||
- Chef Workstation 0.15.18 for testing (also includes berkshelf for
|
||||
- Chef Workstation 0.18.3 for testing (also includes berkshelf for
|
||||
cookbook dependency resolution)
|
||||
|
||||
Platform
|
||||
@ -40,7 +40,7 @@ Cookbooks
|
||||
The following cookbooks are dependencies:
|
||||
|
||||
- 'etcd', '~> 5.6'
|
||||
- 'mariadb', '~> 3.1'
|
||||
- 'mariadb', '~> 4.0'
|
||||
- 'memcached', '~> 6.0'
|
||||
- 'selinux'
|
||||
- 'yum-epel'
|
||||
|
@ -49,6 +49,7 @@ default['openstack']['common']['services'] = {
|
||||
'network' => 'neutron',
|
||||
'object_storage' => 'swift',
|
||||
'orchestration' => 'heat',
|
||||
'placement' => 'placement',
|
||||
'telemetry' => 'ceilometer',
|
||||
'telemetry_metric' => 'gnocchi',
|
||||
'application_catalog' => 'murano',
|
||||
@ -125,7 +126,7 @@ default['openstack']['secret']['user_passwords_data_bag'] = 'user_passwords'
|
||||
# needs.
|
||||
|
||||
# The coordinated release of OpenStack codename
|
||||
default['openstack']['release'] = 'stein'
|
||||
default['openstack']['release'] = 'train'
|
||||
|
||||
# The Ubuntu Cloud Archive has packages for multiple Ubuntu releases. For
|
||||
# more information, see: https://wiki.ubuntu.com/ServerTeam/CloudArchive.
|
||||
|
@ -34,9 +34,23 @@ default['openstack']['bind_service']['mq']['interface'] = nil
|
||||
###################################################################
|
||||
# Services to assign mq attributes for
|
||||
###################################################################
|
||||
services = %w(aodh bare_metal block_storage compute database dns image
|
||||
identity telemetry network orchestration
|
||||
baremetal block-storage)
|
||||
services =
|
||||
%w(
|
||||
aodh
|
||||
bare_metal
|
||||
baremetal
|
||||
block-storage
|
||||
block_storage
|
||||
compute
|
||||
database
|
||||
dns
|
||||
identity
|
||||
image
|
||||
network
|
||||
orchestration
|
||||
placement
|
||||
telemetry
|
||||
)
|
||||
|
||||
###################################################################
|
||||
# Generic default attributes
|
||||
|
@ -100,73 +100,4 @@ if defined?(ChefSpec)
|
||||
@expected_content.empty?
|
||||
end
|
||||
end
|
||||
|
||||
## matchers for openstack_database LWRP
|
||||
def create_openstack_common_database(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:openstack_common_database, :create, resource_name)
|
||||
end
|
||||
|
||||
# database
|
||||
#
|
||||
ChefSpec.define_matcher :database
|
||||
|
||||
def create_database(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:database, :create, resource_name)
|
||||
end
|
||||
|
||||
def drop_database(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:database, :drop, resource_name)
|
||||
end
|
||||
|
||||
def query_database(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:database, :query, resource_name)
|
||||
end
|
||||
|
||||
# database user
|
||||
#
|
||||
ChefSpec.define_matcher :database_user
|
||||
|
||||
def create_database_user(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:database_user, :create, resource_name)
|
||||
end
|
||||
|
||||
def drop_database_user(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:database_user, :drop, resource_name)
|
||||
end
|
||||
|
||||
def grant_database_user(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:database_user, :grant, resource_name)
|
||||
end
|
||||
|
||||
# mysql database
|
||||
#
|
||||
ChefSpec.define_matcher :mysql_database
|
||||
|
||||
def create_mysql_database(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_database, :create, resource_name)
|
||||
end
|
||||
|
||||
def drop_mysql_database(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_database, :drop, resource_name)
|
||||
end
|
||||
|
||||
def query_mysql_database(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_database, :query, resource_name)
|
||||
end
|
||||
|
||||
# mysql database user
|
||||
#
|
||||
ChefSpec.define_matcher :mysql_database_user
|
||||
|
||||
def create_mysql_database_user(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_database_user, :create, resource_name)
|
||||
end
|
||||
|
||||
def drop_mysql_database_user(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_database_user, :drop, resource_name)
|
||||
end
|
||||
|
||||
def grant_mysql_database_user(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_database_user, :grant, resource_name)
|
||||
end
|
||||
end
|
||||
|
@ -23,6 +23,6 @@ module ::Openstack
|
||||
|
||||
# Wrapper method to allow to easier spec testing
|
||||
def role_included?(role)
|
||||
node['roles'].include?(role)
|
||||
node.role?(role)
|
||||
end
|
||||
end
|
||||
|
@ -3,14 +3,14 @@ maintainer 'openstack-chef'
|
||||
maintainer_email 'openstack-discuss@lists.openstack.org'
|
||||
license 'Apache-2.0'
|
||||
description 'Common OpenStack attributes, libraries and recipes.'
|
||||
version '19.0.0'
|
||||
version '20.0.0'
|
||||
|
||||
%w(ubuntu redhat centos).each do |os|
|
||||
supports os
|
||||
end
|
||||
|
||||
depends 'etcd', '~> 5.6'
|
||||
depends 'mariadb', '~> 3.1'
|
||||
depends 'mariadb', '~> 4.0'
|
||||
depends 'memcached', '~> 6.0'
|
||||
depends 'selinux'
|
||||
depends 'yum-epel'
|
||||
|
@ -48,7 +48,7 @@ describe 'openstack-common::default' do
|
||||
# https://github.com/sethvargo/chefspec#packaging-custom-matchers
|
||||
expect(chef_run).to add_apt_repository('openstack-ppa').with(
|
||||
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
|
||||
distribution: 'bionic-updates/stein',
|
||||
distribution: 'bionic-updates/train',
|
||||
components: ['main'],
|
||||
cache_rebuild: true
|
||||
)
|
||||
@ -63,7 +63,7 @@ describe 'openstack-common::default' do
|
||||
it 'disables openstack live updates' do
|
||||
expect(chef_run).to_not add_apt_repository('openstack-ppa').with(
|
||||
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
|
||||
distribution: 'bionic-updates/stein',
|
||||
distribution: 'bionic-updates/train',
|
||||
components: ['main']
|
||||
)
|
||||
end
|
||||
@ -72,7 +72,7 @@ describe 'openstack-common::default' do
|
||||
it 'configures openstack proposed repository' do
|
||||
expect(chef_run).to add_apt_repository('openstack-ppa-proposed').with(
|
||||
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
|
||||
distribution: 'bionic-proposed/stein',
|
||||
distribution: 'bionic-proposed/train',
|
||||
components: ['main'],
|
||||
cache_rebuild: true
|
||||
)
|
||||
@ -86,7 +86,7 @@ describe 'openstack-common::default' do
|
||||
it 'disables openstack proposed repository' do
|
||||
expect(chef_run).to_not add_apt_repository('openstack-ppa-proposed').with(
|
||||
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
|
||||
distribution: 'bionic-proposed/stein',
|
||||
distribution: 'bionic-proposed/train',
|
||||
components: ['main']
|
||||
)
|
||||
end
|
||||
|
@ -2,28 +2,37 @@
|
||||
require_relative 'spec_helper'
|
||||
require ::File.join ::File.dirname(__FILE__), '..', 'libraries', 'wrappers'
|
||||
|
||||
describe 'Openstack wrappers' do
|
||||
let(:subject) { Object.new.extend(Openstack) }
|
||||
|
||||
describe '#recipe_included' do
|
||||
it 'returns boolean for recipe list' do
|
||||
node_hash = {
|
||||
'recipes' => 'included_recipe',
|
||||
}
|
||||
allow(subject).to receive(:node).and_return(node_hash)
|
||||
expect(subject.recipe_included?('included_recipe')).to be_truthy
|
||||
expect(subject.recipe_included?('not_included_recipe')).to be_falsey
|
||||
describe 'openstack-common::default' do
|
||||
describe 'Openstack wrappers' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(CHEFSPEC_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) do
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
end
|
||||
let(:subject) { Object.new.extend(Openstack) }
|
||||
|
||||
describe '#role_included' do
|
||||
it 'returns boolean for role list' do
|
||||
node_hash = {
|
||||
'roles' => 'included_role',
|
||||
}
|
||||
allow(subject).to receive(:node).and_return(node_hash)
|
||||
expect(subject.role_included?('included_role')).to be_truthy
|
||||
expect(subject.role_included?('not_included_role')).to be_falsey
|
||||
include_context 'library-stubs'
|
||||
|
||||
describe '#recipe_included' do
|
||||
it 'returns boolean for recipe list' do
|
||||
node_hash = {
|
||||
'recipes' => 'included_recipe',
|
||||
}
|
||||
allow(subject).to receive(:node).and_return(node_hash)
|
||||
expect(subject.recipe_included?('included_recipe')).to be_truthy
|
||||
expect(subject.recipe_included?('not_included_recipe')).to be_falsey
|
||||
end
|
||||
end
|
||||
|
||||
describe '#role_included' do
|
||||
it 'returns boolean for role list' do
|
||||
node_hash_true = double('node', automatic: { 'roles' => 'included_role' }, role?: true)
|
||||
node_hash_false = double('node', automatic: { 'roles' => 'included_role' }, role?: false)
|
||||
allow(subject).to receive(:node).and_return(node_hash_true)
|
||||
expect(subject.role_included?('included_role')).to be_truthy
|
||||
allow(subject).to receive(:node).and_return(node_hash_false)
|
||||
expect(subject.role_included?('not_included_role')).to be_falsey
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user