Add rally::settings::tempest

According to master branch of rally, parameters in [image] has
been moved into [tempest] section, some has been renamed.

This patch aims to add a new class to manage parameters in [tempest].

Change-Id: I5fd3f1ad294789cfab5612be47d741138b2a8102
This commit is contained in:
Xingchao Yu
2016-06-25 22:42:58 +08:00
parent dee1fe6356
commit 74712dad9b
4 changed files with 134 additions and 18 deletions

View File

@@ -4,19 +4,6 @@
#
# === Parameters
#
# [*cirros_img_url*]
# (Optional) CirrOS image URL
# Defaults to $::os_service_default
#
# [*container_format*]
# (Optional) Image container formate
# Defaults to $::os_service_default
#
# [*disk_format*]
# (Optional) Image disk format
# Defaults to $::os_service_default
#
#
# [*project_domain*]
# (Optional) ID of domain in which projects will be created.
# Defaults to $::os_service_default
@@ -38,7 +25,6 @@
# Defaults to undef.
#
class rally::settings (
$cirros_img_url = $::os_service_default,
$project_domain = $::os_service_default,
$resource_deletion_timeout = $::os_service_default,
$resource_management_workers = $::os_service_default,
@@ -56,10 +42,10 @@ class rally::settings (
include ::rally::settings::nova
include ::rally::settings::sahara
include ::rally::settings::swift
include ::rally::settings::tempest
rally_config {
'cleanup/resource_deletion_timeout': value => $resource_deletion_timeout;
'image/cirros_img_url': value => $cirros_img_url;
'users_context/project_domain': value => $project_domain;
'users_context/resource_management_workers': value => $resource_management_workers;
'users_context/user_domain': value => $user_domain;

View File

@@ -0,0 +1,79 @@
# == Class: rally::settings::tempest
#
# Configure Rally benchmarking settings
#
# === Parameters
#
# [*img_url*]
# (Optional) image URL.
# Defaults to $::os_service_default
#
# [*img_disk_format*]
# (Optional) Image disk format to use when creating the image.
# Defaults to $::os_service_default
#
# [*img_container_format*]
# (Optional) Image container format to use when creating the image.
# Defaults to $::os_service_default
#
# [*img_name_regex*]
# (Optional) Regular expression for name of a public image to discover it in the cloud and use it for the tests.
# Defaults to $::os_service_default
#
# [*swift_operator_role*]
# (Optional) Role required for users to be able to create Swift containers.
# Defaults to $::os_service_default
#
# [*swift_reseller_admin_role*]
# (Optional) User role that has reseller admin.
# Defaults to $::os_service_default
#
# [*heat_stack_owner_role*]
# (Optional) Role required for users to be able to manage Heat stacks.
# Defaults to $::os_service_default
#
# [*heat_stack_user_role*]
# (Optional) Role for Heat template-defined users.
# Defaults to $::os_service_default
#
# [*flavor_ref_ram*]
# (Optional) Primary flavor RAM size used by most of the test cases.
# Defaults to $::os_service_default
#
# [*flavor_ref_alt_ram*]
# (Optional) Alternate reference flavor RAM size used by test thatneed two
# flavors, like those that resize an instnace.
# Defaults to $::os_service_default
#
# [*heat_instance_type_ram*]
# (Optional) RAM size flavor used for orchestration test cases.
# Defaults to $::os_service_default
#
class rally::settings::tempest (
$img_url = $::os_service_default,
$img_disk_format = $::os_service_default,
$img_container_format = $::os_service_default,
$img_name_regex = $::os_service_default,
$swift_operator_role = $::os_service_default,
$swift_reseller_admin_role = $::os_service_default,
$heat_stack_owner_role = $::os_service_default,
$heat_stack_user_role = $::os_service_default,
$flavor_ref_ram = $::os_service_default,
$flavor_ref_alt_ram = $::os_service_default,
$heat_instance_type_ram = $::os_service_default
) {
rally_config {
'tempest/img_url': value => $img_url;
'tempest/img_disk_format': value => $img_disk_format;
'tempest/img_container_format': value => $img_container_format;
'tempest/img_name_regex': value => $img_name_regex;
'tempest/swift_operator_role': value => $swift_operator_role;
'tempest/swift_reseller_admin_role': value => $swift_reseller_admin_role;
'tempest/heat_stack_owner_role': value => $heat_stack_owner_role;
'tempest/heat_stack_user_role': value => $heat_stack_user_role;
'tempest/flavor_ref_ram': value => $flavor_ref_ram;
'tempest/flavor_ref_alt_ram': value => $flavor_ref_alt_ram;
'tempest/heat_instance_type_ram': value => $heat_instance_type_ram;
}
}

View File

@@ -10,7 +10,6 @@ describe 'rally::settings' do
let :rally_settings_params do
{
:openstack_client_http_timeout => 180.0,
:cirros_img_url => 'http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img',
:resource_deletion_timeout => 600,
:project_domain => 'default',
:resource_management_workers => 30,
@@ -20,7 +19,6 @@ describe 'rally::settings' do
shared_examples_for 'with default parameters' do
it 'configures rally settings with default parameters' do
is_expected.to contain_rally_config('image/cirros_img_url').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('cleanup/resource_deletion_timeout').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('users_context/project_domain').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('users_context/resource_management_workers').with(:value => '<SERVICE DEFAULT>')
@@ -31,7 +29,6 @@ describe 'rally::settings' do
shared_examples_for 'with all parameters' do
before { params.merge!( rally_settings_params ) }
it 'configures rally settings with all parameters' do
is_expected.to contain_rally_config('image/cirros_img_url').with(:value => 'http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img')
is_expected.to contain_rally_config('cleanup/resource_deletion_timeout').with(:value => 600)
is_expected.to contain_rally_config('users_context/project_domain').with(:value => 'default')
is_expected.to contain_rally_config('users_context/resource_management_workers').with(:value => 30)

View File

@@ -0,0 +1,54 @@
require 'spec_helper'
describe 'rally::settings::tempest' do
let :params do
{
}
end
let :rally_tempest_params do
{
:img_url => 'http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img',
:img_disk_format => 'raw',
:img_container_format => 'ovf',
}
end
shared_examples_for 'with default parameters' do
it 'configures rally tempest settings with default parameters' do
is_expected.to contain_rally_config('tempest/img_url').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('tempest/img_disk_format').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('tempest/img_name_regex').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('tempest/swift_operator_role').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('tempest/swift_reseller_admin_role').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('tempest/heat_stack_owner_role').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('tempest/heat_stack_user_role').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('tempest/flavor_ref_ram').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('tempest/flavor_ref_alt_ram').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('tempest/heat_instance_type_ram').with(:value => '<SERVICE DEFAULT>')
end
end
shared_examples_for 'with all parameters' do
before { params.merge!( rally_tempest_params ) }
it 'configures rally-settings-tempest settings with all parameters' do
is_expected.to contain_rally_config('tempest/img_url').with(:value => 'http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img')
is_expected.to contain_rally_config('tempest/img_disk_format').with(:value => 'raw')
is_expected.to contain_rally_config('tempest/img_container_format').with(:value => 'ovf')
end
end
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())
end
it_behaves_like 'with default parameters'
it_behaves_like 'with all parameters'
end
end
end