1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
require 'spec_helper_acceptance'
describe 'basic nova' do
context 'default parameters' do
it 'should work with no errors' do
pp= <<-EOS
include openstack_integration
include openstack_integration::repos
include openstack_integration::apache
include openstack_integration::rabbitmq
include openstack_integration::mysql
include openstack_integration::memcached
include openstack_integration::keystone
include openstack_integration::neutron
include openstack_integration::placement
include openstack_integration::nova
nova_aggregate { 'test_aggregate':
ensure => present,
availability_zone => 'zone1',
metadata => 'test=property',
require => Class['nova::api'],
}
nova_flavor { 'public_flavor':
ensure => present,
name => 'public_flavor',
id => '42',
ram => '512',
disk => '1',
vcpus => '1',
}
nova_flavor { 'private_flavor':
ensure => present,
name => 'private_flavor',
id => '43',
ram => '512',
disk => '1',
vcpus => '1',
is_public => 'False',
project_name => 'services',
properties => {'foo' => 'bar'}
}
EOS
# Run it twice and test for idempotency
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
describe port(8774) do
it { is_expected.to be_listening }
end
describe port(8775) do
it { is_expected.to be_listening }
end
describe port(6080) do
it { is_expected.to be_listening }
end
describe cron do
it { is_expected.to have_entry('1 0 * * * nova-manage db archive_deleted_rows --max_rows 100 >>/var/log/nova/nova-rowsflush.log 2>&1').with_user('nova') }
end
describe 'nova aggregate' do
it 'should create new aggregate' do
command('openstack --os-identity-api-version 3 --os-username nova --os-password a_big_secret --os-project-name services --os-user-domain-name Default --os-project-domain-name Default --os-auth-url http://127.0.0.1:5000/v3 aggregate list') do |r|
expect(r.stdout).to match(/test_aggregate/)
end
end
end
describe 'nova flavor' do
it 'should create new flavor' do
command('openstack --os-identity-api-version 3 --os-username nova --os-password a_big_secret --os-project-name services --os-user-domain-name Default --os-project-domain-name Default --os-auth-url http://127.0.0.1:5000/v3 flavor list') do |r|
expect(r.stdout).to match(/public_flavor/)
expect(r.stdout).to match(/private_flavor/)
end
end
end
end
end
|