nova_wsgi_apache_spec.rb 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. require 'spec_helper_acceptance'
  2. describe 'basic nova' do
  3. context 'default parameters' do
  4. it 'should work with no errors' do
  5. pp= <<-EOS
  6. include ::openstack_integration
  7. include ::openstack_integration::repos
  8. include ::openstack_integration::rabbitmq
  9. include ::openstack_integration::mysql
  10. include ::openstack_integration::keystone
  11. rabbitmq_user { 'nova':
  12. admin => true,
  13. password => 'an_even_bigger_secret',
  14. provider => 'rabbitmqctl',
  15. require => Class['rabbitmq'],
  16. }
  17. rabbitmq_user_permissions { 'nova@/':
  18. configure_permission => '.*',
  19. write_permission => '.*',
  20. read_permission => '.*',
  21. provider => 'rabbitmqctl',
  22. require => Class['rabbitmq'],
  23. }
  24. # Nova resources
  25. class { '::nova':
  26. database_connection => 'mysql+pymysql://nova:a_big_secret@127.0.0.1/nova?charset=utf8',
  27. api_database_connection => 'mysql+pymysql://nova_api:a_big_secret@127.0.0.1/nova_api?charset=utf8',
  28. placement_database_connection => 'mysql+pymysql://nova_placement:a_big_secret@127.0.0.1/nova_placement?charset=utf8',
  29. default_transport_url => 'rabbit://nova:an_even_bigger_secret@127.0.0.1:5672/',
  30. image_service => 'nova.image.glance.GlanceImageService',
  31. glance_api_servers => 'localhost:9292',
  32. debug => true,
  33. }
  34. class { '::nova::db::mysql':
  35. password => 'a_big_secret',
  36. }
  37. class { '::nova::db::mysql_api':
  38. password => 'a_big_secret',
  39. }
  40. class { '::nova::db::mysql_placement':
  41. password => 'a_big_secret',
  42. }
  43. class { '::nova::keystone::auth':
  44. password => 'a_big_secret',
  45. }
  46. class { '::nova::keystone::auth_placement':
  47. password => 'a_big_secret',
  48. }
  49. class { '::nova::keystone::authtoken':
  50. password => 'a_big_secret',
  51. }
  52. include '::nova::cell_v2::simple_setup'
  53. class { '::nova::api':
  54. service_name => 'httpd',
  55. }
  56. include ::apache
  57. class { '::nova::wsgi::apache_api':
  58. ssl => false,
  59. }
  60. class { '::nova::wsgi::apache_placement':
  61. ssl => false,
  62. }
  63. class { '::nova::placement':
  64. password => 'a_big_secret',
  65. }
  66. class { '::nova::cert': }
  67. class { '::nova::client': }
  68. class { '::nova::conductor': }
  69. class { '::nova::consoleauth': }
  70. class { '::nova::cron::archive_deleted_rows': }
  71. class { '::nova::compute': vnc_enabled => true }
  72. class { '::nova::compute::libvirt':
  73. migration_support => true,
  74. vncserver_listen => '0.0.0.0',
  75. # TODO: enable it again when puppet 4.5 will be idempotent
  76. # https://tickets.puppetlabs.com/browse/PUP-6370
  77. virtlock_service_name => false,
  78. virtlog_service_name => false,
  79. }
  80. class { '::nova::scheduler': }
  81. class { '::nova::vncproxy': }
  82. nova_aggregate { 'test_aggregate':
  83. ensure => present,
  84. availability_zone => 'zone1',
  85. metadata => 'test=property',
  86. require => Class['nova::api'],
  87. }
  88. nova_flavor { 'test_flavor':
  89. ensure => present,
  90. name => 'test_flavor',
  91. id => '9999',
  92. ram => '512',
  93. disk => '1',
  94. vcpus => '1',
  95. require => [ Class['nova::api'], Class['nova::keystone::auth'] ],
  96. }
  97. # TODO: networking with neutron
  98. EOS
  99. # Run it twice and test for idempotency
  100. apply_manifest(pp, :catch_failures => true)
  101. apply_manifest(pp, :catch_changes => true)
  102. end
  103. describe port(8774) do
  104. it { is_expected.to be_listening }
  105. end
  106. describe port(8775) do
  107. it { is_expected.to be_listening }
  108. end
  109. if os[:family].casecmp('RedHat') == 0
  110. describe port(80) do
  111. it { is_expected.to be_listening }
  112. end
  113. end
  114. describe port(6080) do
  115. it { is_expected.to be_listening }
  116. end
  117. describe cron do
  118. 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') }
  119. end
  120. describe 'nova aggregate' do
  121. it 'should create new aggregate' do
  122. shell('openstack --os-username nova --os-password a_big_secret --os-tenant-name services --os-auth-url http://127.0.0.1:5000/v2.0 aggregate list') do |r|
  123. expect(r.stdout).to match(/test_aggregate/)
  124. end
  125. end
  126. end
  127. describe 'nova flavor' do
  128. it 'should create new flavor' do
  129. shell('openstack --os-username nova --os-password a_big_secret --os-tenant-name services --os-auth-url http://127.0.0.1:5000/v2.0 flavor list') do |r|
  130. expect(r.stdout).to match(/test_flavor/)
  131. end
  132. end
  133. end
  134. end
  135. end