
Upgrade acceptance manifest from Kilo (stable) to Liberty (dev) on both Ubuntu Trusty & Centos7. Change-Id: I9e2da19afa5ed5d88715e7c91ee7d667886b9637 Co-Authored-By: Lukas Bezdicka <lbezdick@redhat.com> Depends-On: I7c1f31b3cc4c6ea1f894a263a8cff60e357accb8
115 lines
3.7 KiB
Ruby
115 lines
3.7 KiB
Ruby
require 'spec_helper_acceptance'
|
|
|
|
describe 'glance class' do
|
|
|
|
context 'default parameters' do
|
|
|
|
it 'should work with no errors' do
|
|
pp= <<-EOS
|
|
Exec { logoutput => 'on_failure' }
|
|
|
|
# Common resources
|
|
case $::osfamily {
|
|
'Debian': {
|
|
include ::apt
|
|
apt::ppa { 'ppa:ubuntu-cloud-archive/liberty-staging':
|
|
# it's false by default in 2.x series but true in 1.8.x
|
|
package_manage => false,
|
|
}
|
|
Exec['apt_update'] -> Package<||>
|
|
}
|
|
'RedHat': {
|
|
class { '::openstack_extras::repo::redhat::redhat':
|
|
manage_rdo => false,
|
|
repo_hash => {
|
|
# we need kilo repo to be installed for dependencies
|
|
'rdo-kilo' => {
|
|
'baseurl' => 'https://repos.fedorapeople.org/repos/openstack/openstack-kilo/el7/',
|
|
'descr' => 'RDO kilo',
|
|
'gpgcheck' => 'no',
|
|
},
|
|
'rdo-liberty' => {
|
|
'baseurl' => 'http://trunk.rdoproject.org/centos7/current/',
|
|
'descr' => 'RDO trunk',
|
|
'gpgcheck' => 'no',
|
|
},
|
|
},
|
|
}
|
|
package { 'openstack-selinux': ensure => 'latest' }
|
|
}
|
|
default: {
|
|
fail("Unsupported osfamily (${::osfamily})")
|
|
}
|
|
}
|
|
|
|
class { '::mysql::server': }
|
|
|
|
# Keystone resources, needed by Glance to run
|
|
class { '::keystone::db::mysql':
|
|
# https://bugs.launchpad.net/puppet-keystone/+bug/1446375
|
|
collate => 'utf8_general_ci',
|
|
password => 'keystone',
|
|
}
|
|
class { '::keystone':
|
|
verbose => true,
|
|
debug => true,
|
|
database_connection => 'mysql://keystone:keystone@127.0.0.1/keystone',
|
|
admin_token => 'admin_token',
|
|
enabled => true,
|
|
}
|
|
class { '::keystone::roles::admin':
|
|
email => 'test@example.tld',
|
|
password => 'a_big_secret',
|
|
}
|
|
class { '::keystone::endpoint':
|
|
public_url => "https://${::fqdn}:5000/",
|
|
admin_url => "https://${::fqdn}:35357/",
|
|
}
|
|
|
|
# Glance resources
|
|
include ::glance
|
|
include ::glance::client
|
|
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://glance:a_big_secret@127.0.0.1/glance?charset=utf8',
|
|
verbose => false,
|
|
keystone_password => 'a_big_secret',
|
|
}
|
|
class { '::glance::registry':
|
|
database_connection => 'mysql://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
|
|
|
|
# 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
|