Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Finished cinder tests, all tests pass now

  • Loading branch information...
commit 2141597f69ff463d2d49af65ff98086b118d8383 1 parent 24ee26b
@zestrada authored
Showing with 55 additions and 157 deletions.
  1. +2 −3 manifests/cinder.pp
  2. +53 −154 spec/classes/openstack_cinder_spec.rb
View
5 manifests/cinder.pp
@@ -12,12 +12,12 @@
$keystone_auth_host = 'localhost',
$keystone_auth_port = '35357',
$keystone_auth_protocol = 'http',
- $service_port = '5000',
$package_ensure = 'latest',
$bind_host = '0.0.0.0',
$config_api = false,
$config_scheduler = false,
- $enabled = true
+ $enabled = true,
+ $verbose = false
) {
class { 'cinder::base':
@@ -49,7 +49,6 @@
keystone_auth_host => $keystone_auth_host,
keystone_auth_port => $keystone_auth_port,
keystone_auth_protocol => $keystone_auth_protocol,
- #service_port => $service_port,
package_ensure => $package_ensure,
bind_host => $bind_host,
}
View
207 spec/classes/openstack_cinder_spec.rb
@@ -121,7 +121,6 @@
:keystone_auth_host => 'localhost',
:keystone_auth_port => '35357',
:keystone_auth_protocol => 'http',
- :service_port => '5000',
:package_ensure => 'latest',
:bind_host => '0.0.0.0'
)
@@ -132,167 +131,67 @@
}
end
-end
-__END__
-
- describe "when overriding parameters, but not enabling multi-host or volume management" do
- let :override_params do
- {
- :private_interface => 'eth1',
- :internal_address => '127.0.0.1',
- :public_interface => 'eth2',
- :sql_connection => 'mysql://user:passwd@host/name',
- :nova_user_password => 'nova_pass',
- :rabbit_host => 'my_host',
- :rabbit_password => 'my_rabbit_pw',
- :rabbit_user => 'my_rabbit_user',
- :rabbit_virtual_host => '/foo',
- :glance_api_servers => ['controller:9292'],
- :libvirt_type => 'qemu',
- :vncproxy_host => '127.0.0.2',
- :vnc_enabled => false,
- :verbose => true,
- }
- end
- let :params do
- default_params.merge(override_params)
- end
- it do
- should contain_class('nova').with(
- :sql_connection => 'mysql://user:passwd@host/name',
- :rabbit_host => 'my_host',
- :rabbit_userid => 'my_rabbit_user',
- :rabbit_password => 'my_rabbit_pw',
- :rabbit_virtual_host => '/foo',
- :image_service => 'nova.image.glance.GlanceImageService',
- :glance_api_servers => ['controller:9292'],
- :verbose => true
- )
- should contain_class('nova::compute').with(
- :enabled => true,
- :vnc_enabled => false,
- :vncserver_proxyclient_address => '127.0.0.1',
- :vncproxy_host => '127.0.0.2'
- )
- should contain_class('nova::compute::libvirt').with(
- :libvirt_type => 'qemu',
- :vncserver_listen => '127.0.0.1'
- )
- should contain_nova_config('multi_host').with( :value => 'False' )
- should contain_nova_config('send_arp_for_ha').with( :value => 'False' )
- should_not contain_class('nova::api')
- should contain_class('nova::network').with({
- :enabled => false,
- :install_service => false,
- :private_interface => 'eth1',
- :public_interface => 'eth2',
- :create_networks => false,
- :enabled => false,
- :install_service => false
- })
- end
- end
+ describe "when using non-default class parameters and enabling scheduler and api" do
- describe "when enabling volume management" do
let :params do
- default_params.merge({
- :manage_volumes => true
- })
- end
-
- it do
- should contain_nova_config('multi_host').with({ 'value' => 'False'})
- should_not contain_class('nova::api')
- should contain_class('nova::network').with({
- 'enabled' => false,
- 'install_service' => false
- })
+ default_params.merge(
+ {
+ :config_api => 'true',
+ :config_scheduler => 'true',
+ :sql_connection => 'mysql://user:pass@host/dbname2/',
+ :rabbit_password => 'rabbit_pw2',
+ :rabbit_userid => 'nova2',
+ :rabbit_host => '127.0.0.2',
+ :iscsi_ip_address => '127.0.0.2',
+ :volume_group => 'nova-volumes2',
+ :verbose => 'true',
+ :keystone_password => 'keystone2',
+ :keystone_enabled => 'true',
+ :keystone_tenant => 'services2',
+ :keystone_user => 'cinder2',
+ :keystone_auth_host => 'localhost2',
+ :keystone_auth_port => '35352',
+ :keystone_auth_protocol => 'https',
+ :package_ensure => 'present',
+ :bind_host => '127.0.0.2'
+ }
+ )
end
- end
- describe 'when quantum is false' do
- describe 'configuring for multi host' do
- let :params do
- default_params.merge({
- :multi_host => true,
- :public_interface => 'eth0',
- :quantum => false
- })
- end
-
- it 'should configure nova for multi-host' do
- #should contain_class('keystone::python')
- should contain_nova_config('multi_host').with(:value => 'True')
- should contain_nova_config('send_arp_for_ha').with( :value => 'True')
- should contain_class('nova::network').with({
- 'enabled' => true,
- 'install_service' => true
- })
- end
- describe 'with defaults' do
- it { should contain_class('nova::api').with(
- :enabled => true,
- :admin_tenant_name => 'services',
- :admin_user => 'nova',
- :admin_password => 'nova_pass'
- )}
- end
- end
- describe 'when overriding network params' do
- let :params do
- default_params.merge({
- :multi_host => true,
- :public_interface => 'eth0',
- :manage_volumes => true,
- :private_interface => 'eth1',
- :public_interface => 'eth2',
- :fixed_range => '12.0.0.0/24',
- :network_manager => 'nova.network.manager.VlanManager',
- :network_config => {'vlan_interface' => 'eth0'}
- })
- end
- it { should contain_class('nova::network').with({
- :private_interface => 'eth1',
- :public_interface => 'eth2',
- :fixed_range => '12.0.0.0/24',
- :floating_range => false,
- :network_manager => 'nova.network.manager.VlanManager',
- :config_overrides => {'vlan_interface' => 'eth0'},
- :create_networks => false,
- 'enabled' => true,
- 'install_service' => true
- })}
- end
- end
+ it {
+ should contain_class('cinder::base').with(
+ :sql_connection => 'mysql://user:pass@host/dbname2/',
+ :rabbit_host => '127.0.0.2',
+ :rabbit_userid => 'nova2',
+ :rabbit_password => 'rabbit_pw2',
+ :verbose => 'true'
+ )
- describe "when configuring for multi host without a public interface" do
- let :params do
- default_params.merge({
- :multi_host => true
- })
- end
+ should contain_class('cinder::volume').with(
+ :enabled => 'true'
+ )
- it {
- expect { should raise_error(Puppet::Error) }
- }
- end
+ should contain_class('cinder::volume::iscsi').with(
+ :volume_group => 'nova-volumes2',
+ :iscsi_ip_address => '127.0.0.2'
+ )
- describe "when enabling volume management and using multi host" do
- let :params do
- default_params.merge({
- :multi_host => true,
- :public_interface => 'eth0',
- :manage_volumes => true,
- })
- end
+ should contain_class('cinder::api').with(
+ :keystone_password => 'keystone2',
+ :keystone_enabled => 'true',
+ :keystone_tenant => 'services2',
+ :keystone_user => 'cinder2',
+ :keystone_auth_host => 'localhost2',
+ :keystone_auth_port => '35352',
+ :keystone_auth_protocol => 'https',
+ :package_ensure => 'present',
+ :bind_host => '127.0.0.2'
+ )
- it {
- should contain_nova_config('multi_host').with({ 'value' => 'True'})
- should contain_class('nova::api')
- should contain_class('nova::network').with({
- 'enabled' => true,
- 'install_service' => true
- })
+ should contain_class('cinder::scheduler').with(
+ :package_ensure => 'present'
+ )
}
end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.