80faf9a017
In Liberty, we sent a warning if service_name was not set (and auth_name was configured as the service name), with the goal to define the correct default value during Mitaka. This patch set the service_name parameter to 'Image Service' by default to match with Keystone's default catalog. Note: if you already run OpenStack, when you'll run Puppet after this change, the old service will still be present and you'll have to drop it manually. Though the Glance endpoint will be updated with the new service. Change-Id: I740a9ad32361e6a78277ea0667fba7f631eb64af Closes-bug: #1506061
80 lines
3.1 KiB
Ruby
80 lines
3.1 KiB
Ruby
require 'spec_helper_acceptance'
|
|
|
|
describe 'glance class' do
|
|
|
|
context 'default parameters' do
|
|
pp= <<-EOS
|
|
include ::openstack_integration
|
|
include ::openstack_integration::repos
|
|
include ::openstack_integration::mysql
|
|
include ::openstack_integration::keystone
|
|
|
|
# Glance resources
|
|
include ::glance
|
|
include ::glance::client
|
|
include ::glance::backend::file
|
|
class { '::glance::db::mysql':
|
|
# https://bugs.launchpad.net/puppet-glance/+bug/1446375
|
|
collate => 'utf8_general_ci',
|
|
password => 'a_big_secret',
|
|
}
|
|
class { '::glance::keystone::auth':
|
|
password => 'a_big_secret',
|
|
}
|
|
class { '::glance::api':
|
|
database_connection => 'mysql+pymysql://glance:a_big_secret@127.0.0.1/glance?charset=utf8',
|
|
verbose => false,
|
|
keystone_password => 'a_big_secret',
|
|
}
|
|
class { '::glance::registry':
|
|
database_connection => 'mysql+pymysql://glance:a_big_secret@127.0.0.1/glance?charset=utf8',
|
|
verbose => false,
|
|
keystone_password => 'a_big_secret',
|
|
}
|
|
|
|
glance_image { 'test_image':
|
|
ensure => present,
|
|
container_format => 'bare',
|
|
disk_format => 'qcow2',
|
|
is_public => 'yes',
|
|
source => 'http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img',
|
|
}
|
|
EOS
|
|
|
|
it 'should configure the glance endpoint before the glance-api service uses it' do
|
|
pp2 = pp + "Service['glance-api'] -> Keystone_endpoint['RegionOne/Image Service::image']"
|
|
expect(apply_manifest(pp2, :expect_failures => true, :noop => true).stderr).to match(/Found 1 dependency cycle/i)
|
|
end
|
|
|
|
it 'should configure the glance user before the glance-api service uses it' do
|
|
pp2 = pp + "Service['glance-api'] -> Keystone_user_role['glance@services']"
|
|
expect(apply_manifest(pp2, :expect_failures => true, :noop => true).stderr).to match(/Found 1 dependency cycle/i)
|
|
end
|
|
|
|
it 'should configure the glance user before the glance-registry service uses it' do
|
|
pp2 = pp + "Service['glance-registry'] -> Keystone_user_role['glance@services']"
|
|
expect(apply_manifest(pp2, :expect_failures => true, :noop => true).stderr).to match(/Found 1 dependency cycle/i)
|
|
end
|
|
|
|
it 'should configure the glance-api service before using it to provision glance_images' do
|
|
pp2 = pp + "Glance_image['test_image'] -> Service['glance-api']"
|
|
expect(apply_manifest(pp2, :expect_failures => true, :noop => true).stderr).to match(/Found 1 dependency cycle/i)
|
|
end
|
|
|
|
it 'should work with no errors' do
|
|
# Run it twice and test for idempotency
|
|
apply_manifest(pp, :catch_failures => true)
|
|
apply_manifest(pp, :catch_changes => true)
|
|
end
|
|
|
|
describe 'glance images' do
|
|
it 'should create a glance image' do
|
|
shell('openstack --os-username glance --os-password a_big_secret --os-tenant-name services --os-auth-url http://127.0.0.1:5000/v2.0 image list') do |r|
|
|
expect(r.stdout).to match(/test_image/)
|
|
expect(r.stderr).to be_empty
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|