File: nova_compute_libvirt_virtsecretd_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 (76 lines) | stat: -rw-r--r-- 3,441 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Unit tests for nova::compute::libvirt::virtsecretd class
#
require 'spec_helper'

describe 'nova::compute::libvirt::virtsecretd' do

  shared_examples_for 'nova-compute-libvirt-virtsecretd' do

    context 'with default parameters' do
      let :params do
        {}
      end

      it { is_expected.to contain_class('nova::deps')}

      it { is_expected.to contain_virtsecretd_config('log_level').with_value('<SERVICE DEFAULT>')}
      it { is_expected.to contain_virtsecretd_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)}
      it { is_expected.to contain_virtsecretd_config('log_filters').with_value('<SERVICE DEFAULT>').with_quote(true)}
      it { is_expected.to contain_virtsecretd_config('max_clients').with_value('<SERVICE DEFAULT>')}
      it { is_expected.to contain_virtsecretd_config('admin_max_clients').with_value('<SERVICE DEFAULT>')}
      it { is_expected.to contain_virtsecretd_config('max_client_requests').with_value('<SERVICE DEFAULT>')}
      it { is_expected.to contain_virtsecretd_config('admin_max_client_requests').with_value('<SERVICE DEFAULT>')}
      it { is_expected.to contain_virtsecretd_config('ovs_timeout').with_value('<SERVICE DEFAULT>')}
    end

    context 'with specified parameters' do
      let :params do
        { :log_level                 => 3,
          :log_outputs               => '3:syslog',
          :log_filters               => '1:logging 4:object 4:json 4:event 1:util',
          :max_clients               => 1024,
          :admin_max_clients         => 5,
          :max_client_requests       => 42,
          :admin_max_client_requests => 55,
          :ovs_timeout               => 10,
        }
      end

      it { is_expected.to contain_class('nova::deps')}

      it { is_expected.to contain_virtsecretd_config('log_level').with_value(params[:log_level])}
      it { is_expected.to contain_virtsecretd_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)}
      it { is_expected.to contain_virtsecretd_config('log_filters').with_value(params[:log_filters]).with_quote(true)}
      it { is_expected.to contain_virtsecretd_config('max_clients').with_value(params[:max_clients])}
      it { is_expected.to contain_virtsecretd_config('admin_max_clients').with_value(params[:admin_max_clients])}
      it { is_expected.to contain_virtsecretd_config('max_client_requests').with_value(params[:max_client_requests])}
      it { is_expected.to contain_virtsecretd_config('admin_max_client_requests').with_value(params[:admin_max_client_requests])}
      it { is_expected.to contain_virtsecretd_config('ovs_timeout').with_value(params[:ovs_timeout])}
    end

    context 'with array values' do
      let :params do
        {
          :log_outputs => ['3:syslog', '3:stderr'],
          :log_filters => ['1:logging', '4:object', '4:json', '4:event', '1:util'],
        }
      end

      it { is_expected.to contain_virtsecretd_config('log_outputs').with_value('3:syslog 3:stderr').with_quote(true)}
      it { is_expected.to contain_virtsecretd_config('log_filters').with_value('1:logging 4:object 4:json 4:event 1:util').with_quote(true)}
    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 'nova-compute-libvirt-virtsecretd'
     end
  end

end