2012-05-08 07:33:32 +00:00
|
|
|
# class for installing and configuring tempest
|
2013-06-29 03:05:19 +00:00
|
|
|
#
|
|
|
|
# The class checks out the tempest repo and sets the basic config.
|
2012-05-08 07:33:32 +00:00
|
|
|
#
|
2013-06-28 17:22:47 +00:00
|
|
|
# Note that only parameters for which values are provided will be
|
|
|
|
# managed in tempest.conf.
|
|
|
|
#
|
2012-05-08 07:33:32 +00:00
|
|
|
class tempest(
|
2013-06-28 17:22:47 +00:00
|
|
|
# Clone config
|
|
|
|
#
|
|
|
|
$tempest_repo_uri = "git://github.com/openstack/tempest.git",
|
|
|
|
$tempest_clone_path = '/var/lib/tempest',
|
|
|
|
$tempest_clone_owner = 'root',
|
|
|
|
|
|
|
|
$version_to_test = 'master',
|
|
|
|
|
|
|
|
# Glance image config
|
|
|
|
#
|
|
|
|
$image_name = 'cirros',
|
|
|
|
|
|
|
|
# tempest.conf parameters
|
|
|
|
#
|
|
|
|
$identity_uri = undef,
|
2012-05-08 07:33:32 +00:00
|
|
|
# non admin user
|
2013-06-28 17:22:47 +00:00
|
|
|
$username = undef,
|
|
|
|
$password = undef,
|
|
|
|
$tenant_name = undef,
|
2012-05-08 07:33:32 +00:00
|
|
|
# another non-admin user
|
2013-06-28 17:22:47 +00:00
|
|
|
$alt_username = undef,
|
|
|
|
$alt_password = undef,
|
|
|
|
$alt_tenant_name = undef,
|
|
|
|
# admin user
|
|
|
|
$admin_username = undef,
|
|
|
|
$admin_password = undef,
|
|
|
|
$admin_tenant_name = undef,
|
2012-05-08 07:33:32 +00:00
|
|
|
# image information
|
2013-06-28 17:22:47 +00:00
|
|
|
$image_ref = undef,
|
|
|
|
$image_ref_alt = undef,
|
|
|
|
$flavor_ref = undef,
|
|
|
|
$flavor_ref_alt = undef,
|
|
|
|
# whitebox
|
|
|
|
$whitebox_db_uri = undef,
|
2013-02-20 04:28:26 +00:00
|
|
|
# testing features that are supported
|
2013-06-28 17:22:47 +00:00
|
|
|
$resize_available = undef,
|
|
|
|
$change_password_available = undef,
|
2013-02-20 04:28:26 +00:00
|
|
|
|
2012-05-08 07:33:32 +00:00
|
|
|
) {
|
|
|
|
|
2013-03-01 05:31:40 +00:00
|
|
|
include 'tempest::params'
|
|
|
|
|
2013-06-30 15:17:06 +00:00
|
|
|
ensure_packages([
|
|
|
|
'git',
|
|
|
|
'python-setuptools',
|
|
|
|
])
|
2013-06-27 06:52:59 +00:00
|
|
|
|
2013-06-30 15:17:06 +00:00
|
|
|
ensure_packages($tempest::params::dev_packages)
|
2012-05-08 07:33:32 +00:00
|
|
|
|
2013-06-30 15:17:06 +00:00
|
|
|
exec { 'install-pip':
|
|
|
|
command => '/usr/bin/easy_install pip',
|
2013-02-22 05:55:33 +00:00
|
|
|
unless => '/usr/bin/which pip',
|
2013-06-30 15:17:06 +00:00
|
|
|
require => Package['python-setuptools'],
|
2013-02-22 05:55:33 +00:00
|
|
|
}
|
|
|
|
|
2013-06-28 17:22:47 +00:00
|
|
|
vcsrepo { $tempest_clone_path:
|
2012-05-08 07:33:32 +00:00
|
|
|
ensure => 'present',
|
2013-06-28 17:22:47 +00:00
|
|
|
source => $tempest_repo_uri,
|
2013-02-14 07:07:47 +00:00
|
|
|
revision => $revision,
|
2012-05-08 07:33:32 +00:00
|
|
|
provider => 'git',
|
2013-02-22 06:22:43 +00:00
|
|
|
require => Package['git'],
|
2013-06-28 17:22:47 +00:00
|
|
|
user => $tempest_clone_owner,
|
2013-02-14 07:07:47 +00:00
|
|
|
}
|
2012-05-08 07:33:32 +00:00
|
|
|
|
2013-06-28 17:22:47 +00:00
|
|
|
file { "${tempest_clone_path}/jenkins_launch_script.sh":
|
2013-02-28 08:19:56 +00:00
|
|
|
source => 'puppet:///modules/tempest/run_tests.sh',
|
|
|
|
mode => '777',
|
2013-06-28 17:22:47 +00:00
|
|
|
require => Vcsrepo[$tempest_clone_path],
|
2013-02-28 08:19:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-02-20 04:13:35 +00:00
|
|
|
if $version_to_test == 'folsom' {
|
2013-06-28 17:22:47 +00:00
|
|
|
file { "${tempest_clone_path}/tempest/openstack":
|
2013-02-20 04:13:35 +00:00
|
|
|
purge => true,
|
|
|
|
recurse => true,
|
2013-06-28 17:22:47 +00:00
|
|
|
require => Vcsrepo[$tempest_clone_path],
|
2013-02-20 04:13:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-28 17:22:47 +00:00
|
|
|
$tempest_conf = "${tempest_clone_path}/etc/tempest.conf"
|
|
|
|
|
|
|
|
file { $tempest_conf:
|
|
|
|
replace => false,
|
|
|
|
source => "${tempest_conf}.sample",
|
|
|
|
require => Vcsrepo[$tempest_clone_path],
|
|
|
|
owner => $tempest_clone_owner,
|
|
|
|
}
|
|
|
|
|
|
|
|
Tempest_config {
|
|
|
|
path => $tempest_conf,
|
|
|
|
require => File[$tempest_conf],
|
|
|
|
}
|
|
|
|
|
|
|
|
tempest_config {
|
|
|
|
'compute/change_password_available': value => $change_password_available;
|
|
|
|
'compute/flavor_ref': value => $flavor_ref;
|
|
|
|
'compute/flavor_ref_alt': value => $flavor_ref_alt;
|
|
|
|
'compute/image_ref': value => $image_ref;
|
|
|
|
'compute/image_ref_alt': value => $image_ref_alt;
|
|
|
|
'compute/resize_available': value => $resize_available;
|
|
|
|
'identity/admin_password': value => $admin_password;
|
|
|
|
'identity/admin_tenant_name': value => $admin_tenant_name;
|
|
|
|
'identity/admin_username': value => $admin_username;
|
|
|
|
'identity/alt_password': value => $alt_password;
|
|
|
|
'identity/alt_tenant_name': value => $alt_tenant_name;
|
|
|
|
'identity/alt_username': value => $alt_username;
|
|
|
|
'identity/password': value => $password;
|
|
|
|
'identity/tenant_name': value => $tenant_name;
|
|
|
|
'identity/uri': value => $identity_uri;
|
|
|
|
'identity/username': value => $username;
|
|
|
|
'whitebox/db_uri': value => $whitebox_db_uri;
|
2012-05-08 07:33:32 +00:00
|
|
|
}
|
|
|
|
|
2013-02-15 23:40:11 +00:00
|
|
|
# retrieve the name of the glance image
|
|
|
|
# and use it to set tempest.conf
|
|
|
|
tempest_glance_id_setter { 'image_ref':
|
|
|
|
ensure => present,
|
2013-06-28 17:22:47 +00:00
|
|
|
tempest_conf_path => $tempest_conf,
|
2013-02-15 23:40:11 +00:00
|
|
|
image_name => $image_name,
|
2013-06-29 03:05:19 +00:00
|
|
|
require => File[$tempest_conf],
|
2013-02-15 23:40:11 +00:00
|
|
|
}
|
|
|
|
tempest_glance_id_setter { 'image_ref_alt':
|
|
|
|
ensure => present,
|
2013-06-28 17:22:47 +00:00
|
|
|
tempest_conf_path => $tempest_conf,
|
2013-02-15 23:40:11 +00:00
|
|
|
image_name => $image_name,
|
2013-06-29 03:05:19 +00:00
|
|
|
require => File[$tempest_conf],
|
2013-02-15 23:40:11 +00:00
|
|
|
}
|
|
|
|
|
2012-05-08 07:33:32 +00:00
|
|
|
}
|