Extend coverage of config acceptance tests

Change-Id: I9ea1a85f4dedcd08f6c9a5463dc390fad5892009
This commit is contained in:
Takashi Kajinami 2022-07-09 11:57:57 +09:00
parent b9a25eba8c
commit a002cad4d3
2 changed files with 79 additions and 0 deletions

View File

@ -11,6 +11,8 @@ describe 'basic glance config resource' do
File <||> -> Glance_api_config <||>
File <||> -> Glance_cache_config <||>
File <||> -> Glance_image_import_config <||>
File <||> -> Glance_swift_config <||>
File <||> -> Glance_api_paste_ini <||>
file { '/etc/glance' :
ensure => directory,
@ -24,6 +26,9 @@ describe 'basic glance config resource' do
file { '/etc/glance/glance-image-import.conf' :
ensure => file,
}
file { '/etc/glance/glance-api-paste.ini' :
ensure => file,
}
glance_api_config { 'DEFAULT/thisshouldexist' :
value => 'foo',
@ -43,6 +48,10 @@ describe 'basic glance config resource' do
ensure_absent_val => 'toto',
}
glance_api_config { 'DEFAULT/thisshouldexist3' :
value => ['foo', 'bar'],
}
glance_cache_config { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
@ -61,6 +70,10 @@ describe 'basic glance config resource' do
ensure_absent_val => 'toto',
}
glance_cache_config { 'DEFAULT/thisshouldexist3' :
value => ['foo', 'bar'],
}
glance_image_import_config { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
@ -79,6 +92,46 @@ describe 'basic glance config resource' do
ensure_absent_val => 'toto',
}
glance_swift_config { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
glance_swift_config { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
glance_swift_config { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto',
}
glance_swift_config { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
glance_api_paste_ini { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
glance_api_paste_ini { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
glance_api_paste_ini { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto',
}
glance_api_paste_ini { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
glance_api_paste_ini { 'DEFAULT/thisshouldexist3' :
value => 'foo',
key_val_separator => ':'
}
EOS
@ -91,6 +144,8 @@ describe 'basic glance config resource' do
it { is_expected.to exist }
it { is_expected.to contain('thisshouldexist=foo') }
it { is_expected.to contain('thisshouldexist2=<SERVICE DEFAULT>') }
it { is_expected.to contain('thisshouldexist3=foo') }
it { is_expected.to contain('thisshouldexist3=bar') }
describe '#content' do
subject { super().content }
@ -102,6 +157,8 @@ describe 'basic glance config resource' do
it { is_expected.to exist }
it { is_expected.to contain('thisshouldexist=foo') }
it { is_expected.to contain('thisshouldexist2=<SERVICE DEFAULT>') }
it { is_expected.to contain('thisshouldexist3=foo') }
it { is_expected.to contain('thisshouldexist3=bar') }
describe '#content' do
subject { super().content }
@ -120,5 +177,27 @@ describe 'basic glance config resource' do
end
end
describe file('/etc/glance/glance-swift.conf') do
it { is_expected.to exist }
it { is_expected.to contain('thisshouldexist=foo') }
it { is_expected.to contain('thisshouldexist2=<SERVICE DEFAULT>') }
describe '#content' do
subject { super().content }
it { is_expected.not_to match /thisshouldnotexist/ }
end
end
describe file('/etc/glance/glance-api-paste.ini') do
it { is_expected.to exist }
it { is_expected.to contain('thisshouldexist=foo') }
it { is_expected.to contain('thisshouldexist2=<SERVICE DEFAULT>') }
it { is_expected.to contain('thisshouldexist3:foo') }
describe '#content' do
subject { super().content }
it { is_expected.not_to match /thisshouldnotexist/ }
end
end
end
end