Browse Source

Merge "Get rid of the $pyvers variable"

master
Zuul 5 days ago
committed by Gerrit Code Review
parent
commit
61a5127cc9
3 changed files with 44 additions and 73 deletions
  1. +2
    -2
      manifests/init.pp
  2. +29
    -30
      manifests/params.pp
  3. +13
    -41
      spec/classes/tempest_init_spec.rb

+ 2
- 2
manifests/init.pp View File

@ -437,7 +437,7 @@ class tempest(
include openstacklib::openstackclient
if $install_from_source {
$setuptools_pkg = "python${tempest::params::pyvers}-setuptools"
$setuptools_pkg = 'python3-setuptools'
ensure_packages([
'git',
$setuptools_pkg,
@ -478,7 +478,7 @@ class tempest(
if $setup_venv {
# virtualenv will be installed along with tox
exec { 'setup-venv':
command => join(["virtualenv -p python${tempest::params::pyvers} ${tempest_clone_path}/.venv",
command => join(["virtualenv -p python3 ${tempest_clone_path}/.venv",
"${tempest_clone_path}/.venv/bin/${tempest::params::pip_command} install -U -r requirements.txt"],
' && '),
cwd => $tempest_clone_path,


+ 29
- 30
manifests/params.pp View File

@ -1,13 +1,12 @@
#
class tempest::params {
include openstacklib::defaults
$pyvers = $::openstacklib::defaults::pyvers
$pip_command = "pip${pyvers}"
$pip_command = 'pip3'
case $::osfamily {
'RedHat': {
$dev_packages = [
"python${pyvers}-devel",
'python3-devel',
'libxslt-devel',
'libxml2-devel',
'openssl-devel',
@ -15,43 +14,43 @@ class tempest::params {
'patch',
'gcc'
]
$python_telemetry_tests = "python${pyvers}-telemetry-tests-tempest"
$python_cinder_tests = "python${pyvers}-cinder-tests-tempest"
$python_designate_tests = "python${pyvers}-designate-tests-tempest"
$python_glance_tests = "python${pyvers}-glance-tests"
$python_heat_tests = "python${pyvers}-heat-tests-tempest"
$python_ironic_tests = "python${pyvers}-ironic-tests-tempest"
$python_keystone_tests = "python${pyvers}-keystone-tests"
$python_magnum_tests = "python${pyvers}-magnum-tests-tempest"
$python_mistral_tests = "python${pyvers}-mistral-tests-tempest"
$python_vitrage_tests = "python${pyvers}-vitrage-tests-tempest"
$python_murano_tests = "python${pyvers}-murano-tests-tempest"
$python_neutron_tests = "python${pyvers}-neutron-tests-tempest"
$python_l2gw_tests = "python${pyvers}-networking-l2gw-tests-tempest"
$python_vpnaas_tests = "python${pyvers}-neutron-vpnaas-tests"
$python_dr_tests = "python${pyvers}-neutron-dynamic-routing-tests"
$python_nova_tests = "python${pyvers}-nova-tests"
$python_sahara_tests = "python${pyvers}-sahara-tests-tempest"
$python_swift_tests = "python${pyvers}-swift-tests"
$python_trove_tests = "python${pyvers}-trove-tests-tempest"
$python_watcher_tests = "python${pyvers}-watcher-tests-tempest"
$python_zaqar_tests = "python${pyvers}-zaqar-tests-tempest"
$python_octavia_tests = "python${pyvers}-octavia-tests-tempest"
$python_ec2api_tests = "python${pyvers}-ec2api-tests-tempest"
$python_barbican_tests = "python${pyvers}-barbican-tests-tempest"
$python_telemetry_tests = 'python3-telemetry-tests-tempest'
$python_cinder_tests = 'python3-cinder-tests-tempest'
$python_designate_tests = 'python3-designate-tests-tempest'
$python_glance_tests = 'python3-glance-tests'
$python_heat_tests = 'python3-heat-tests-tempest'
$python_ironic_tests = 'python3-ironic-tests-tempest'
$python_keystone_tests = 'python3-keystone-tests'
$python_magnum_tests = 'python3-magnum-tests-tempest'
$python_mistral_tests = 'python3-mistral-tests-tempest'
$python_vitrage_tests = 'python3-vitrage-tests-tempest'
$python_murano_tests = 'python3-murano-tests-tempest'
$python_neutron_tests = 'python3-neutron-tests-tempest'
$python_l2gw_tests = 'python3-networking-l2gw-tests-tempest'
$python_vpnaas_tests = 'python3-neutron-vpnaas-tests'
$python_dr_tests = 'python3-neutron-dynamic-routing-tests'
$python_nova_tests = 'python3-nova-tests'
$python_sahara_tests = 'python3-sahara-tests-tempest'
$python_swift_tests = 'python3-swift-tests'
$python_trove_tests = 'python3-trove-tests-tempest'
$python_watcher_tests = 'python3-watcher-tests-tempest'
$python_zaqar_tests = 'python3-zaqar-tests-tempest'
$python_octavia_tests = 'python3-octavia-tests-tempest'
$python_ec2api_tests = 'python3-ec2api-tests-tempest'
$python_barbican_tests = 'python3-barbican-tests-tempest'
$package_name = 'openstack-tempest'
}
'Debian': {
$dev_packages = [
"python${pyvers}-dev",
'python3-dev',
'libxslt1-dev',
'libxml2-dev',
'libssl-dev',
'libffi-dev',
'patch',
'gcc',
"python${pyvers}-virtualenv",
"python${pyvers}-pip",
'python3-virtualenv',
'python3-pip',
]
if $::os_package_type == 'debian' {
$python_telemetry_tests = 'telemetry-tempest-plugin'


+ 13
- 41
spec/classes/tempest_init_spec.rb View File

@ -160,7 +160,7 @@ describe 'tempest' do
it 'installs packages' do
is_expected.to contain_package('git')
is_expected.to contain_package("python#{platform_params[:pyvers]}-setuptools")
is_expected.to contain_package("python3-setuptools")
platform_params[:dev_packages].each do |package|
is_expected.to contain_package("#{package}")
@ -172,7 +172,7 @@ describe 'tempest' do
:command => 'easy_install pip',
:unless => "which #{platform_params[:pip_command]}",
:path => ['/bin', '/usr/bin', '/usr/local/bin'],
:require => "Package[python#{platform_params[:pyvers]}-setuptools]"
:require => "Package[python3-setuptools]"
)
is_expected.to contain_exec('install-tox').with(
@ -304,7 +304,7 @@ describe 'tempest' do
it 'sets up virtualenv for tempest' do
is_expected.to contain_exec('setup-venv').with(
: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",
:command => "virtualenv -p python3 /var/lib/tempest/.venv && /var/lib/tempest/.venv/bin/#{platform_params[:pip_command]} install -U -r requirements.txt",
:cwd => '/var/lib/tempest',
:unless => 'test -d /var/lib/tempest/.venv',
:path => ['/bin', '/usr/bin', '/usr/local/bin']
@ -466,45 +466,17 @@ describe 'tempest' do
'python3-virtualenv',
'python3-pip' ],
:package_name => 'tempest',
:pip_command => 'pip3',
:pyvers => '3' }
:pip_command => 'pip3' }
when 'RedHat'
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
{ :dev_packages => ['python3-devel',
'libxslt-devel',
'libxml2-devel',
'openssl-devel',
'libffi-devel',
'patch',
'gcc'],
:package_name => 'openstack-tempest',
:pip_command => 'pip3' }
end
end


Loading…
Cancel
Save