Fixed tests
This commit is contained in:
@@ -48,6 +48,7 @@ class swift::proxy::authtoken(
|
|||||||
concat::fragment { "swift_authtoken":
|
concat::fragment { "swift_authtoken":
|
||||||
target => '/etc/swift/proxy-server.conf',
|
target => '/etc/swift/proxy-server.conf',
|
||||||
content => template('swift/proxy/authtoken.conf.erb'),
|
content => template('swift/proxy/authtoken.conf.erb'),
|
||||||
|
order => '22',
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,8 @@ describe 'swift::keystone::auth' do
|
|||||||
:description => 'Openstack Object-Store Service'
|
:description => 'Openstack Object-Store Service'
|
||||||
) }
|
) }
|
||||||
|
|
||||||
it { should contain_keystone_endpoint('swift').with(
|
it { should contain_keystone_endpoint('RegionOne/swift').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:region => 'RegionOne',
|
|
||||||
:public_url => "http://127.0.0.1:8080/v1/AUTH_%(tenant_id)s",
|
:public_url => "http://127.0.0.1:8080/v1/AUTH_%(tenant_id)s",
|
||||||
:admin_url => "http://127.0.0.1:8080/",
|
:admin_url => "http://127.0.0.1:8080/",
|
||||||
:internal_url => "http://127.0.0.1:8080/v1/AUTH_%(tenant_id)s"
|
:internal_url => "http://127.0.0.1:8080/v1/AUTH_%(tenant_id)s"
|
||||||
@@ -35,9 +34,8 @@ describe 'swift::keystone::auth' do
|
|||||||
:description => 'Openstack S3 Service'
|
:description => 'Openstack S3 Service'
|
||||||
) }
|
) }
|
||||||
|
|
||||||
it { should contain_keystone_endpoint('swift_s3').with(
|
it { should contain_keystone_endpoint('RegionOne/swift_s3').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:region => 'RegionOne',
|
|
||||||
:public_url => 'http://127.0.0.1:8080',
|
:public_url => 'http://127.0.0.1:8080',
|
||||||
:admin_url => 'http://127.0.0.1:8080',
|
:admin_url => 'http://127.0.0.1:8080',
|
||||||
:internal_url => 'http://127.0.0.1:8080'
|
:internal_url => 'http://127.0.0.1:8080'
|
||||||
@@ -73,11 +71,11 @@ describe 'swift::keystone::auth' do
|
|||||||
|
|
||||||
it { should contain_keystone_service('swifty') }
|
it { should contain_keystone_service('swifty') }
|
||||||
|
|
||||||
it { should contain_keystone_endpoint('swifty') }
|
it { should contain_keystone_endpoint('RegionOne/swifty') }
|
||||||
|
|
||||||
it { should contain_keystone_service('swifty_s3') }
|
it { should contain_keystone_service('swifty_s3') }
|
||||||
|
|
||||||
it { should contain_keystone_endpoint('swifty_s3') }
|
it { should contain_keystone_endpoint('RegionOne/swifty_s3') }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -90,17 +88,15 @@ describe 'swift::keystone::auth' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_keystone_endpoint('swift').with(
|
it { should contain_keystone_endpoint('RegionOne/swift').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:region => 'RegionOne',
|
|
||||||
:public_url => "http://192.168.0.1:8081/v1/AUTH_%(tenant_id)s",
|
:public_url => "http://192.168.0.1:8081/v1/AUTH_%(tenant_id)s",
|
||||||
:admin_url => "http://192.168.0.1:8081/",
|
:admin_url => "http://192.168.0.1:8081/",
|
||||||
:internal_url => "http://192.168.0.1:8081/v1/AUTH_%(tenant_id)s"
|
:internal_url => "http://192.168.0.1:8081/v1/AUTH_%(tenant_id)s"
|
||||||
) }
|
) }
|
||||||
|
|
||||||
it { should contain_keystone_endpoint('swift_s3').with(
|
it { should contain_keystone_endpoint('RegionOne/swift_s3').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:region => 'RegionOne',
|
|
||||||
:public_url => 'http://192.168.0.1:8081',
|
:public_url => 'http://192.168.0.1:8081',
|
||||||
:admin_url => 'http://192.168.0.1:8081',
|
:admin_url => 'http://192.168.0.1:8081',
|
||||||
:internal_url => 'http://192.168.0.1:8081'
|
:internal_url => 'http://192.168.0.1:8081'
|
||||||
|
|||||||
@@ -15,21 +15,39 @@ describe 'swift::proxy::authtoken' do
|
|||||||
'
|
'
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :fragment_file do
|
||||||
{
|
"/var/lib/puppet/concat/_etc_swift_proxy-server.conf/fragments/22_swift_authtoken"
|
||||||
:admin_token => 'admin_token',
|
end
|
||||||
:admin_user => 'admin_user',
|
|
||||||
:admin_tenant_name => 'admin_tenant_name',
|
describe "when using default parameters" do
|
||||||
:admin_password => 'admin_password',
|
it 'should build the fragment with correct parameters' do
|
||||||
:delay_auth_decision => 42,
|
verify_contents(subject, fragment_file,
|
||||||
:auth_host => '1.2.3.4',
|
[
|
||||||
:auth_port => 4682,
|
'[filter:authtoken]',
|
||||||
:auth_protocol => 'https'
|
'paste.filter_factory = keystone.middleware.auth_token:filter_factory',
|
||||||
}
|
'signing_dir = /etc/swift',
|
||||||
|
'auth_host = 127.0.0.1',
|
||||||
|
'auth_port = 35357',
|
||||||
|
'auth_protocol = http',
|
||||||
|
'auth_uri = http://127.0.0.1:5000',
|
||||||
|
'admin_tenant_name = services',
|
||||||
|
'admin_user = swift',
|
||||||
|
'admin_password = password',
|
||||||
|
'delay_auth_decision = 1',
|
||||||
|
]
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "when override parameters" do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:admin_token => 'ADMINTOKEN'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should contain_file(fragment_file).with_content(/admin_token = ADMINTOKEN/) }
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_keystone__client__authtoken('/etc/swift/proxy-server.conf').with(
|
|
||||||
params
|
|
||||||
)}
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ describe 'swift::proxy::s3token' do
|
|||||||
[
|
[
|
||||||
'[filter:s3token]',
|
'[filter:s3token]',
|
||||||
'paste.filter_factory = keystone.middleware.s3_token:filter_factory',
|
'paste.filter_factory = keystone.middleware.s3_token:filter_factory',
|
||||||
'auth_port = 5000',
|
'auth_port = 35357',
|
||||||
'auth_protocol = http',
|
'auth_protocol = http',
|
||||||
'auth_host = 127.0.0.1'
|
'auth_host = 127.0.0.1'
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -18,6 +18,6 @@ describe 'swift::proxy::swift3' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_file(fragment_file).with_content(/[filter:swift3]/) }
|
it { should contain_file(fragment_file).with_content(/[filter:swift3]/) }
|
||||||
it { should contain_file(fragment_file).with_content(/use = egg:swift#swift3/) }
|
it { should contain_file(fragment_file).with_content(/use = egg:swift3#swift3/) }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user