Allow packages to be updatable

In order for package updates to occur, package resources need to use
the upgrade action.  This is first phase of blueprint, to get some
consistency, next phase is to allow some update control.

Change-Id: I86750067b47766220f497303b2e187c93aeadc2f
Implements: blueprint allow-package-updates
This commit is contained in:
Mark Vanderwiel 2014-05-02 12:02:54 -05:00
parent 1bc2708cbe
commit 904016e6e8
29 changed files with 105 additions and 101 deletions

View File

@ -1,6 +1,9 @@
# CHANGELOG for cookbook-openstack-network # CHANGELOG for cookbook-openstack-network
This file is used to list changes made in each version of cookbook-openstack-network. This file is used to list changes made in each version of cookbook-openstack-network.
## 9.0.1
* Fix package action to allow updates
## 9.0.0 ## 9.0.0
* Upgrade to Icehouse * Upgrade to Icehouse
* The balancer recipe now includes openstack-network::common * The balancer recipe now includes openstack-network::common

View File

@ -5,7 +5,7 @@ maintainer 'Jay Pipes <jaypipes@gmail.com>'
license 'Apache 2.0' license 'Apache 2.0'
description 'Installs and configures the OpenStack Network API Service and various agents and plugins' description 'Installs and configures the OpenStack Network API Service and various agents and plugins'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '9.0.0' version '9.0.1'
recipe 'openstack-network::client', 'Install packages required for network client' recipe 'openstack-network::client', 'Install packages required for network client'
recipe 'openstack-network::server', 'Installs packages required for a OpenStack Network server' recipe 'openstack-network::server', 'Installs packages required for a OpenStack Network server'
recipe 'openstack-network::openvswitch', 'Installs packages required for OVS' recipe 'openstack-network::openvswitch', 'Installs packages required for OVS'

View File

@ -29,7 +29,8 @@ platform_options = node['openstack']['network']['platform']
platform_options['neutron_lb_packages'].each do |pkg| platform_options['neutron_lb_packages'].each do |pkg|
package pkg do package pkg do
action :install options platform_options['package_overrides']
action :upgrade
end end
end end

View File

@ -52,7 +52,7 @@ end
platform_options['neutron_packages'].each do |pkg| platform_options['neutron_packages'].each do |pkg|
package pkg do package pkg do
options platform_options['package_overrides'] options platform_options['package_overrides']
action :install action :upgrade
end end
end end
@ -60,7 +60,7 @@ db_type = node['openstack']['db']['network']['service_type']
platform_options["#{db_type}_python_packages"].each do |pkg| platform_options["#{db_type}_python_packages"].each do |pkg|
package pkg do package pkg do
options platform_options['package_overrides'] options platform_options['package_overrides']
action :install action :upgrade
end end
end end

View File

@ -29,7 +29,7 @@ main_plugin = node['openstack']['network']['core_plugin_map'][core_plugin.split(
platform_options['neutron_dhcp_packages'].each do |pkg| platform_options['neutron_dhcp_packages'].each do |pkg|
package pkg do package pkg do
options platform_options['package_overrides'] options platform_options['package_overrides']
action :install action :upgrade
end end
end end
@ -45,7 +45,7 @@ end
# Python package and include the plugin-specific recipe here... # Python package and include the plugin-specific recipe here...
package platform_options['neutron_plugin_package'].gsub('%plugin%', main_plugin) do package platform_options['neutron_plugin_package'].gsub('%plugin%', main_plugin) do
options platform_options['package_overrides'] options platform_options['package_overrides']
action :install action :upgrade
# plugins are installed by the main openstack-neutron package on SUSE # plugins are installed by the main openstack-neutron package on SUSE
not_if { platform_family? 'suse' } not_if { platform_family? 'suse' }
end end
@ -80,7 +80,7 @@ end
if node['lsb'] && node['lsb']['codename'] == 'precise' && node['openstack']['network']['dhcp']['dnsmasq_compile'] == true if node['lsb'] && node['lsb']['codename'] == 'precise' && node['openstack']['network']['dhcp']['dnsmasq_compile'] == true
platform_options['neutron_dhcp_build_packages'].each do |pkg| platform_options['neutron_dhcp_build_packages'].each do |pkg|
package pkg do package pkg do
action :install action :upgrade
end end
end end

View File

@ -29,7 +29,7 @@ main_plugin = node['openstack']['network']['core_plugin_map'][core_plugin.split(
platform_options['neutron_l3_packages'].each do |pkg| platform_options['neutron_l3_packages'].each do |pkg|
package pkg do package pkg do
options platform_options['package_overrides'] options platform_options['package_overrides']
action :install action :upgrade
# The providers below do not use the generic L3 agent... # The providers below do not use the generic L3 agent...
not_if { ['nicira', 'plumgrid', 'bigswitch'].include?(main_plugin) } not_if { ['nicira', 'plumgrid', 'bigswitch'].include?(main_plugin) }
end end

View File

@ -27,7 +27,7 @@ platform_options = node['openstack']['network']['platform']
platform_options['neutron_linuxbridge_agent_packages'].each do |pkg| platform_options['neutron_linuxbridge_agent_packages'].each do |pkg|
package pkg do package pkg do
options platform_options['package_overrides'] options platform_options['package_overrides']
action :install action :upgrade
end end
end end

View File

@ -44,7 +44,7 @@ end
platform_options['neutron_metadata_agent_packages'].each do |pkg| platform_options['neutron_metadata_agent_packages'].each do |pkg|
package pkg do package pkg do
action :install action :upgrade
options platform_options['package_overrides'] options platform_options['package_overrides']
end end
end end

View File

@ -40,7 +40,7 @@ if platform_family?('debian')
kernel_ver = node['kernel']['release'] kernel_ver = node['kernel']['release']
package "linux-headers-#{kernel_ver}" do package "linux-headers-#{kernel_ver}" do
options platform_options['package_overrides'] options platform_options['package_overrides']
action :install action :upgrade
end end
end end
@ -53,7 +53,7 @@ else
platform_options['neutron_openvswitch_packages'].each do |pkg| platform_options['neutron_openvswitch_packages'].each do |pkg|
package pkg do package pkg do
options platform_options['package_overrides'] options platform_options['package_overrides']
action :install action :upgrade
end end
end end
end end
@ -92,7 +92,7 @@ end
platform_options['neutron_openvswitch_agent_packages'].each do |pkg| platform_options['neutron_openvswitch_agent_packages'].each do |pkg|
package pkg do package pkg do
action :install action :upgrade
options platform_options['package_overrides'] options platform_options['package_overrides']
end end
end end
@ -129,7 +129,7 @@ end
if node['openstack']['network']['disable_offload'] if node['openstack']['network']['disable_offload']
package 'ethtool' do package 'ethtool' do
action :install action :upgrade
options platform_options['package_overrides'] options platform_options['package_overrides']
end end

View File

@ -34,7 +34,7 @@ core_plugin = node['openstack']['network']['core_plugin']
platform_options['neutron_server_packages'].each do |pkg| platform_options['neutron_server_packages'].each do |pkg|
package pkg do package pkg do
options platform_options['package_overrides'] options platform_options['package_overrides']
action :install action :upgrade
end end
end end

View File

@ -14,8 +14,8 @@ describe 'openstack-network::balancer' do
include_context 'neutron-stubs' include_context 'neutron-stubs'
['haproxy', 'openstack-neutron'].each do |pack| ['haproxy', 'openstack-neutron'].each do |pack|
it "installs #{pack} package" do it "upgrades #{pack} package" do
expect(chef_run).to install_package(pack) expect(chef_run).to upgrade_package(pack)
end end
end end

View File

@ -14,8 +14,8 @@ describe 'openstack-network::balancer' do
include_context 'neutron-stubs' include_context 'neutron-stubs'
['openstack-neutron-lbaas-agent'].each do |pack| ['openstack-neutron-lbaas-agent'].each do |pack|
it "installs #{pack} package" do it "upgrades #{pack} package" do
expect(chef_run).to install_package(pack) expect(chef_run).to upgrade_package(pack)
end end
end end

View File

@ -17,15 +17,15 @@ describe 'openstack-network::balancer' do
expect(chef_run.service('neutron-lb-agent')).to subscribe_to('template[/etc/neutron/neutron.conf]').delayed expect(chef_run.service('neutron-lb-agent')).to subscribe_to('template[/etc/neutron/neutron.conf]').delayed
end end
it 'does not install neutron-lbaas-agent when nova networking.' do it 'does not upgrade neutron-lbaas-agent when nova networking.' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package('neutron-lbaas-agent') expect(chef_run).to_not upgrade_package('neutron-lbaas-agent')
end end
['haproxy', 'neutron-lbaas-agent'].each do |pack| ['haproxy', 'neutron-lbaas-agent'].each do |pack|
it "installs #{pack} package" do it "upgrades #{pack} package" do
expect(chef_run).to install_package(pack) expect(chef_run).to upgrade_package(pack)
end end
end end

View File

@ -9,7 +9,7 @@ describe 'openstack-network::client' do
runner.converge(described_recipe) runner.converge(described_recipe)
end end
it 'installs packages' do it 'upgrades python neutron client package' do
expect(chef_run).to upgrade_package('python-neutronclient') expect(chef_run).to upgrade_package('python-neutronclient')
end end
end end

View File

@ -9,7 +9,7 @@ describe 'openstack-network::client' do
runner.converge(described_recipe) runner.converge(described_recipe)
end end
it 'installs packages' do it 'upgrades python neutron client package' do
expect(chef_run).to upgrade_package('python-neutronclient') expect(chef_run).to upgrade_package('python-neutronclient')
expect(chef_run).to upgrade_package('python-pyparsing') expect(chef_run).to upgrade_package('python-pyparsing')
end end

View File

@ -13,15 +13,15 @@ describe 'openstack-network::common' do
include_context 'neutron-stubs' include_context 'neutron-stubs'
it 'installs mysql python packages by default' do it 'upgrades mysql python package' do
expect(chef_run).to install_package('MySQL-python') expect(chef_run).to upgrade_package('MySQL-python')
end end
it 'installs db2 python packages if explicitly told' do it 'upgrades db2 python packages if explicitly told' do
node.set['openstack']['db']['network']['service_type'] = 'db2' node.set['openstack']['db']['network']['service_type'] = 'db2'
['python-ibm-db', 'python-ibm-db-sa'].each do |pkg| ['python-ibm-db', 'python-ibm-db-sa'].each do |pkg|
expect(chef_run).to install_package(pkg) expect(chef_run).to upgrade_package(pkg)
end end
end end
end end

View File

@ -13,22 +13,22 @@ describe 'openstack-network::common' do
include_context 'neutron-stubs' include_context 'neutron-stubs'
it 'does not install python-neutronclient when nova networking' do it 'does not upgrade python-neutronclient when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package('python-neutronclient') expect(chef_run).to_not upgrade_package('python-neutronclient')
end end
it 'upgrades python neutronclient' do it 'upgrades python neutronclient package' do
expect(chef_run).to upgrade_package('python-neutronclient') expect(chef_run).to upgrade_package('python-neutronclient')
end end
it 'upgrades python pyparsing' do it 'upgrades python pyparsing package' do
expect(chef_run).to upgrade_package('python-pyparsing') expect(chef_run).to upgrade_package('python-pyparsing')
end end
it 'installs mysql python packages by default' do it 'upgrades mysql python package' do
expect(chef_run).to install_package('python-mysqldb') expect(chef_run).to upgrade_package('python-mysqldb')
end end
describe 'neutron.conf' do describe 'neutron.conf' do

View File

@ -16,16 +16,16 @@ describe 'openstack-network::dhcp_agent' do
it 'does not install openstack-neutron-dhcp-agent when nova networking' do it 'does not install openstack-neutron-dhcp-agent when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package('openstack-neutron-dhcp-agent') expect(chef_run).to_not upgrade_package('openstack-neutron-dhcp-agent')
end end
it 'installs quamtum dhcp package' do it 'upgrades neutron dhcp package' do
expect(chef_run).to install_package('openstack-neutron-dhcp-agent') expect(chef_run).to upgrade_package('openstack-neutron-dhcp-agent')
end end
it 'installs plugin packages' do it 'upgrades plugin packages' do
expect(chef_run).not_to install_package(/openvswitch/) expect(chef_run).not_to upgrade_package(/openvswitch/)
expect(chef_run).not_to install_package(/plugin/) expect(chef_run).not_to upgrade_package(/plugin/)
end end
it 'starts the dhcp agent on boot' do it 'starts the dhcp agent on boot' do

View File

@ -24,9 +24,9 @@ describe 'openstack-network::dhcp_agent' do
# since our mocked version of ubuntu is precise, our compile # since our mocked version of ubuntu is precise, our compile
# utilities should be installed to build dnsmasq # utilities should be installed to build dnsmasq
it 'installs dnsmasq build dependencies' do it 'upgrades dnsmasq build dependencies' do
%w(build-essential pkg-config libidn11-dev libdbus-1-dev libnetfilter-conntrack-dev gettext).each do |pkg| %w(build-essential pkg-config libidn11-dev libdbus-1-dev libnetfilter-conntrack-dev gettext).each do |pkg|
expect(chef_run).to install_package pkg expect(chef_run).to upgrade_package pkg
end end
end end
@ -34,16 +34,16 @@ describe 'openstack-network::dhcp_agent' do
node.set['openstack']['network']['dhcp']['dnsmasq_compile'] = false node.set['openstack']['network']['dhcp']['dnsmasq_compile'] = false
%w(build-essential pkg-config libidn11-dev libdbus-1-dev libnetfilter-conntrack-dev gettext).each do |pkg| %w(build-essential pkg-config libidn11-dev libdbus-1-dev libnetfilter-conntrack-dev gettext).each do |pkg|
expect(chef_run).to_not install_package pkg expect(chef_run).to_not upgrade_package pkg
end end
end end
it 'installs neutron dhcp package' do it 'upgrades neutron dhcp package' do
expect(chef_run).to install_package 'neutron-dhcp-agent' expect(chef_run).to upgrade_package 'neutron-dhcp-agent'
end end
it 'installs plugin packages' do it 'upgrades plugin package' do
expect(chef_run).to install_package 'neutron-plugin-ml2' expect(chef_run).to upgrade_package 'neutron-plugin-ml2'
end end
it 'starts the dhcp agent on boot' do it 'starts the dhcp agent on boot' do

View File

@ -26,11 +26,11 @@ describe 'openstack-network::l3_agent' do
it 'does not install neutron l3 package when nova networking' do it 'does not install neutron l3 package when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package('neutron-l3-agent') expect(chef_run).to_not upgrade_package('neutron-l3-agent')
end end
it 'installs quamtum l3 package' do it 'upgrades neutron l3 package' do
expect(chef_run).to install_package('neutron-l3-agent') expect(chef_run).to upgrade_package('neutron-l3-agent')
end end
describe 'l3_agent.ini' do describe 'l3_agent.ini' do

View File

@ -19,11 +19,11 @@ describe 'openstack-network::linuxbridge' do
it 'does not install linuxbridge agent package when nova networking' do it 'does not install linuxbridge agent package when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package('openstack-neutron-linuxbridge') expect(chef_run).to_not upgrade_package('openstack-neutron-linuxbridge')
end end
it 'installs linuxbridge agent' do it 'upgrades linuxbridge agent' do
expect(chef_run).to install_package('openstack-neutron-linuxbridge') expect(chef_run).to upgrade_package('openstack-neutron-linuxbridge')
end end
it 'sets the linuxbridge service to start on boot' do it 'sets the linuxbridge service to start on boot' do

View File

@ -18,11 +18,11 @@ describe 'openstack-network::linuxbridge' do
it 'does not install linuxbridge agent package when nova networking' do it 'does not install linuxbridge agent package when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package('openstack-neutron-linuxbridge-agent') expect(chef_run).to_not upgrade_package('openstack-neutron-linuxbridge-agent')
end end
it 'installs linuxbridge agent' do it 'upgrades linuxbridge agent' do
expect(chef_run).to install_package('openstack-neutron-linuxbridge-agent') expect(chef_run).to upgrade_package('openstack-neutron-linuxbridge-agent')
end end
it 'sets the linuxbridge service to start on boot' do it 'sets the linuxbridge service to start on boot' do

View File

@ -18,11 +18,11 @@ describe 'openstack-network::linuxbridge' do
it 'does not install linuxbridge agent package when nova networking' do it 'does not install linuxbridge agent package when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package('neutron-plugin-linuxbridge-agent') expect(chef_run).to_not upgrade_package('neutron-plugin-linuxbridge-agent')
end end
it 'installs linuxbridge agent' do it 'upgrades linuxbridge agent' do
expect(chef_run).to install_package('neutron-plugin-linuxbridge-agent') expect(chef_run).to upgrade_package('neutron-plugin-linuxbridge-agent')
end end
it 'sets the linuxbridge service to start on boot' do it 'sets the linuxbridge service to start on boot' do

View File

@ -12,14 +12,14 @@ describe 'openstack-network::metadata_agent' do
include_context 'neutron-stubs' include_context 'neutron-stubs'
it 'does not install quamtum metadata agent when nova networking' do it 'does not install neutron metadata agent when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package 'neutron-metadata-agent' expect(chef_run).to_not upgrade_package 'neutron-metadata-agent'
end end
it 'installs quamtum metadata agent' do it 'upgrades neutron metadata agent' do
expect(chef_run).to install_package 'neutron-metadata-agent' expect(chef_run).to upgrade_package 'neutron-metadata-agent'
end end
it 'subscribes the metadata agent service to neutron.conf' do it 'subscribes the metadata agent service to neutron.conf' do

View File

@ -16,15 +16,15 @@ describe 'openstack-network::openvswitch' do
it 'does not install openvswitch package when nova networking' do it 'does not install openvswitch package when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package 'openvswitch-switch' expect(chef_run).to_not upgrade_package 'openvswitch-switch'
end end
it 'installs the openvswitch package' do it 'upgrades the openvswitch package' do
expect(chef_run).to install_package 'openvswitch-switch' expect(chef_run).to upgrade_package 'openvswitch-switch'
end end
it 'installs the openvswitch-agent package' do it 'upgrades the openvswitch-agent package' do
expect(chef_run).to install_package 'openstack-neutron-openvswitch-agent' expect(chef_run).to upgrade_package 'openstack-neutron-openvswitch-agent'
end end
it 'starts the openvswitch-switch service' do it 'starts the openvswitch-switch service' do

View File

@ -21,23 +21,23 @@ describe 'openstack-network::openvswitch' do
it 'does not install openvswitch switch when nova networking' do it 'does not install openvswitch switch when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package 'openvswitch-switch' expect(chef_run).to_not upgrade_package 'openvswitch-switch'
end end
it 'installs openvswitch switch' do it 'upgrades openvswitch switch' do
expect(chef_run).to install_package 'openvswitch-switch' expect(chef_run).to upgrade_package 'openvswitch-switch'
end end
it 'installs openvswitch datapath dkms' do it 'upgrades openvswitch datapath dkms' do
expect(chef_run).to install_package 'openvswitch-datapath-dkms' expect(chef_run).to upgrade_package 'openvswitch-datapath-dkms'
end end
it 'installs linux bridge utils' do it 'upgrades linux bridge utils' do
expect(chef_run).to install_package 'bridge-utils' expect(chef_run).to upgrade_package 'bridge-utils'
end end
it 'installs linux linux headers' do it 'upgrades linux linux headers' do
expect(chef_run).to install_package 'linux-headers-1.2.3' expect(chef_run).to upgrade_package 'linux-headers-1.2.3'
end end
it 'sets the openvswitch service to start on boot' do it 'sets the openvswitch service to start on boot' do
@ -52,8 +52,8 @@ describe 'openstack-network::openvswitch' do
expect(chef_run.service('neutron-plugin-openvswitch-agent')).to subscribe_to('template[/etc/neutron/neutron.conf]').delayed expect(chef_run.service('neutron-plugin-openvswitch-agent')).to subscribe_to('template[/etc/neutron/neutron.conf]').delayed
end end
it 'installs openvswitch agent' do it 'upgrades openvswitch agent' do
expect(chef_run).to install_package 'neutron-plugin-openvswitch-agent' expect(chef_run).to upgrade_package 'neutron-plugin-openvswitch-agent'
end end
it 'sets the openvswitch service to start on boot' do it 'sets the openvswitch service to start on boot' do
@ -73,7 +73,7 @@ describe 'openstack-network::openvswitch' do
node.set['openstack']['network']['platform']['package_overrides'] = '--my-override1 --my-override2' node.set['openstack']['network']['platform']['package_overrides'] = '--my-override1 --my-override2'
%w{openvswitch-switch openvswitch-datapath-dkms neutron-plugin-openvswitch neutron-plugin-openvswitch-agent}.each do |pkg| %w{openvswitch-switch openvswitch-datapath-dkms neutron-plugin-openvswitch neutron-plugin-openvswitch-agent}.each do |pkg|
expect(chef_run).to install_package(pkg).with(options: '--my-override1 --my-override2') expect(chef_run).to upgrade_package(pkg).with(options: '--my-override1 --my-override2')
end end
end end
@ -82,7 +82,7 @@ describe 'openstack-network::openvswitch' do
node.set['openstack']['network']['platform']['neutron_openvswitch_agent_packages'] = ['my-openvswitch-agent', 'my-other-openvswitch-agent'] node.set['openstack']['network']['platform']['neutron_openvswitch_agent_packages'] = ['my-openvswitch-agent', 'my-other-openvswitch-agent']
%w{my-openvswitch my-other-openvswitch my-openvswitch-agent my-other-openvswitch-agent}.each do |pkg| %w{my-openvswitch my-other-openvswitch my-openvswitch-agent my-other-openvswitch-agent}.each do |pkg|
expect(chef_run).to install_package(pkg) expect(chef_run).to upgrade_package(pkg)
end end
end end

View File

@ -15,19 +15,19 @@ describe 'openstack-network::server' do
it 'does not install openstack-neutron when nova networking' do it 'does not install openstack-neutron when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package 'openstack-neutron' expect(chef_run).to_not upgrade_package 'openstack-neutron'
end end
it 'installs openstack-neutron packages' do it 'upgrades openstack-neutron packages' do
expect(chef_run).to install_package 'openstack-neutron' expect(chef_run).to upgrade_package 'openstack-neutron'
end end
it 'enables openstack-neutron server service' do it 'enables openstack-neutron server service' do
expect(chef_run).to enable_service 'neutron-server' expect(chef_run).to enable_service 'neutron-server'
end end
it 'does not install openvswitch package' do it 'does not upgrade openvswitch package' do
expect(chef_run).not_to install_package 'openvswitch' expect(chef_run).not_to upgrade_package 'openvswitch'
expect(chef_run).not_to enable_service 'neutron-openvswitch-agent' expect(chef_run).not_to enable_service 'neutron-openvswitch-agent'
end end
end end

View File

@ -15,19 +15,19 @@ describe 'openstack-network::server' do
it 'does not install openstack-neutron when nova networking' do it 'does not install openstack-neutron when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package 'openstack-neutron' expect(chef_run).to_not upgrade_package 'openstack-neutron'
end end
it 'installs openstack-neutron packages' do it 'upgrades openstack-neutron packages' do
expect(chef_run).to install_package 'openstack-neutron' expect(chef_run).to upgrade_package 'openstack-neutron'
end end
it 'enables openstack-neutron service' do it 'enables openstack-neutron service' do
expect(chef_run).to enable_service 'openstack-neutron' expect(chef_run).to enable_service 'openstack-neutron'
end end
it 'does not install openvswitch package' do it 'does not upgrade openvswitch package' do
expect(chef_run).not_to install_package 'openstack-neutron-openvswitch' expect(chef_run).not_to upgrade_package 'openstack-neutron-openvswitch'
end end
describe '/etc/sysconfig/neutron' do describe '/etc/sysconfig/neutron' do

View File

@ -20,12 +20,12 @@ describe 'openstack-network::server' do
it 'does not install neutron-server when nova networking' do it 'does not install neutron-server when nova networking' do
node.override['openstack']['compute']['network']['service_type'] = 'nova' node.override['openstack']['compute']['network']['service_type'] = 'nova'
expect(chef_run).to_not install_package 'neutron-server' expect(chef_run).to_not upgrade_package 'neutron-server'
end end
describe 'package and services' do describe 'package and services' do
it 'installs neutron-server packages' do it 'upgrades neutron-server packages' do
expect(chef_run).to install_package 'neutron-server' expect(chef_run).to upgrade_package 'neutron-server'
end end
it 'allows overriding package names' do it 'allows overriding package names' do
@ -33,7 +33,7 @@ describe 'openstack-network::server' do
node.set['openstack']['network']['platform']['neutron_server_packages'] = cust_pkgs node.set['openstack']['network']['platform']['neutron_server_packages'] = cust_pkgs
cust_pkgs.each do |pkg| cust_pkgs.each do |pkg|
expect(chef_run).to install_package(pkg) expect(chef_run).to upgrade_package(pkg)
end end
end end
@ -51,12 +51,12 @@ describe 'openstack-network::server' do
cust_opts = "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef' --force-yes" cust_opts = "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef' --force-yes"
node.set['openstack']['network']['platform']['package_overrides'] = cust_opts node.set['openstack']['network']['platform']['package_overrides'] = cust_opts
expect(chef_run).to install_package('neutron-server').with(options: cust_opts) expect(chef_run).to upgrade_package('neutron-server').with(options: cust_opts)
end end
it 'does not install openvswitch package or the agent' do it 'does not upgrade openvswitch package or the agent' do
expect(chef_run).not_to install_package 'openvswitch' expect(chef_run).not_to upgrade_package 'openvswitch'
expect(chef_run).not_to install_package 'neutron-plugin-openvswitch-agent' expect(chef_run).not_to upgrade_package 'neutron-plugin-openvswitch-agent'
expect(chef_run).not_to enable_service 'neutron-plugin-openvswitch-agent' expect(chef_run).not_to enable_service 'neutron-plugin-openvswitch-agent'
end end
end end
@ -434,7 +434,7 @@ describe 'openstack-network::server' do
end end
end end
it 'does not install sysconfig template' do it 'does not create sysconfig template' do
stub_command(/python/).and_return(true) stub_command(/python/).and_return(true)
expect(chef_run).not_to create_file('/etc/sysconfig/neutron') expect(chef_run).not_to create_file('/etc/sysconfig/neutron')
end end