2014-03-25 16:44:31 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'tempest' do
|
|
|
|
shared_examples 'tempest' do
|
2015-08-24 17:22:41 -04:00
|
|
|
|
|
|
|
let :pre_condition do
|
2019-12-08 23:22:18 +01:00
|
|
|
"include glance
|
|
|
|
include neutron"
|
2015-08-24 17:22:41 -04:00
|
|
|
end
|
|
|
|
|
2014-03-25 16:44:31 +01:00
|
|
|
context 'without parameters' do
|
|
|
|
describe "should raise error" do
|
2015-03-19 20:12:28 +01:00
|
|
|
it { expect { is_expected.to contain_class('tempest::params') }.to raise_error(Puppet::Error, /A value for either image_name or image_ref/) }
|
2014-03-25 16:44:31 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with image_name parameters' do
|
|
|
|
let :params do
|
|
|
|
{ :image_name => 'image_name' }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "should raise error" do
|
2015-03-19 20:12:28 +01:00
|
|
|
it { expect { is_expected.to contain_class('tempest::params') }.to raise_error(Puppet::Error, /A value for either image_name_alt or image_ref_alt/) }
|
2014-03-25 16:44:31 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-03-28 16:20:07 -07:00
|
|
|
context 'with image_ref parameters' do
|
|
|
|
let :params do
|
2016-11-01 15:39:56 +08:00
|
|
|
{ :image_ref => '4c423fc6-87f7-4e6d-9d3c-abc13058ae5b',
|
|
|
|
:image_ref_alt => '4c423fc6-87f7-4e6d-9d3c-abc13058ae5b' }
|
2014-03-28 16:20:07 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'configures image_ref' do
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('compute/image_ref').with_value('4c423fc6-87f7-4e6d-9d3c-abc13058ae5b')
|
2014-03-28 16:20:07 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with image_name' do
|
|
|
|
let :params do
|
2016-11-01 15:39:56 +08:00
|
|
|
{ :image_name => 'cirros',
|
|
|
|
:image_name_alt => 'cirros' }
|
2014-03-28 16:20:07 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'uses a resource to configure image_ref from image_name' do
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_glance_id_setter('image_ref').with_image_name('cirros')
|
2014-03-28 16:20:07 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with image_ref and image_name parameters' do
|
|
|
|
let :params do
|
2016-11-01 15:39:56 +08:00
|
|
|
{ :image_name => 'cirros',
|
|
|
|
:image_name_alt => 'cirros',
|
|
|
|
:image_ref => '4c423fc6-87f7-4e6d-9d3c-abc13058ae5b',
|
|
|
|
:image_ref_alt => '4c423fc6-87f7-4e6d-9d3c-abc13058ae5b' }
|
2014-03-28 16:20:07 -07:00
|
|
|
end
|
|
|
|
|
2015-03-19 20:12:28 +01:00
|
|
|
it_raises 'a Puppet::Error', /either image_name or image_ref/
|
2014-03-28 16:20:07 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'with public_network_id parameter' do
|
|
|
|
let :params do
|
|
|
|
{ :neutron_available => true,
|
|
|
|
:configure_images => false,
|
|
|
|
:public_network_id => '4c423fc6-87f7-4e6d-9d3c-abc13058ae5b' }
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'configures public_network_id' do
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('network/public_network_id').with_value('4c423fc6-87f7-4e6d-9d3c-abc13058ae5b')
|
2014-03-28 16:20:07 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with public_network_name parameter' do
|
|
|
|
let :params do
|
|
|
|
{ :neutron_available => true,
|
|
|
|
:configure_images => false,
|
|
|
|
:public_network_name => 'public' }
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'uses a resource to configure public_network_id from public_network_name' do
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_neutron_net_id_setter('public_network_id').with_network_name('public')
|
2014-03-28 16:20:07 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with public_network_id and public_network_name' do
|
|
|
|
let :params do
|
|
|
|
{ :neutron_available => true,
|
|
|
|
:configure_images => false,
|
|
|
|
:public_network_name => 'public',
|
|
|
|
:public_network_id => '4c423fc6-87f7-4e6d-9d3c-abc13058ae5b' }
|
|
|
|
end
|
2015-03-19 20:12:28 +01:00
|
|
|
|
|
|
|
it_raises 'a Puppet::Error', /either public_network_id or public_network_name/
|
2014-03-28 16:20:07 -07:00
|
|
|
end
|
|
|
|
|
2014-03-25 16:44:31 +01:00
|
|
|
context 'without configures images and neutron_available' do
|
|
|
|
let :params do
|
|
|
|
{ :configure_images => false,
|
|
|
|
:neutron_available => true }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "should raise error" do
|
2015-03-19 20:12:28 +01:00
|
|
|
it { expect { is_expected.to contain_class('tempest::params') }.to raise_error(Puppet::Error, /A value for either public_network_id or public_network_name/) }
|
2014-03-25 16:44:31 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-03-08 19:03:56 +01:00
|
|
|
context 'with sahara_plugins' do
|
|
|
|
let :params do
|
|
|
|
{ :configure_images => false,
|
|
|
|
:sahara_available => true,
|
|
|
|
:sahara_plugins => ['vanilla'] }
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'properly configures Sahara plugins in tempest.conf' do
|
|
|
|
is_expected.to contain_tempest_config('data-processing-feature-enabled/plugins').with_value(['vanilla'])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-07-28 02:07:41 -04:00
|
|
|
context 'with tempest_roles' do
|
|
|
|
let :params do
|
|
|
|
{ :configure_images => false,
|
|
|
|
:tempest_roles => ['Member', 'creator'], }
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'properly sets tempest_roles in tempest.conf' do
|
|
|
|
is_expected.to contain_tempest_config('auth/tempest_roles').with_value('Member,creator')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-09-02 00:40:44 +02:00
|
|
|
context 'with ec2api_available parameter' do
|
|
|
|
let :params do
|
|
|
|
{ :ec2api_available => true,
|
|
|
|
:configure_images => false,
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'creates ec2 credentials' do
|
|
|
|
is_expected.to contain_tempest_ec2_credentials('ec2_test_creds').with(
|
2016-11-01 15:39:56 +08:00
|
|
|
:ensure => 'present',
|
|
|
|
:tempest_conf_path => '/var/lib/tempest/etc/tempest.conf',
|
|
|
|
:user => 'ec2api-tester',
|
|
|
|
:project => 'openstack'
|
2016-09-02 00:40:44 +02:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2014-03-25 16:44:31 +01:00
|
|
|
context 'with parameters' do
|
|
|
|
let :params do
|
|
|
|
{ :configure_images => true,
|
|
|
|
:image_name => 'image name',
|
|
|
|
:image_name_alt => 'image name alt',
|
|
|
|
:public_network_name => 'network name',
|
2015-04-05 12:38:53 +02:00
|
|
|
:neutron_available => true,
|
2016-05-17 18:06:01 -06:00
|
|
|
:install_from_source => true,
|
|
|
|
:setup_venv => true
|
2015-04-05 12:38:53 +02:00
|
|
|
}
|
2014-03-25 16:44:31 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "should install tempest" do
|
|
|
|
it 'installs packages' do
|
2015-04-05 12:38:53 +02:00
|
|
|
|
|
|
|
is_expected.to contain_package('git')
|
2019-04-24 12:31:18 -06:00
|
|
|
is_expected.to contain_package("python#{platform_params[:pyvers]}-setuptools")
|
2015-04-05 12:38:53 +02:00
|
|
|
|
|
|
|
platform_params[:dev_packages].each do |package|
|
|
|
|
is_expected.to contain_package("#{package}")
|
|
|
|
end
|
|
|
|
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_class('tempest::params')
|
2014-03-25 16:44:31 +01:00
|
|
|
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_exec('install-pip').with(
|
2016-05-17 18:06:01 -06:00
|
|
|
:command => 'easy_install pip',
|
2019-04-24 12:31:18 -06:00
|
|
|
:unless => "which #{platform_params[:pip_command]}",
|
2016-05-17 18:06:01 -06:00
|
|
|
:path => ['/bin', '/usr/bin', '/usr/local/bin'],
|
2019-04-24 12:31:18 -06:00
|
|
|
:require => "Package[python#{platform_params[:pyvers]}-setuptools]"
|
2014-03-25 16:44:31 +01:00
|
|
|
)
|
|
|
|
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_exec('install-tox').with(
|
2019-04-24 12:31:18 -06:00
|
|
|
:command => "#{platform_params[:pip_command]} install -U tox",
|
2016-05-17 18:06:01 -06:00
|
|
|
:unless => 'which tox',
|
|
|
|
:path => ['/bin', '/usr/bin', '/usr/local/bin'],
|
2014-03-25 16:44:31 +01:00
|
|
|
:require => 'Exec[install-pip]'
|
|
|
|
)
|
|
|
|
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_vcsrepo('/var/lib/tempest').with(
|
2014-03-25 16:44:31 +01:00
|
|
|
:ensure => 'present',
|
|
|
|
:source => 'git://github.com/openstack/tempest.git',
|
|
|
|
:revision => nil,
|
|
|
|
:provider => 'git',
|
|
|
|
:require => 'Package[git]',
|
|
|
|
:user => 'root'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2019-02-04 10:29:07 +01:00
|
|
|
it { should contain_class('openstacklib::openstackclient') }
|
2016-04-04 10:28:11 -04:00
|
|
|
|
2014-03-25 16:44:31 +01:00
|
|
|
it 'configure tempest config' do
|
2016-05-10 16:13:19 +02:00
|
|
|
is_expected.to contain_tempest_config('auth/admin_domain_name').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('auth/admin_password').with_secret( true )
|
|
|
|
is_expected.to contain_tempest_config('auth/admin_project_name').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('auth/admin_username').with(:value => nil)
|
2016-07-26 16:07:52 -04:00
|
|
|
is_expected.to contain_tempest_config('auth/tempest_roles').with(:value => '<SERVICE DEFAULT>')
|
2016-05-10 16:13:19 +02:00
|
|
|
is_expected.to contain_tempest_config('auth/use_dynamic_credentials').with(:value => nil)
|
2016-06-06 15:30:40 -04:00
|
|
|
is_expected.to contain_tempest_config('dns/nameservers').with(:value => nil)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('compute/change_password_available').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('compute/flavor_ref').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('compute/flavor_ref_alt').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('compute/image_alt_ssh_user').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('compute/image_ref').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('compute/image_ref_alt').with(:value => nil)
|
2016-02-22 20:55:16 -05:00
|
|
|
is_expected.to contain_tempest_config('compute/build_interval').with(:value => nil)
|
2016-07-08 16:27:00 -04:00
|
|
|
is_expected.to contain_tempest_config('compute-feature-enabled/attach_encrypted_volume').with(:value => false)
|
2017-06-28 11:32:27 +00:00
|
|
|
is_expected.to contain_tempest_config('compute-feature-enabled/resize').with(:value => false)
|
2018-06-13 17:10:41 +05:30
|
|
|
is_expected.to contain_tempest_config('baremetal/driver').with(:value => 'fake')
|
|
|
|
is_expected.to contain_tempest_config('baremetal/enabled_hardware_types').with(:value => 'ipmi')
|
2016-11-01 15:39:56 +08:00
|
|
|
is_expected.to contain_tempest_config('validation/image_ssh_user').with(:value => nil)
|
2017-03-09 13:02:05 +00:00
|
|
|
is_expected.to contain_tempest_config('validation/run_validation').with(:value => false)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('identity/admin_role').with(:value => nil)
|
2017-09-26 17:32:13 +02:00
|
|
|
is_expected.to contain_tempest_config('identity/auth_version').with(:value => 'v3')
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('identity/alt_password').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('identity/alt_password').with_secret( true )
|
2016-05-10 16:13:19 +02:00
|
|
|
is_expected.to contain_tempest_config('identity/alt_project_name').with(:value => nil)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('identity/alt_username').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('identity/password').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('identity/password').with_secret( true )
|
2016-05-10 16:13:19 +02:00
|
|
|
is_expected.to contain_tempest_config('identity/project_name').with(:value => nil)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('identity/uri').with(:value => nil)
|
2015-07-10 15:25:01 -04:00
|
|
|
is_expected.to contain_tempest_config('identity/uri_v3').with(:value => nil)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('identity/username').with(:value => nil)
|
2016-03-04 11:52:33 -05:00
|
|
|
is_expected.to contain_tempest_config('identity/ca_certificates_file').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('identity/disable_ssl_certificate_validation').with(:value => nil)
|
2017-09-26 17:32:13 +02:00
|
|
|
is_expected.to contain_tempest_config('identity-feature-enabled/api_v2').with(:value => false)
|
2015-07-05 16:09:37 -04:00
|
|
|
is_expected.to contain_tempest_config('identity-feature-enabled/api_v3').with(:value => true)
|
2016-12-15 10:25:26 +01:00
|
|
|
is_expected.to contain_tempest_config('image-feature-enabled/api_v1').with(:value => true)
|
|
|
|
is_expected.to contain_tempest_config('image-feature-enabled/api_v2').with(:value => true)
|
2017-06-19 18:58:33 +02:00
|
|
|
is_expected.to contain_tempest_config('l2gw/l2gw_switch').with(:value => nil)
|
2017-03-08 12:21:48 +00:00
|
|
|
is_expected.to contain_tempest_config('network-feature-enabled/api_extensions').with(:value => nil)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('network/public_network_id').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('network/public_router_id').with(:value => '')
|
2015-09-17 23:03:11 -04:00
|
|
|
is_expected.to contain_tempest_config('dashboard/login_url').with(:value => nil)
|
|
|
|
is_expected.to contain_tempest_config('dashboard/dashboard_url').with(:value => nil)
|
2016-08-17 10:05:32 -04:00
|
|
|
is_expected.to contain_tempest_config('database/db_flavor_ref').with_value('<SERVICE DEFAULT>')
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('service_available/cinder').with(:value => true)
|
2016-10-11 17:16:29 -04:00
|
|
|
is_expected.to contain_tempest_config('volume-feature-enabled/backup').with(:value => false)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('service_available/glance').with(:value => true)
|
|
|
|
is_expected.to contain_tempest_config('service_available/heat').with(:value => false)
|
|
|
|
is_expected.to contain_tempest_config('service_available/ceilometer').with(:value => false)
|
2015-11-23 12:15:24 +01:00
|
|
|
is_expected.to contain_tempest_config('service_available/aodh').with(:value => false)
|
2016-08-09 14:23:07 -04:00
|
|
|
is_expected.to contain_tempest_config('service_available/aodh_plugin').with(:value => false)
|
2017-04-20 17:50:22 +02:00
|
|
|
is_expected.to contain_tempest_config('service_available/bgpvpn').with(:value => false)
|
2016-04-20 12:44:45 -04:00
|
|
|
is_expected.to contain_tempest_config('service_available/gnocchi').with(:value => false)
|
2017-01-24 20:56:58 -05:00
|
|
|
is_expected.to contain_tempest_config('service_available/panko').with(:value => false)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('service_available/horizon').with(:value => true)
|
2017-04-25 16:18:45 +02:00
|
|
|
is_expected.to contain_tempest_config('service_available/l2gw').with(:value => false)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('service_available/neutron').with(:value => true)
|
2016-08-09 10:59:23 -04:00
|
|
|
is_expected.to contain_tempest_config('service_available/mistral').with(:value => false)
|
2016-11-01 12:12:09 +02:00
|
|
|
is_expected.to contain_tempest_config('service_available/vitrage').with(:value => false)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('service_available/nova').with(:value => true)
|
2015-09-25 12:10:30 +03:00
|
|
|
is_expected.to contain_tempest_config('service_available/sahara').with(:value => false)
|
2015-11-13 17:18:06 +03:00
|
|
|
is_expected.to contain_tempest_config('service_available/murano').with(:value => false)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('service_available/swift').with(:value => false)
|
2015-09-30 10:02:55 -04:00
|
|
|
is_expected.to contain_tempest_config('service_available/trove').with(:value => false)
|
2016-01-02 07:28:58 -05:00
|
|
|
is_expected.to contain_tempest_config('service_available/ironic').with(:value => false)
|
2016-11-20 19:24:56 +00:00
|
|
|
is_expected.to contain_tempest_config('service_available/watcher').with(:value => false)
|
2016-02-12 11:11:53 -05:00
|
|
|
is_expected.to contain_tempest_config('service_available/zaqar').with(:value => false)
|
2016-06-06 15:30:40 -04:00
|
|
|
is_expected.to contain_tempest_config('service_available/designate').with(:value => false)
|
2017-02-08 10:35:23 +00:00
|
|
|
is_expected.to contain_tempest_config('service_available/octavia').with(:value => false)
|
2017-07-21 21:03:35 +05:30
|
|
|
is_expected.to contain_tempest_config('service_available/barbican').with(:value => false)
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_config('whitebox/db_uri').with(:value => nil)
|
2015-04-05 12:38:53 +02:00
|
|
|
is_expected.to contain_tempest_config('cli/cli_dir').with(:value => nil)
|
2015-07-05 16:09:37 -04:00
|
|
|
is_expected.to contain_tempest_config('oslo_concurrency/lock_path').with(:value => '/var/lib/tempest')
|
2015-08-28 16:55:12 -04:00
|
|
|
is_expected.to contain_tempest_config('scenario/img_dir').with(:value => '/var/lib/tempest')
|
2018-01-04 10:41:51 +08:00
|
|
|
is_expected.to contain_tempest_config('scenario/img_file').with(:value => 'cirros-0.4.0-x86_64-disk.img')
|
2015-12-03 18:33:09 +03:00
|
|
|
is_expected.to contain_tempest_config('service_broker/run_service_broker_tests').with(:value => false)
|
2017-12-21 10:49:13 -07:00
|
|
|
is_expected.to contain_oslo__log('tempest_config').with(
|
|
|
|
:debug => false,
|
|
|
|
:log_file => '<SERVICE DEFAULT>',
|
|
|
|
:use_stderr => true,
|
|
|
|
:use_syslog => false,
|
|
|
|
:logging_context_format_string => '<SERVICE DEFAULT>')
|
2016-09-07 18:08:52 -04:00
|
|
|
|
|
|
|
is_expected.not_to contain_tempest_config('magnum/keypair_id').with_value('default')
|
2014-03-25 16:44:31 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'set glance id' do
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_glance_id_setter('image_ref').with(
|
2014-03-25 16:44:31 +01:00
|
|
|
:ensure => 'present',
|
|
|
|
:tempest_conf_path => '/var/lib/tempest/etc/tempest.conf',
|
|
|
|
:image_name => 'image name',
|
|
|
|
)
|
|
|
|
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_glance_id_setter('image_ref_alt').with(
|
2014-03-25 16:44:31 +01:00
|
|
|
:ensure => 'present',
|
|
|
|
:tempest_conf_path => '/var/lib/tempest/etc/tempest.conf',
|
|
|
|
:image_name => 'image name alt',
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'neutron net id' do
|
2015-03-19 20:12:28 +01:00
|
|
|
is_expected.to contain_tempest_neutron_net_id_setter('public_network_id').with(
|
2014-03-25 16:44:31 +01:00
|
|
|
:ensure => 'present',
|
|
|
|
:tempest_conf_path => '/var/lib/tempest/etc/tempest.conf',
|
|
|
|
:network_name => 'network name',
|
|
|
|
)
|
|
|
|
end
|
2016-05-17 18:06:01 -06:00
|
|
|
|
|
|
|
it 'sets up virtualenv for tempest' do
|
|
|
|
is_expected.to contain_exec('setup-venv').with(
|
2019-04-24 12:31:18 -06:00
|
|
|
:command => "virtualenv -p python#{platform_params[:pyvers]} /var/lib/tempest/.venv && /var/lib/tempest/.venv/bin/#{platform_params[:pip_command]} install -U -r requirements.txt",
|
2016-05-17 18:06:01 -06:00
|
|
|
:cwd => '/var/lib/tempest',
|
|
|
|
:unless => 'test -d /var/lib/tempest/.venv',
|
|
|
|
:path => ['/bin', '/usr/bin', '/usr/local/bin']
|
|
|
|
)
|
|
|
|
end
|
2014-03-25 16:44:31 +01:00
|
|
|
end
|
|
|
|
end
|
2017-01-25 09:34:38 +00:00
|
|
|
|
|
|
|
context 'install Tempest from package' do
|
|
|
|
let :params do
|
|
|
|
{:install_from_source => false,
|
|
|
|
:image_name => 'image name',
|
|
|
|
:image_name_alt => 'image name alt'}
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'checks for tempest package' do
|
|
|
|
is_expected.to contain_package('tempest').with(
|
|
|
|
:ensure => 'present',
|
|
|
|
:name => platform_params[:package_name],
|
|
|
|
:tag => ['openstack', 'tempest-package'],
|
|
|
|
)
|
|
|
|
end
|
|
|
|
it 'creates tempest workspace' do
|
|
|
|
is_expected.to contain_exec('tempest-workspace').with(
|
|
|
|
:command => 'tempest init /var/lib/tempest',
|
|
|
|
:path => ['/bin', '/usr/bin'],
|
|
|
|
:refreshonly => true,
|
|
|
|
:require => 'Package[tempest]'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'tempest workspace customization' do
|
|
|
|
let :params do
|
|
|
|
{:tempest_workspace => '/tmp/tempest',
|
|
|
|
:image_name => 'image name',
|
|
|
|
:image_name_alt => 'image name alt',
|
|
|
|
:install_from_source => false}
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'supports customizes tempest workspace' do
|
|
|
|
is_expected.to contain_exec('tempest-workspace').with(
|
|
|
|
:command => 'tempest init /tmp/tempest',
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
2014-03-25 16:44:31 +01:00
|
|
|
end
|
|
|
|
|
2016-03-14 19:06:23 -04:00
|
|
|
shared_examples 'tempest with plugins packages' do
|
|
|
|
let :pre_condition do
|
2019-12-08 23:22:18 +01:00
|
|
|
"include glance
|
|
|
|
include neutron"
|
2016-03-14 19:06:23 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'with when managing tests packages for keystone (required service)' do
|
|
|
|
let :params do
|
|
|
|
{ :manage_tests_packages => true }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "should install keystone tests package" do
|
|
|
|
it { expect { is_expected.to contain_package('python-keystone-tests') } }
|
|
|
|
it { expect { is_expected.to_not contain_package('python-aodh-tests') } }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with when managing tests packages for aodh (optional service)' do
|
|
|
|
let :params do
|
|
|
|
{ :manage_tests_packages => true,
|
|
|
|
:aodh_available => true }
|
|
|
|
end
|
|
|
|
|
2016-04-02 19:23:24 +02:00
|
|
|
describe "should install aodh tests package" do
|
2016-03-14 19:06:23 -04:00
|
|
|
it { expect { is_expected.to contain_package('python-aodh-tests') } }
|
|
|
|
end
|
|
|
|
end
|
2016-04-02 19:23:24 +02:00
|
|
|
|
2016-09-14 13:25:11 +05:30
|
|
|
context 'with when managing tests packages for sahara (optional service)' do
|
|
|
|
let :params do
|
|
|
|
{ :manage_tests_packages => true,
|
2016-11-01 15:39:56 +08:00
|
|
|
:sahara_available => true }
|
2016-09-14 13:25:11 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
describe "should install sahara tests package" do
|
|
|
|
it { expect { is_expected.to contain_package('python-sahara-tests-tempest') } }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-04-02 19:23:24 +02:00
|
|
|
context 'with when managing tests packages for neutron (optional service)' do
|
|
|
|
let :params do
|
|
|
|
{ :manage_tests_packages => true,
|
2016-11-01 15:39:56 +08:00
|
|
|
:neutron_available => true }
|
2016-04-02 19:23:24 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "should install neutron and *aas tests packages" do
|
|
|
|
it { expect { is_expected.to contain_package('python-neutron-tests') } }
|
|
|
|
it { expect { is_expected.to contain_package('python-neutron-vpnaas-tests') } }
|
2018-07-17 18:18:55 +02:00
|
|
|
it { expect { is_expected.to contain_package('python-neutron-dynamic-routing-tests') } }
|
2017-07-17 23:23:13 +05:30
|
|
|
it { expect { is_expected.to contain_package('python-networking-l2gw-tests-tempest') } }
|
2016-09-14 13:25:11 +05:30
|
|
|
it { expect { is_expected.to contain_package('python-horizon-tests-tempest') } }
|
2016-04-02 19:23:24 +02:00
|
|
|
end
|
|
|
|
end
|
2016-03-14 19:06:23 -04:00
|
|
|
end
|
|
|
|
|
2016-04-06 14:50:19 +03:00
|
|
|
on_supported_os({
|
|
|
|
:supported_os => OSDefaults.get_supported_os
|
|
|
|
}).each do |os,facts|
|
|
|
|
context "on #{os}" do
|
|
|
|
let (:facts) do
|
|
|
|
facts.merge!(OSDefaults.get_facts({
|
|
|
|
:concat_basedir => '/var/lib/puppet/concat',
|
|
|
|
}))
|
|
|
|
end
|
|
|
|
let(:platform_params) do
|
|
|
|
case facts[:osfamily]
|
|
|
|
when 'Debian'
|
2019-04-24 12:31:18 -06:00
|
|
|
{ :dev_packages => ['python3-dev',
|
2016-04-06 14:50:19 +03:00
|
|
|
'libxslt1-dev',
|
|
|
|
'libxml2-dev',
|
|
|
|
'libssl-dev',
|
|
|
|
'libffi-dev',
|
|
|
|
'patch',
|
2016-04-14 10:51:27 -04:00
|
|
|
'gcc',
|
2019-04-24 12:31:18 -06:00
|
|
|
'python3-virtualenv',
|
|
|
|
'python3-pip' ],
|
|
|
|
:package_name => 'tempest',
|
|
|
|
:pip_command => 'pip3',
|
|
|
|
:pyvers => '3' }
|
2016-04-06 14:50:19 +03:00
|
|
|
when 'RedHat'
|
2020-04-01 11:45:23 +09:00
|
|
|
if facts[:operatingsystem] == 'Fedora'
|
|
|
|
{ :dev_packages => ['python-devel',
|
|
|
|
'libxslt-devel',
|
|
|
|
'libxml2-devel',
|
|
|
|
'openssl-devel',
|
|
|
|
'libffi-devel',
|
|
|
|
'patch',
|
|
|
|
'gcc'],
|
|
|
|
:package_name => 'openstack-tempest',
|
|
|
|
:pip_command => 'pip3',
|
|
|
|
:pyvers => '3' }
|
|
|
|
else
|
|
|
|
if facts[:operatingsystemmajrelease] > '7'
|
|
|
|
{ :dev_packages => ['python3-devel',
|
|
|
|
'libxslt-devel',
|
|
|
|
'libxml2-devel',
|
|
|
|
'openssl-devel',
|
|
|
|
'libffi-devel',
|
|
|
|
'patch',
|
|
|
|
'gcc'],
|
|
|
|
:package_name => 'openstack-tempest',
|
|
|
|
:pip_command => 'pip3',
|
|
|
|
:pyvers => '3' }
|
|
|
|
else
|
|
|
|
{ :dev_packages => ['python-devel',
|
|
|
|
'libxslt-devel',
|
|
|
|
'libxml2-devel',
|
|
|
|
'openssl-devel',
|
|
|
|
'libffi-devel',
|
|
|
|
'patch',
|
|
|
|
'gcc'],
|
|
|
|
:package_name => 'openstack-tempest',
|
|
|
|
:pip_command => 'pip',
|
|
|
|
:pyvers => '' }
|
|
|
|
end
|
|
|
|
end
|
2016-04-06 14:50:19 +03:00
|
|
|
end
|
2014-03-25 16:44:31 +01:00
|
|
|
end
|
|
|
|
|
2016-04-06 14:50:19 +03:00
|
|
|
it_behaves_like 'tempest'
|
|
|
|
it_behaves_like 'tempest with plugins packages'
|
2014-03-25 16:44:31 +01:00
|
|
|
end
|
2020-04-01 11:45:23 +09:00
|
|
|
end
|
2014-03-25 16:44:31 +01:00
|
|
|
end
|