Debian Codegraph @

spec/acceptance/10_nova_wsgi_apache_spec.rb

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