File: nova_limit_spec.rb

package info (click to toggle)
puppet-module-nova 25.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,100 kB
  • sloc: ruby: 11,433; python: 38; sh: 10; makefile: 10
file content (81 lines) | stat: -rw-r--r-- 2,711 bytes parent folder | download | duplicates (2)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
require 'spec_helper'

describe 'nova::limit' do

  shared_examples_for 'nova::limit' do

    let :params do
      {
        :endpoint_id => 'b41eeaed-d2ae-4add-9bfd-9ea8ac912d64',
        :password    => 'nova_password',
      }
    end

    it 'configure limit default params' do
      is_expected.to contain_oslo__limit('nova_config').with(
        :endpoint_id         => 'b41eeaed-d2ae-4add-9bfd-9ea8ac912d64',
        :username            => 'nova',
        :password            => 'nova_password',
        :auth_url            => 'http://localhost:5000',
        :project_name        => 'services',
        :user_domain_name    => 'Default',
        :project_domain_name => 'Default',
        :system_scope        => '<SERVICE DEFAULT>',
        :auth_type           => 'password',
        :service_type        => '<SERVICE DEFAULT>',
        :valid_interfaces    => '<SERVICE DEFAULT>',
        :region_name         => '<SERVICE DEFAULT>',
        :endpoint_override   => '<SERVICE DEFAULT>',
      )
    end

    context 'with specific parameters' do
      before :each do
        params.merge!({
          :username            => 'alt_nova',
          :auth_url            => 'http://192.168.0.1:5000',
          :project_name        => 'alt_services',
          :user_domain_name    => 'domainX',
          :project_domain_name => 'domainX',
          :system_scope        => 'all',
          :auth_type           => 'v3password',
          :service_type        => 'identity',
          :valid_interfaces    => 'public',
          :region_name         => 'regionOne',
          :endpoint_override   => 'http://192.168.0.2:5000',
        })
      end

      it 'configure limit params' do
        is_expected.to contain_oslo__limit('nova_config').with(
          :endpoint_id         => 'b41eeaed-d2ae-4add-9bfd-9ea8ac912d64',
          :username            => 'alt_nova',
          :password            => 'nova_password',
          :auth_url            => 'http://192.168.0.1:5000',
          :project_name        => 'alt_services',
          :user_domain_name    => 'domainX',
          :project_domain_name => 'domainX',
          :system_scope        => 'all',
          :auth_type           => 'v3password',
          :service_type        => 'identity',
          :valid_interfaces    => 'public',
          :region_name         => 'regionOne',
          :endpoint_override   => 'http://192.168.0.2:5000',
        )
      end
    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 'nova::limit'
    end
  end

end