nova_cell_v2_discover_hosts_spec.rb 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. require 'spec_helper'
  2. describe 'nova::cell_v2::discover_hosts' do
  3. shared_examples_for 'nova::cell_v2::discover_hosts' do
  4. context 'with defaults' do
  5. it {
  6. is_expected.to contain_exec('nova-cell_v2-discover_hosts').with(
  7. :path => ['/bin', '/usr/bin'],
  8. :command => 'nova-manage cell_v2 discover_hosts',
  9. :refreshonly => true,
  10. :subscribe => 'Anchor[nova::service::end]'
  11. )
  12. }
  13. end
  14. context "overriding extra_params" do
  15. let :params do
  16. {
  17. :extra_params => '--config-file /etc/nova/nova.conf'
  18. }
  19. end
  20. it {
  21. is_expected.to contain_exec('nova-cell_v2-discover_hosts').with(
  22. :path => ['/bin', '/usr/bin'],
  23. :command => 'nova-manage --config-file /etc/nova/nova.conf cell_v2 discover_hosts',
  24. :refreshonly => true,
  25. :subscribe => 'Anchor[nova::service::end]'
  26. )
  27. }
  28. end
  29. end
  30. on_supported_os({
  31. :supported_os => OSDefaults.get_supported_os
  32. }).each do |os,facts|
  33. context "on #{os}" do
  34. let (:facts) do
  35. facts.merge(OSDefaults.get_facts())
  36. end
  37. it_configures 'nova::cell_v2::discover_hosts'
  38. end
  39. end
  40. end