File: heat_trustree_spec.rb

package info (click to toggle)
puppet-module-heat 25.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,560 kB
  • sloc: ruby: 3,889; python: 38; sh: 10; makefile: 10
file content (52 lines) | stat: -rw-r--r-- 1,835 bytes parent folder | download
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
require 'spec_helper'

describe 'heat::trustee' do

  shared_examples_for 'heat::trustee' do

    context 'with defaults' do
      let :params do
        {}
      end
      it 'configures trustee options' do
        is_expected.to contain_heat_config('trustee/password').with_value('<SERVICE DEFAULT>').with_secret(true)
        is_expected.to contain_heat_config('trustee/auth_url').with_value('http://127.0.0.1:5000/')
        is_expected.to contain_heat_config('trustee/auth_type').with_value('password')
        is_expected.to contain_heat_config('trustee/username').with_value('heat')
        is_expected.to contain_heat_config('trustee/user_domain_name').with_value('Default')
      end
    end

    context 'with parameters overridden' do
      let :params do
        {
          :password         => 'heat_password',
          :auth_type        => 'v3password',
          :auth_url         => 'https://localhost:13000/',
          :username         => 'alt_heat',
          :user_domain_name => 'MyDomain',
        }
      end
      it 'configures trustee options' do
        is_expected.to contain_heat_config('trustee/password').with_value('heat_password').with_secret(true)
        is_expected.to contain_heat_config('trustee/auth_url').with_value('https://localhost:13000/')
        is_expected.to contain_heat_config('trustee/auth_type').with_value('v3password')
        is_expected.to contain_heat_config('trustee/username').with_value('alt_heat')
        is_expected.to contain_heat_config('trustee/user_domain_name').with_value('MyDomain')
      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_configures 'heat::trustee'
    end
  end

end