Project

General

Profile

« Previous | Next » 

Revision a787cf49

Added by Ewoud Kohl van Wijngaarden over 7 years ago

Move plugin tests to their own directory

View differences:

spec/classes/foreman_plugin_abrt_spec.rb
require 'spec_helper'
describe 'foreman::plugin::abrt' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('abrt') }
end
spec/classes/foreman_plugin_ansible_spec.rb
require 'spec_helper'
describe 'foreman::plugin::ansible' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('ansible') }
it { should contain_foreman__plugin('tasks') }
end
spec/classes/foreman_plugin_azure_spec.rb
require 'spec_helper'
describe 'foreman::plugin::azure' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('azure') }
end
spec/classes/foreman_plugin_bootdisk_spec.rb
require 'spec_helper'
describe 'foreman::plugin::bootdisk' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('bootdisk') }
end
spec/classes/foreman_plugin_chef_spec.rb
require 'spec_helper'
describe 'foreman::plugin::chef' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('chef') }
it { should contain_foreman__plugin('tasks') }
end
spec/classes/foreman_plugin_cockpit_spec.rb
require 'spec_helper'
describe 'foreman::plugin::cockpit' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('cockpit') }
end
spec/classes/foreman_plugin_default_hostgroup_spec.rb
require 'spec_helper'
describe 'foreman::plugin::default_hostgroup' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('default_hostgroup') }
end
spec/classes/foreman_plugin_dhcp_browser_spec.rb
require 'spec_helper'
describe 'foreman::plugin::dhcp_browser' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('dhcp_browser') }
end
spec/classes/foreman_plugin_digitalocean_spec.rb
require 'spec_helper'
describe 'foreman::plugin::digitalocean' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('digitalocean') }
end
spec/classes/foreman_plugin_discovery_spec.rb
require 'spec_helper'
describe 'foreman::plugin::discovery' do
on_os_under_test.each do |os, facts|
context "on #{os}" do
let(:facts) { facts }
let(:pre_condition) { 'include foreman' }
case facts[:operatingsystem]
when 'Debian'
tftproot = '/srv/tftp'
when 'FreeBSD'
tftproot = '/tftpboot'
else
tftproot = '/var/lib/tftpboot'
end
it { should contain_foreman__plugin('discovery') }
describe 'without paramaters' do
it { should_not contain_foreman__remote_file("#{tftproot}/boot/fdi-image-latest.tar") }
end
describe 'with install_images => true' do
let :params do
{
:install_images => true
}
end
it 'should download and install tarball' do
should contain_foreman__remote_file("#{tftproot}/boot/fdi-image-latest.tar").
with_remote_location('http://downloads.theforeman.org/discovery/releases/latest/fdi-image-latest.tar')
end
it 'should extract the tarball' do
should contain_exec('untar fdi-image-latest.tar').with({
'command' => 'tar xf fdi-image-latest.tar',
'path' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
'cwd' => "#{tftproot}/boot",
'creates' => "#{tftproot}/boot/fdi-image/initrd0.img",
})
end
end
end
end
end
spec/classes/foreman_plugin_docker_spec.rb
require 'spec_helper'
describe 'foreman::plugin::docker' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('docker') }
end
spec/classes/foreman_plugin_expire_hosts_spec.rb
require 'spec_helper'
describe 'foreman::plugin::expire_hosts' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('expire_hosts') }
end
spec/classes/foreman_plugin_hooks_spec.rb
require 'spec_helper'
describe 'foreman::plugin::hooks' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('hooks') }
end
spec/classes/foreman_plugin_host_extra_validator_spec.rb
require 'spec_helper'
describe 'foreman::plugin::host_extra_validator' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('host_extra_validator') }
end
spec/classes/foreman_plugin_memcache_spec.rb
require 'spec_helper'
describe 'foreman::plugin::memcache' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it 'should call the plugin' do
should contain_foreman__plugin('memcache')
end
end
spec/classes/foreman_plugin_monitoring_spec.rb
require 'spec_helper'
describe 'foreman::plugin::monitoring' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('monitoring') }
end
spec/classes/foreman_plugin_omaha_spec.rb
require 'spec_helper'
describe 'foreman::plugin::omaha' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('omaha') }
end
spec/classes/foreman_plugin_openscap_spec.rb
require 'spec_helper'
describe 'foreman::plugin::openscap' do
on_os_under_test.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'include foreman' }
it 'should call the plugin' do
should contain_foreman__plugin('openscap')
end
end
end
end
spec/classes/foreman_plugin_ovirt_provision_spec.rb
require 'spec_helper'
describe 'foreman::plugin::ovirt_provision' do
on_os_under_test.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'include foreman' }
if facts[:operatingsystem] == 'Fedora'
it 'should call the plugin' do
should contain_foreman__plugin('ovirt_provision').with_package('rubygem-ovirt_provision_plugin')
end
elsif facts[:osfamily] == 'RedHat'
it 'should call the plugin' do
should contain_foreman__plugin('ovirt_provision').with_package('tfm-rubygem-ovirt_provision_plugin')
end
elsif facts[:osfamily] == 'Debian'
it 'should call the plugin' do
should contain_foreman__plugin('ovirt_provision').with_package('ruby-ovirt-provision-plugin')
end
end
end
end
end
spec/classes/foreman_plugin_puppetdb_spec.rb
require 'spec_helper'
describe 'foreman::plugin::puppetdb' do
on_os_under_test.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'include foreman' }
if facts[:operatingsystem] == 'Fedora'
it 'should call the plugin' do
should contain_foreman__plugin('puppetdb').with_package('rubygem-puppetdb_foreman')
end
elsif facts[:osfamily] == 'RedHat'
it 'should call the plugin' do
should contain_foreman__plugin('puppetdb').with_package('tfm-rubygem-puppetdb_foreman')
end
elsif facts[:osfamily] == 'Debian'
it 'should call the plugin' do
should contain_foreman__plugin('puppetdb').with_package('ruby-puppetdb-foreman')
end
end
end
end
end
spec/classes/foreman_plugin_remote_execution_spec.rb
require 'spec_helper'
describe 'foreman::plugin::remote_execution' do
on_os_under_test.each do |os, facts|
let(:facts) { facts }
let(:pre_condition) { 'include foreman' }
context "on #{os}" do
it { should contain_foreman__plugin('remote_execution').that_notifies('Service[foreman-tasks]') }
it { should contain_foreman__plugin('tasks') }
end
end
end
spec/classes/foreman_plugin_salt_spec.rb
require 'spec_helper'
describe 'foreman::plugin::salt' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('salt') }
it { should contain_foreman__plugin('tasks') }
end
spec/classes/foreman_plugin_setup_spec.rb
require 'spec_helper'
describe 'foreman::plugin::setup' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('setup') }
end
spec/classes/foreman_plugin_tasks_spec.rb
require 'spec_helper'
describe 'foreman::plugin::tasks' do
on_os_under_test.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'include foreman' }
case facts[:osfamily]
when 'RedHat'
package_name = case facts[:operatingsystem]
when 'Fedora'
'rubygem-foreman-tasks'
else
'tfm-rubygem-foreman-tasks'
end
service_name = 'foreman-tasks'
when 'Debian'
package_name = 'ruby-foreman-tasks'
service_name = 'ruby-foreman-tasks'
else
package_name = 'foreman-tasks'
service_name = 'foreman-tasks'
end
it 'should call the plugin' do
should contain_foreman__plugin('tasks').with_package(package_name)
should contain_service('foreman-tasks').with('ensure' => 'running', 'enable' => 'true', 'name' => service_name)
end
end
end
end
spec/classes/foreman_plugin_templates_spec.rb
require 'spec_helper'
describe 'foreman::plugin::templates' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it 'should call the plugin' do
should contain_foreman__plugin('templates')
end
end
spec/classes/plugin/abrt_spec.rb
require 'spec_helper'
describe 'foreman::plugin::abrt' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('abrt') }
end
spec/classes/plugin/ansible_spec.rb
require 'spec_helper'
describe 'foreman::plugin::ansible' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('ansible') }
it { should contain_foreman__plugin('tasks') }
end
spec/classes/plugin/azure_spec.rb
require 'spec_helper'
describe 'foreman::plugin::azure' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('azure') }
end
spec/classes/plugin/bootdisk_spec.rb
require 'spec_helper'
describe 'foreman::plugin::bootdisk' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('bootdisk') }
end
spec/classes/plugin/chef_spec.rb
require 'spec_helper'
describe 'foreman::plugin::chef' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('chef') }
it { should contain_foreman__plugin('tasks') }
end
spec/classes/plugin/cockpit_spec.rb
require 'spec_helper'
describe 'foreman::plugin::cockpit' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('cockpit') }
end
spec/classes/plugin/default_hostgroup_spec.rb
require 'spec_helper'
describe 'foreman::plugin::default_hostgroup' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('default_hostgroup') }
end
spec/classes/plugin/dhcp_browser_spec.rb
require 'spec_helper'
describe 'foreman::plugin::dhcp_browser' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('dhcp_browser') }
end
spec/classes/plugin/digitalocean_spec.rb
require 'spec_helper'
describe 'foreman::plugin::digitalocean' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('digitalocean') }
end
spec/classes/plugin/discovery_spec.rb
require 'spec_helper'
describe 'foreman::plugin::discovery' do
on_os_under_test.each do |os, facts|
context "on #{os}" do
let(:facts) { facts }
let(:pre_condition) { 'include foreman' }
case facts[:operatingsystem]
when 'Debian'
tftproot = '/srv/tftp'
when 'FreeBSD'
tftproot = '/tftpboot'
else
tftproot = '/var/lib/tftpboot'
end
it { should contain_foreman__plugin('discovery') }
describe 'without paramaters' do
it { should_not contain_foreman__remote_file("#{tftproot}/boot/fdi-image-latest.tar") }
end
describe 'with install_images => true' do
let :params do
{
:install_images => true
}
end
it 'should download and install tarball' do
should contain_foreman__remote_file("#{tftproot}/boot/fdi-image-latest.tar").
with_remote_location('http://downloads.theforeman.org/discovery/releases/latest/fdi-image-latest.tar')
end
it 'should extract the tarball' do
should contain_exec('untar fdi-image-latest.tar').with({
'command' => 'tar xf fdi-image-latest.tar',
'path' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
'cwd' => "#{tftproot}/boot",
'creates' => "#{tftproot}/boot/fdi-image/initrd0.img",
})
end
end
end
end
end
spec/classes/plugin/docker_spec.rb
require 'spec_helper'
describe 'foreman::plugin::docker' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('docker') }
end
spec/classes/plugin/expire_hosts_spec.rb
require 'spec_helper'
describe 'foreman::plugin::expire_hosts' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('expire_hosts') }
end
spec/classes/plugin/hooks_spec.rb
require 'spec_helper'
describe 'foreman::plugin::hooks' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('hooks') }
end
spec/classes/plugin/host_extra_validator_spec.rb
require 'spec_helper'
describe 'foreman::plugin::host_extra_validator' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('host_extra_validator') }
end
spec/classes/plugin/memcache_spec.rb
require 'spec_helper'
describe 'foreman::plugin::memcache' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it 'should call the plugin' do
should contain_foreman__plugin('memcache')
end
end
spec/classes/plugin/monitoring_spec.rb
require 'spec_helper'
describe 'foreman::plugin::monitoring' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('monitoring') }
end
spec/classes/plugin/omaha_spec.rb
require 'spec_helper'
describe 'foreman::plugin::omaha' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('omaha') }
end
spec/classes/plugin/openscap_spec.rb
require 'spec_helper'
describe 'foreman::plugin::openscap' do
on_os_under_test.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'include foreman' }
it 'should call the plugin' do
should contain_foreman__plugin('openscap')
end
end
end
end
spec/classes/plugin/ovirt_provision_spec.rb
require 'spec_helper'
describe 'foreman::plugin::ovirt_provision' do
on_os_under_test.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'include foreman' }
if facts[:operatingsystem] == 'Fedora'
it 'should call the plugin' do
should contain_foreman__plugin('ovirt_provision').with_package('rubygem-ovirt_provision_plugin')
end
elsif facts[:osfamily] == 'RedHat'
it 'should call the plugin' do
should contain_foreman__plugin('ovirt_provision').with_package('tfm-rubygem-ovirt_provision_plugin')
end
elsif facts[:osfamily] == 'Debian'
it 'should call the plugin' do
should contain_foreman__plugin('ovirt_provision').with_package('ruby-ovirt-provision-plugin')
end
end
end
end
end
spec/classes/plugin/puppetdb_spec.rb
require 'spec_helper'
describe 'foreman::plugin::puppetdb' do
on_os_under_test.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'include foreman' }
if facts[:operatingsystem] == 'Fedora'
it 'should call the plugin' do
should contain_foreman__plugin('puppetdb').with_package('rubygem-puppetdb_foreman')
end
elsif facts[:osfamily] == 'RedHat'
it 'should call the plugin' do
should contain_foreman__plugin('puppetdb').with_package('tfm-rubygem-puppetdb_foreman')
end
elsif facts[:osfamily] == 'Debian'
it 'should call the plugin' do
should contain_foreman__plugin('puppetdb').with_package('ruby-puppetdb-foreman')
end
end
end
end
end
spec/classes/plugin/remote_execution_spec.rb
require 'spec_helper'
describe 'foreman::plugin::remote_execution' do
on_os_under_test.each do |os, facts|
let(:facts) { facts }
let(:pre_condition) { 'include foreman' }
context "on #{os}" do
it { should contain_foreman__plugin('remote_execution').that_notifies('Service[foreman-tasks]') }
it { should contain_foreman__plugin('tasks') }
end
end
end
spec/classes/plugin/salt_spec.rb
require 'spec_helper'
describe 'foreman::plugin::salt' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('salt') }
it { should contain_foreman__plugin('tasks') }
end
spec/classes/plugin/setup_spec.rb
require 'spec_helper'
describe 'foreman::plugin::setup' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it { should contain_foreman__plugin('setup') }
end
spec/classes/plugin/tasks_spec.rb
require 'spec_helper'
describe 'foreman::plugin::tasks' do
on_os_under_test.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'include foreman' }
case facts[:osfamily]
when 'RedHat'
package_name = case facts[:operatingsystem]
when 'Fedora'
'rubygem-foreman-tasks'
else
'tfm-rubygem-foreman-tasks'
end
service_name = 'foreman-tasks'
when 'Debian'
package_name = 'ruby-foreman-tasks'
service_name = 'ruby-foreman-tasks'
else
package_name = 'foreman-tasks'
service_name = 'foreman-tasks'
end
it 'should call the plugin' do
should contain_foreman__plugin('tasks').with_package(package_name)
should contain_service('foreman-tasks').with('ensure' => 'running', 'enable' => 'true', 'name' => service_name)
end
end
end
end
spec/classes/plugin/templates_spec.rb
require 'spec_helper'
describe 'foreman::plugin::templates' do
let(:facts) do
on_supported_os['redhat-7-x86_64']
end
let(:pre_condition) { 'include foreman' }
it 'should call the plugin' do
should contain_foreman__plugin('templates')
end
end

Also available in: Unified diff