File: octavia_nova_spec.rb

package info (click to toggle)
puppet-module-octavia 25.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,588 kB
  • sloc: ruby: 3,940; python: 38; makefile: 12; sh: 10
file content (54 lines) | stat: -rw-r--r-- 2,135 bytes parent folder | download | duplicates (3)
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
require 'spec_helper'

describe 'octavia::nova' do
  shared_examples 'octavia::nova' do
    context 'with default parameters' do
      it {
        should contain_octavia_config('nova/service_name').with_value('<SERVICE DEFAULT>')
        should contain_octavia_config('nova/endpoint').with_value('<SERVICE DEFAULT>')
        should contain_octavia_config('nova/region_name').with_value('<SERVICE DEFAULT>')
        should contain_octavia_config('nova/endpoint_type').with_value('<SERVICE DEFAULT>')
        should contain_octavia_config('nova/availability_zone').with_value('<SERVICE DEFAULT>')
        should contain_octavia_config('nova/enable_anti_affinity').with_value('<SERVICE DEFAULT>')
        should contain_octavia_config('nova/anti_affinity_policy').with_value('<SERVICE DEFAULT>')
      }
    end

    context 'with specified parameters' do
      let :params do
        {
          :service_name         => 'compute',
          :endpoint             => 'http://127.0.0.1:8774',
          :region_name          => 'RegionOne',
          :endpoint_type        => 'internalURL',
          :availability_zone    => 'nova',
          :enable_anti_affinity => true,
          :anti_affinity_policy => 'anti-affinity',
        }
      end

      it {
        should contain_octavia_config('nova/service_name').with_value('compute')
        should contain_octavia_config('nova/endpoint').with_value('http://127.0.0.1:8774')
        should contain_octavia_config('nova/region_name').with_value('RegionOne')
        should contain_octavia_config('nova/endpoint_type').with_value('internalURL')
        should contain_octavia_config('nova/availability_zone').with_value('nova')
        should contain_octavia_config('nova/enable_anti_affinity').with_value(true)
        should contain_octavia_config('nova/anti_affinity_policy').with_value('anti-affinity')
      }
    end
  end

  on_supported_os({
    :supported_os => OSDefaults.get_supported_os
  }).each do |os,facts|
    context "on #{os}" do
      let (:facts) do
        facts.merge(OSDefaults.get_facts())
      end

      it_behaves_like 'octavia::nova'
    end
  end

end