File: nova_compute_libvirt_config_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 (59 lines) | stat: -rw-r--r-- 1,769 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
require 'spec_helper'

describe 'nova::compute::libvirt::config' do
  shared_examples 'nova::compute::libvirt::config' do
    let :params do
      {
        :libvirtd_config => {
          'foo' => { 'value'  => 'fooValue' },
          'bar' => { 'value'  => 'barValue' },
          'baz' => { 'ensure' => 'absent' }
        },
        :virtlogd_config => {
          'foo2' => { 'value'  => 'fooValue' },
          'bar2' => { 'value'  => 'barValue' },
          'baz2' => { 'ensure' => 'absent' }
        },
        :virtlockd_config => {
          'foo3' => { 'value'  => 'fooValue' },
          'bar3' => { 'value'  => 'barValue' },
          'baz3' => { 'ensure' => 'absent' }
        }
      }
    end

    context 'with specified configs' do
      it { should contain_class('nova::deps') }

      it {
        should contain_libvirtd_config('foo').with_value('fooValue')
        should contain_libvirtd_config('bar').with_value('barValue')
        should contain_libvirtd_config('baz').with_ensure('absent')
      }

      it {
        should contain_virtlogd_config('foo2').with_value('fooValue')
        should contain_virtlogd_config('bar2').with_value('barValue')
        should contain_virtlogd_config('baz2').with_ensure('absent')
      }

      it {
        should contain_virtlockd_config('foo3').with_value('fooValue')
        should contain_virtlockd_config('bar3').with_value('barValue')
        should contain_virtlockd_config('baz3').with_ensure('absent')
      }
    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::compute::libvirt::config'
    end
  end
end