f0137bfc94
There are some changes in Glance where it now does som calculus on the image and adds these three new values to the image properties. [1] This change fixes so we dont update these properties when we flush or create the glance_image resource. It also changes the spec acceptance so it tests if our custom property is there and not the only property. [1] https://github.com/openstack/glance/blob/master/releasenotes/notes/multihash-081466a98601da20.yaml Co-Authored-By: Alex Schultz <aschultz@redhat.com> Change-Id: I7f1245be6c2446f0d4336630e800da3e110f3408
49 lines
1.9 KiB
Ruby
49 lines
1.9 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
|
|
include ::openstack_integration::glance
|
|
|
|
glance_image { 'test_image':
|
|
ensure => present,
|
|
container_format => 'bare',
|
|
disk_format => 'qcow2',
|
|
is_public => 'yes',
|
|
source => 'http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img',
|
|
min_ram => '64',
|
|
min_disk => '1024',
|
|
properties => { 'icanhaz' => 'cheezburger' },
|
|
}
|
|
EOS
|
|
|
|
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 with proper attributes' do
|
|
glance_env_opts = '--os-identity-api-version 3 --os-username glance --os-password a_big_secret --os-project-name services --os-user-domain-name Default --os-project-domain-name Default --os-auth-url http://127.0.0.1:5000/v3'
|
|
shell("openstack #{glance_env_opts} image list") do |r|
|
|
expect(r.stdout).to match(/test_image/)
|
|
end
|
|
shell("openstack #{glance_env_opts} image show test_image --format shell") do |r|
|
|
expect(r.stdout).to match(/visibility="public"/)
|
|
expect(r.stdout).to match(/container_format="bare"/)
|
|
expect(r.stdout).to match(/disk_format="qcow2"/)
|
|
expect(r.stdout).to include('properties="icanhaz=\'cheezburger\'')
|
|
expect(r.stdout).to match(/min_ram="64"/)
|
|
expect(r.stdout).to match(/min_disk="1024"/)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|