nova_cell_v2_cell_spec.rb 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. require 'spec_helper'
  2. describe 'nova::cell_v2::cell' do
  3. let (:title) { 'foo' }
  4. shared_examples_for 'nova::cell_v2::cell' do
  5. context 'with defaults' do
  6. it {
  7. is_expected.to contain_exec("nova-cell_v2-cell-#{title}").with(
  8. :path => ['/bin', '/usr/bin'],
  9. :command => "nova-manage cell_v2 create_cell --name=#{title} ",
  10. :logoutput => 'on_failure',
  11. :subscribe => 'Anchor[nova::cell_v2::begin]',
  12. :notify => 'Anchor[nova::cell_v2::end]',
  13. )
  14. }
  15. end
  16. context "overriding extra_params" do
  17. let :params do
  18. {
  19. :extra_params => '--config-file /etc/nova/nova.conf',
  20. :transport_url => 'rabbit://user:pass@host:1234/vhost',
  21. :database_connection => 'mysql://user:pass@host:3306/nova'
  22. }
  23. end
  24. it {
  25. is_expected.to contain_exec("nova-cell_v2-cell-#{title}").with(
  26. :path => ['/bin', '/usr/bin'],
  27. :command => "nova-manage --config-file /etc/nova/nova.conf cell_v2 create_cell --name=#{title} --transport-url=#{params[:transport_url]} --database_connection=#{params[:database_connection]}",
  28. :logoutput => 'on_failure',
  29. :subscribe => 'Anchor[nova::cell_v2::begin]',
  30. :notify => 'Anchor[nova::cell_v2::end]',
  31. )
  32. }
  33. end
  34. end
  35. on_supported_os({
  36. :supported_os => OSDefaults.get_supported_os
  37. }).each do |os,facts|
  38. context "on #{os}" do
  39. let (:facts) do
  40. facts.merge(OSDefaults.get_facts())
  41. end
  42. it_configures 'nova::cell_v2::cell'
  43. end
  44. end
  45. end