Debian Codegraph @

spec/acceptance/99_nova_config_spec.rb

raw
1 require 'spec_helper_acceptance'
2
3 describe 'basic nova_config resource' do
4
5 context 'default parameters' do
6
7 it 'should work with no errors' do
8 pp= <<-EOS
9 Exec { logoutput => 'on_failure' }
10
11 File <||> -> Nova_config <||>
12 File <||> -> Nova_api_paste_ini <||>
13 File <||> -> Nova_rootwrap_config <||>
14
15 file { '/etc/nova' :
16 ensure => directory,
17 }
18 file { '/etc/nova/nova.conf' :
19 ensure => file,
20 }
21 file { '/etc/nova/api-paste.ini' :
22 ensure => file,
23 }
24 file { '/etc/nova/rootwrap.conf' :
25 ensure => file,
26 }
27
28 nova_config { 'DEFAULT/thisshouldexist' :
29 value => 'foo',
30 }
31
32 nova_config { 'DEFAULT/thisshouldnotexist' :
33 value => '<SERVICE DEFAULT>',
34 }
35
36 nova_config { 'DEFAULT/thisshouldexist2' :
37 value => '<SERVICE DEFAULT>',
38 ensure_absent_val => 'toto',
39 }
40
41 nova_config { 'DEFAULT/thisshouldnotexist2' :
42 value => 'toto',
43 ensure_absent_val => 'toto',
44 }
45
46 nova_config { 'DEFAULT/thisshouldexist3' :
47 value => ['foo', 'bar'],
48 }
49
50 nova_api_paste_ini { 'DEFAULT/thisshouldexist' :
51 value => 'foo',
52 }
53
54 nova_api_paste_ini { 'DEFAULT/thisshouldnotexist' :
55 value => '<SERVICE DEFAULT>',
56 }
57
58 nova_api_paste_ini { 'DEFAULT/thisshouldexist2' :
59 value => '<SERVICE DEFAULT>',
60 ensure_absent_val => 'toto',
61 }
62
63 nova_api_paste_ini { 'DEFAULT/thisshouldnotexist2' :
64 value => 'toto',
65 ensure_absent_val => 'toto',
66 }
67
68 nova_api_paste_ini { 'DEFAULT/thisshouldexist3' :
69 value => 'foo',
70 key_val_separator => ':'
71 }
72
73 nova_rootwrap_config { 'DEFAULT/thisshouldexist' :
74 value => 'foo',
75 }
76
77 nova_rootwrap_config { 'DEFAULT/thisshouldnotexist' :
78 value => '<SERVICE DEFAULT>',
79 }
80
81 nova_rootwrap_config { 'DEFAULT/thisshouldexist2' :
82 value => '<SERVICE DEFAULT>',
83 ensure_absent_val => 'toto',
84 }
85
86 nova_rootwrap_config { 'DEFAULT/thisshouldnotexist2' :
87 value => 'toto',
88 ensure_absent_val => 'toto',
89 }
90 EOS
91
92
93 # Run it twice and test for idempotency
94 apply_manifest(pp, :catch_failures => true)
95 apply_manifest(pp, :catch_changes => true)
96 end
97
98 describe file('/etc/nova/nova.conf') do
99 it { is_expected.to exist }
100 it { is_expected.to contain('thisshouldexist=foo') }
101 it { is_expected.to contain('thisshouldexist2=<SERVICE DEFAULT>') }
102 it { is_expected.to contain('thisshouldexist3=foo') }
103 it { is_expected.to contain('thisshouldexist3=bar') }
104
105 describe '#content' do
106 subject { super().content }
107 it { is_expected.to_not match /thisshouldnotexist/ }
108 end
109 end
110
111 describe file('/etc/nova/api-paste.ini') do
112 it { is_expected.to exist }
113 it { is_expected.to contain('thisshouldexist=foo') }
114 it { is_expected.to contain('thisshouldexist2=<SERVICE DEFAULT>') }
115 it { is_expected.to contain('thisshouldexist3:foo') }
116
117 describe '#content' do
118 subject { super().content }
119 it { is_expected.to_not match /thisshouldnotexist/ }
120 end
121 end
122
123 describe file('/etc/nova/rootwrap.conf') do
124 it { is_expected.to exist }
125 it { is_expected.to contain('thisshouldexist=foo') }
126 it { is_expected.to contain('thisshouldexist2=<SERVICE DEFAULT>') }
127
128 describe '#content' do
129 subject { super().content }
130 it { is_expected.to_not match /thisshouldnotexist/ }
131 end
132 end
133 end
134 end