File: swift_keystone_dispersion_spec.rb

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

describe 'swift::keystone::dispersion' do
  shared_examples 'swift::keystone::dispersion' do
    describe 'with default class parameters' do
      it { is_expected.to contain_keystone_user('dispersion').with(
        :ensure   => 'present',
        :password => 'dispersion_password',
        :email    => 'swift@localhost',
      ) }

      it { is_expected.to contain_keystone_user_role('dispersion@services').with(
        :ensure  => 'present',
        :roles   => 'admin',
      ) }
    end

    describe 'when overriding parameters' do
      let :params do
        {
          :auth_user => 'bar',
          :auth_pass => 'foo',
          :email     => 'bar@example.com',
          :tenant    => 'dummyTenant'
        }
      end

      it { is_expected.to contain_keystone_user('bar').with(
        :ensure   => 'present',
        :password => 'foo',
        :email    => 'bar@example.com',
      ) }

      it { is_expected.to contain_keystone_user_role('bar@dummyTenant') }
    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 'swift::keystone::dispersion'
    end
  end
end