end
shared_examples_for 'apache serving keystone with mod_wsgi' do
- it { should contain_service('httpd').with_name(platform_parameters[:httpd_service_name]) }
- it { should contain_class('keystone::params') }
- it { should contain_class('apache') }
- it { should contain_class('apache::mod::wsgi') }
- it { should contain_class('keystone::db::sync') }
+ it { is_expected.to contain_service('httpd').with_name(platform_parameters[:httpd_service_name]) }
+ it { is_expected.to contain_class('keystone::params') }
+ it { is_expected.to contain_class('apache') }
+ it { is_expected.to contain_class('apache::mod::wsgi') }
+ it { is_expected.to contain_class('keystone::db::sync') }
describe 'with default parameters' do
- it { should contain_file("#{platform_parameters[:wsgi_script_path]}").with(
+ it { is_expected.to contain_file("#{platform_parameters[:wsgi_script_path]}").with(
'ensure' => 'directory',
'owner' => 'keystone',
'group' => 'keystone',
'require' => 'Package[httpd]'
)}
- it { should contain_file('keystone_wsgi_admin').with(
+ it { is_expected.to contain_file('keystone_wsgi_admin').with(
'ensure' => 'file',
'path' => "#{platform_parameters[:wsgi_script_path]}/admin",
'source' => platform_parameters[:wsgi_script_source],
'require' => ["File[#{platform_parameters[:wsgi_script_path]}]", "Package[keystone]"]
)}
- it { should contain_file('keystone_wsgi_main').with(
+ it { is_expected.to contain_file('keystone_wsgi_main').with(
'ensure' => 'file',
'path' => "#{platform_parameters[:wsgi_script_path]}/main",
'source' => platform_parameters[:wsgi_script_source],
'require' => ["File[#{platform_parameters[:wsgi_script_path]}]", "Package[keystone]"]
)}
- it { should contain_apache__vhost('keystone_wsgi_admin').with(
+ it { is_expected.to contain_apache__vhost('keystone_wsgi_admin').with(
'servername' => 'some.host.tld',
'ip' => nil,
'port' => '35357',
'require' => 'File[keystone_wsgi_admin]'
)}
- it { should contain_apache__vhost('keystone_wsgi_main').with(
+ it { is_expected.to contain_apache__vhost('keystone_wsgi_main').with(
'servername' => 'some.host.tld',
'ip' => nil,
'port' => '5000',
'wsgi_script_aliases' => { '/' => "#{platform_parameters[:wsgi_script_path]}/main" },
'require' => 'File[keystone_wsgi_main]'
)}
- it { should contain_file("#{platform_parameters[:httpd_ports_file]}") }
+ it { is_expected.to contain_file("#{platform_parameters[:httpd_ports_file]}") }
end
describe 'when overriding parameters using different ports' do
}
end
- it { should contain_apache__vhost('keystone_wsgi_admin').with(
+ it { is_expected.to contain_apache__vhost('keystone_wsgi_admin').with(
'servername' => 'dummy.host',
'ip' => '10.42.51.1',
'port' => '4142',
'require' => 'File[keystone_wsgi_admin]'
)}
- it { should contain_apache__vhost('keystone_wsgi_main').with(
+ it { is_expected.to contain_apache__vhost('keystone_wsgi_main').with(
'servername' => 'dummy.host',
'ip' => '10.42.51.1',
'port' => '12345',
'require' => 'File[keystone_wsgi_main]'
)}
- it { should contain_file("#{platform_parameters[:httpd_ports_file]}") }
+ it { is_expected.to contain_file("#{platform_parameters[:httpd_ports_file]}") }
end
describe 'when overriding parameters using same port' do
}
end
- it { should_not contain_apache__vhost('keystone_wsgi_admin') }
+ it { is_expected.to_not contain_apache__vhost('keystone_wsgi_admin') }
- it { should contain_apache__vhost('keystone_wsgi_main').with(
+ it { is_expected.to contain_apache__vhost('keystone_wsgi_main').with(
'servername' => 'dummy.host',
'ip' => nil,
'port' => '4242',
it_raises 'a Puppet::Error', /When using the same port for public & private endpoints, public_path and admin_path should be different\./
end
+
+ describe 'when overriding parameters using symlink and custom file source' do
+ let :params do
+ {
+ :wsgi_script_ensure => 'link',
+ :wsgi_script_source => '/opt/keystone/httpd/keystone.py',
+ }
+ end
+
+ it { is_expected.to contain_file('keystone_wsgi_admin').with(
+ 'ensure' => 'link',
+ 'path' => "#{platform_parameters[:wsgi_script_path]}/admin",
+ 'target' => '/opt/keystone/httpd/keystone.py',
+ 'owner' => 'keystone',
+ 'group' => 'keystone',
+ 'mode' => '0644',
+ 'require' => ["File[#{platform_parameters[:wsgi_script_path]}]", "Package[keystone]"]
+ )}
+
+ it { is_expected.to contain_file('keystone_wsgi_main').with(
+ 'ensure' => 'link',
+ 'path' => "#{platform_parameters[:wsgi_script_path]}/main",
+ 'target' => '/opt/keystone/httpd/keystone.py',
+ 'owner' => 'keystone',
+ 'group' => 'keystone',
+ 'mode' => '0644',
+ 'require' => ["File[#{platform_parameters[:wsgi_script_path]}]", "Package[keystone]"]
+ )}
+ end
end
context 'on RedHat platforms' do