File: designate_client_spec.rb

package info (click to toggle)
puppet-module-designate 25.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,544 kB
  • sloc: ruby: 3,196; python: 38; sh: 10; makefile: 10
file content (59 lines) | stat: -rw-r--r-- 1,626 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
53
54
55
56
57
58
59
#
# Unit tests for designate::client
#
require 'spec_helper'

describe 'designate::client' do

  shared_examples 'designate-client' do

    context 'with default parameters' do
      it { is_expected.to contain_class('designate::deps') }
      it { is_expected.to contain_class('designate::params') }

      it 'installs designate client package' do
        is_expected.to contain_package('python-designateclient').with(
          :ensure => 'present',
          :name   => platform_params[:client_package_name],
          :tag    => ['openstack', 'openstackclient']
        )
      end

      it { is_expected.to contain_class('openstacklib::openstackclient') }
    end

    context 'with custom package name' do
      let :params do
        { :client_package_name => 'designate-client-custom-name' }
      end

      it 'configures using custom name' do
        is_expected.to contain_package('python-designateclient').with(
          :ensure    => 'present',
          :name      => 'designate-client-custom-name',
          :tag       => ['openstack', 'openstackclient'],
        )
      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

      let(:platform_params) do
        case facts[:os]['family']
        when 'Debian'
          { :client_package_name => 'python3-designateclient' }
        when 'RedHat'
          { :client_package_name => 'python3-designateclient' }
        end
      end
      it_behaves_like 'designate-client'
    end
  end
end