cookbook-openstack-network/spec/balancer-redhat_spec.rb
lijianlj 31f6606586 Fix user_group configuration in lbaas_agent.ini.erb
when using haproxy, user_group should be nobody on rhel,fedora and suse, and nogroup on debian

Change-Id: If875bdbecf9867a20afd5264a2fdb814a7729896
Closes-Bug:#1406224
2015-01-13 10:27:41 +08:00

43 lines
1.1 KiB
Ruby

# Encoding: utf-8
require_relative 'spec_helper'
describe 'openstack-network::balancer' do
describe 'redhat' do
let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) }
let(:node) { runner.node }
let(:chef_run) do
node.set['openstack']['compute']['network']['service_type'] = 'neutron'
runner.converge(described_recipe)
end
include_context 'neutron-stubs'
describe 'lbaas_agent.ini' do
let(:file) { chef_run.template('/etc/neutron/lbaas_agent.ini') }
it 'creates lbaas_agent.ini' do
expect(chef_run).to create_template(file.name).with(
user: 'neutron',
group: 'neutron',
mode: 0640
)
end
it 'displays user_group as nobody' do
expect(chef_run).to render_file('/etc/neutron/lbaas_agent.ini').with_content(/^user_group = nobody$/)
end
end
['haproxy', 'openstack-neutron'].each do |pack|
it "upgrades #{pack} package" do
expect(chef_run).to upgrade_package(pack)
end
end
it 'enables agent service' do
expect(chef_run).to enable_service('neutron-lb-agent')
end
end
end