Add acceptance tests for puppet-diskimage_builder.
Add acceptance tests for puppet-diskimage_builder module so that once the module is applied we check if packages were installed. Change-Id: I37a7e4ae9f1a380568c0aa4f09cef1dfb7c4aaa9 Co-Authored-By: Bruno Tavares <btavare@thoughtworks.com> Co-Authored-By: Danilo Ramalho <dramalho@thoughtworks.com>
This commit is contained in:
parent
15d181f4b4
commit
528e4ebccb
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,5 @@
|
||||
Gemfile.lock
|
||||
.bundled_gems/
|
||||
log/
|
||||
junit/
|
||||
.vagrant/
|
||||
|
4
Gemfile
4
Gemfile
@ -27,4 +27,8 @@ group :development, :test do
|
||||
|
||||
end
|
||||
|
||||
group :system_tests do
|
||||
gem 'beaker-rspec', :require => false
|
||||
end
|
||||
|
||||
# vim:ft=ruby
|
||||
|
64
spec/acceptance/basic_spec.rb
Normal file
64
spec/acceptance/basic_spec.rb
Normal file
@ -0,0 +1,64 @@
|
||||
require 'spec_helper_acceptance'
|
||||
|
||||
describe 'puppet-diskimage_builder module', :if => ['debian', 'ubuntu'].include?(os[:family]) do
|
||||
def pp_path
|
||||
base_path = File.dirname(__FILE__)
|
||||
File.join(base_path, 'fixtures')
|
||||
end
|
||||
|
||||
def preconditions_puppet_module
|
||||
module_path = File.join(pp_path, 'preconditions.pp')
|
||||
File.read(module_path)
|
||||
end
|
||||
|
||||
def default_puppet_module
|
||||
module_path = File.join(pp_path, 'default.pp')
|
||||
File.read(module_path)
|
||||
end
|
||||
|
||||
before(:all) do
|
||||
apply_manifest(preconditions_puppet_module, catch_failures: true)
|
||||
end
|
||||
|
||||
it 'should work with no errors' do
|
||||
apply_manifest(default_puppet_module, catch_failures: true)
|
||||
end
|
||||
|
||||
it 'should be idempotent' do
|
||||
apply_manifest(default_puppet_module, catch_changes: true)
|
||||
end
|
||||
|
||||
describe 'packages' do
|
||||
describe 'required OS packages' do
|
||||
required_packages = [
|
||||
package('debian-keyring'),
|
||||
package('debootstrap'),
|
||||
package('kpartx'),
|
||||
package('python-lzma'),
|
||||
package('python-yaml'),
|
||||
package('qemu-utils'),
|
||||
package('ubuntu-keyring'),
|
||||
package('vhd-util'),
|
||||
package('yum'),
|
||||
package('yum-utils'),
|
||||
]
|
||||
|
||||
required_packages.each do |package|
|
||||
describe package do
|
||||
it { should be_installed }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'required Python packages' do
|
||||
describe package('diskimage-builder') do
|
||||
it { should be_installed.by('pip') }
|
||||
end
|
||||
end
|
||||
|
||||
describe ppa('openstack-ci-core/vhd-util') do
|
||||
it { should exist }
|
||||
it { should be_enabled }
|
||||
end
|
||||
end
|
||||
end
|
1
spec/acceptance/fixtures/default.pp
Normal file
1
spec/acceptance/fixtures/default.pp
Normal file
@ -0,0 +1 @@
|
||||
class { '::diskimage_builder': }
|
7
spec/acceptance/fixtures/preconditions.pp
Normal file
7
spec/acceptance/fixtures/preconditions.pp
Normal file
@ -0,0 +1,7 @@
|
||||
package { 'ssl-cert':
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
package { 'software-properties-common':
|
||||
ensure => present,
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user