aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/classes/tripleo_midonet_agent_spec.rb58
-rw-r--r--spec/classes/tripleo_profile_base_cinder_scaleio_spec.rb58
-rw-r--r--spec/classes/tripleo_profile_base_cinder_volume_dellps_spec.rb (renamed from spec/classes/tripleo_profile_base_cinder_volume_eqlx_spec.rb)12
-rw-r--r--spec/classes/tripleo_profile_base_cinder_volume_spec.rb18
-rw-r--r--spec/classes/tripleo_profile_base_nova_api_spec.rb34
-rw-r--r--spec/classes/tripleo_profile_base_nova_compute_spec.rb4
-rw-r--r--spec/classes/tripleo_ui_spec.rb64
7 files changed, 144 insertions, 104 deletions
diff --git a/spec/classes/tripleo_midonet_agent_spec.rb b/spec/classes/tripleo_midonet_agent_spec.rb
deleted file mode 100644
index 73d90b6..0000000
--- a/spec/classes/tripleo_midonet_agent_spec.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# Copyright (C) 2015 Midokura SARL
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# Unit tests for the midonet agent
-
-require 'spec_helper'
-
-describe 'tripleo::network::midonet::agent' do
-
- shared_examples_for 'tripleo::network::midonet::agent' do
-
- let :params do
- {
- :zookeeper_servers => ['192.168.2.2', '192.168.2.3'],
- :cassandra_seeds => ['192.168.2.2', '192.168.2.3']
- }
- end
-
- it 'should stop openvswitch' do
- is_expected.to contain_service('openvswitch').with(
- :ensure => 'stopped',
- :enable => false
- )
- end
-
- it 'should run the agent with a list of maps' do
- is_expected.to contain_class('midonet::midonet_agent').with(
- :zk_servers => [{'ip' => '192.168.2.2',
- 'port' => 2181},
- {'ip' => '192.168.2.3',
- 'port' => 2181}],
- :cassandra_seeds => ['192.168.2.2','192.168.2.3']
- )
- end
- end
-
- on_supported_os.each do |os, facts|
- context "on #{os}" do
- let(:facts) do
- facts.merge({})
- end
-
- it_behaves_like 'tripleo::network::midonet::agent'
- end
- end
-end
diff --git a/spec/classes/tripleo_profile_base_cinder_scaleio_spec.rb b/spec/classes/tripleo_profile_base_cinder_scaleio_spec.rb
new file mode 100644
index 0000000..0f12b0a
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_cinder_scaleio_spec.rb
@@ -0,0 +1,58 @@
+#
+# Copyright (C) 2016 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::cinder::volume::scaleio' do
+ shared_examples_for 'tripleo::profile::base::cinder::volume::scaleio' do
+ before :each do
+ facts.merge!({ :step => params[:step] })
+ end
+
+ context 'with step less than 4' do
+ let(:params) { { :step => 3 } }
+
+ it 'should do nothing' do
+ is_expected.to contain_class('tripleo::profile::base::cinder::volume::scaleio')
+ is_expected.to contain_class('tripleo::profile::base::cinder::volume')
+ is_expected.to contain_class('tripleo::profile::base::cinder')
+ is_expected.to_not contain_cinder__backend__scaleio('tripleo_scaleio')
+ end
+ end
+
+ context 'with step 4' do
+ let(:params) { {
+ :step => 4,
+ } }
+
+ it 'should trigger complete configuration' do
+ # TODO(aschultz): check hiera parameters
+ is_expected.to contain_cinder__backend__scaleio('tripleo_scaleio')
+ end
+ end
+ end
+
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) do
+ facts.merge({ :hostname => 'node.example.com' })
+ end
+
+ it_behaves_like 'tripleo::profile::base::cinder::volume::scaleio'
+ end
+ end
+end
diff --git a/spec/classes/tripleo_profile_base_cinder_volume_eqlx_spec.rb b/spec/classes/tripleo_profile_base_cinder_volume_dellps_spec.rb
index 1a188aa..313b87c 100644
--- a/spec/classes/tripleo_profile_base_cinder_volume_eqlx_spec.rb
+++ b/spec/classes/tripleo_profile_base_cinder_volume_dellps_spec.rb
@@ -16,8 +16,8 @@
require 'spec_helper'
-describe 'tripleo::profile::base::cinder::volume::eqlx' do
- shared_examples_for 'tripleo::profile::base::cinder::volume::eqlx' do
+describe 'tripleo::profile::base::cinder::volume::dellps' do
+ shared_examples_for 'tripleo::profile::base::cinder::volume::dellps' do
before :each do
facts.merge!({ :step => params[:step] })
end
@@ -26,10 +26,10 @@ describe 'tripleo::profile::base::cinder::volume::eqlx' do
let(:params) { { :step => 3 } }
it 'should do nothing' do
- is_expected.to contain_class('tripleo::profile::base::cinder::volume::eqlx')
+ is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellps')
is_expected.to contain_class('tripleo::profile::base::cinder::volume')
is_expected.to contain_class('tripleo::profile::base::cinder')
- is_expected.to_not contain_cinder__backend__eqlx('tripleo_eqlx')
+ is_expected.to_not contain_cinder__backend__eqlx('tripleo_dellps')
end
end
@@ -40,7 +40,7 @@ describe 'tripleo::profile::base::cinder::volume::eqlx' do
it 'should trigger complete configuration' do
# TODO(aschultz): check hiera parameters
- is_expected.to contain_cinder__backend__eqlx('tripleo_eqlx')
+ is_expected.to contain_cinder__backend__eqlx('tripleo_dellps')
end
end
end
@@ -52,7 +52,7 @@ describe 'tripleo::profile::base::cinder::volume::eqlx' do
facts.merge({ :hostname => 'node.example.com' })
end
- it_behaves_like 'tripleo::profile::base::cinder::volume::eqlx'
+ it_behaves_like 'tripleo::profile::base::cinder::volume::dellps'
end
end
end
diff --git a/spec/classes/tripleo_profile_base_cinder_volume_spec.rb b/spec/classes/tripleo_profile_base_cinder_volume_spec.rb
index e0ec9de..f4501c8 100644
--- a/spec/classes/tripleo_profile_base_cinder_volume_spec.rb
+++ b/spec/classes/tripleo_profile_base_cinder_volume_spec.rb
@@ -74,21 +74,21 @@ describe 'tripleo::profile::base::cinder::volume' do
end
end
- context 'with only eqlx' do
+ context 'with only dellps' do
before :each do
params.merge!({
- :cinder_enable_eqlx_backend => true,
+ :cinder_enable_dellps_backend => true,
:cinder_enable_iscsi_backend => false,
})
end
- it 'should configure only eqlx' do
- is_expected.to contain_class('tripleo::profile::base::cinder::volume::eqlx')
+ it 'should configure only dellps' do
+ is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellps')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::iscsi')
is_expected.to contain_class('tripleo::profile::base::cinder::volume')
is_expected.to contain_class('tripleo::profile::base::cinder')
is_expected.to contain_class('cinder::volume')
is_expected.to contain_class('cinder::backends').with(
- :enabled_backends => ['tripleo_eqlx']
+ :enabled_backends => ['tripleo_dellps']
)
end
end
@@ -160,7 +160,7 @@ describe 'tripleo::profile::base::cinder::volume' do
it 'should configure only user backend' do
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::iscsi')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellsc')
- is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::eqlx')
+ is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellps')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::netapp')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::nfs')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::rbd')
@@ -178,7 +178,7 @@ describe 'tripleo::profile::base::cinder::volume' do
params.merge!({
:cinder_enable_iscsi_backend => true,
:cinder_enable_dellsc_backend => true,
- :cinder_enable_eqlx_backend => true,
+ :cinder_enable_dellps_backend => true,
:cinder_enable_netapp_backend => true,
:cinder_enable_nfs_backend => true,
:cinder_enable_rbd_backend => true,
@@ -187,7 +187,7 @@ describe 'tripleo::profile::base::cinder::volume' do
it 'should configure all backends' do
is_expected.to contain_class('tripleo::profile::base::cinder::volume::iscsi')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellsc')
- is_expected.to contain_class('tripleo::profile::base::cinder::volume::eqlx')
+ is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellps')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::netapp')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::nfs')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::rbd')
@@ -195,7 +195,7 @@ describe 'tripleo::profile::base::cinder::volume' do
is_expected.to contain_class('tripleo::profile::base::cinder')
is_expected.to contain_class('cinder::volume')
is_expected.to contain_class('cinder::backends').with(
- :enabled_backends => ['tripleo_iscsi', 'tripleo_ceph', 'tripleo_eqlx',
+ :enabled_backends => ['tripleo_iscsi', 'tripleo_ceph', 'tripleo_dellps',
'tripleo_dellsc', 'tripleo_netapp','tripleo_nfs']
)
end
diff --git a/spec/classes/tripleo_profile_base_nova_api_spec.rb b/spec/classes/tripleo_profile_base_nova_api_spec.rb
index f930342..2072438 100644
--- a/spec/classes/tripleo_profile_base_nova_api_spec.rb
+++ b/spec/classes/tripleo_profile_base_nova_api_spec.rb
@@ -56,25 +56,25 @@ eos
is_expected.to contain_class('nova::cell_v2::simple_setup')
is_expected.to contain_class('nova::keystone::authtoken')
is_expected.to contain_class('nova::api')
- is_expected.to contain_class('nova::wsgi::apache_api')
+ is_expected.to_not contain_class('nova::wsgi::apache_api')
is_expected.to contain_class('nova::network::neutron')
}
end
- context 'with step 3 not on bootstrap node' do
+ context 'with step 3 on bootstrap node' do
let(:params) { {
- :step => 3,
- :bootstrap_node => 'other.example.com',
+ :step => 3,
+ :bootstrap_node => 'node.example.com',
} }
it {
is_expected.to contain_class('tripleo::profile::base::nova::api')
is_expected.to contain_class('tripleo::profile::base::nova')
- is_expected.to_not contain_class('nova::db::sync_cell_v2')
- is_expected.to_not contain_class('nova::keystone::authtoken')
- is_expected.to_not contain_class('nova::api')
+ is_expected.to contain_class('nova::cell_v2::simple_setup')
+ is_expected.to contain_class('nova::keystone::authtoken')
+ is_expected.to contain_class('nova::api')
is_expected.to_not contain_class('nova::wsgi::apache_api')
- is_expected.to_not contain_class('nova::network::neutron')
+ is_expected.to contain_class('nova::network::neutron')
}
end
@@ -88,6 +88,24 @@ eos
is_expected.to_not contain_class('nova::db::sync_cell_v2')
is_expected.to contain_class('nova::keystone::authtoken')
is_expected.to contain_class('nova::api')
+ is_expected.to_not contain_class('nova::wsgi::apache_api')
+ is_expected.to contain_class('nova::network::neutron')
+ }
+ end
+
+ context 'with step 4 not on bootstrap node' do
+ let(:params) { {
+ :step => 4,
+ :bootstrap_node => 'other.example.com',
+ :nova_api_wsgi_enabled => true,
+ } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::api')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova::db::sync_cell_v2')
+ is_expected.to contain_class('nova::keystone::authtoken')
+ is_expected.to contain_class('nova::api')
is_expected.to contain_class('nova::wsgi::apache_api')
is_expected.to contain_class('nova::network::neutron')
}
diff --git a/spec/classes/tripleo_profile_base_nova_compute_spec.rb b/spec/classes/tripleo_profile_base_nova_compute_spec.rb
index a0b2387..a6fdbd6 100644
--- a/spec/classes/tripleo_profile_base_nova_compute_spec.rb
+++ b/spec/classes/tripleo_profile_base_nova_compute_spec.rb
@@ -19,7 +19,7 @@ require 'spec_helper'
describe 'tripleo::profile::base::nova::compute' do
shared_examples_for 'tripleo::profile::base::nova::compute' do
- context 'with step less than 4' do
+ context 'with step less than 5' do
let(:params) { { :step => 1, } }
it {
@@ -32,7 +32,7 @@ describe 'tripleo::profile::base::nova::compute' do
}
end
- context 'with step 4' do
+ context 'with step 5' do
let(:pre_condition) do
<<-eos
class { '::tripleo::profile::base::nova':
diff --git a/spec/classes/tripleo_ui_spec.rb b/spec/classes/tripleo_ui_spec.rb
index 588a944..0805e58 100644
--- a/spec/classes/tripleo_ui_spec.rb
+++ b/spec/classes/tripleo_ui_spec.rb
@@ -24,9 +24,20 @@ describe 'tripleo::ui' do
context 'with required parameters' do
let(:params) { {
- :servername => facts[:hostname],
- :bind_host => '127.0.0.1',
- :keystone_url => 'http://127.0.0.1:5000/'
+ :servername => facts[:hostname],
+ :bind_host => '127.0.0.1',
+ :endpoint_proxy_keystone => 'http://127.0.0.1:5000',
+ :endpoint_proxy_zaqar => 'ws://127.0.0.1:9000/zaqar',
+ :endpoint_proxy_heat => 'http://127.0.0.1:8004',
+ :endpoint_proxy_ironic => 'http://127.0.0.1:6385',
+ :endpoint_proxy_mistral => 'http://127.0.0.1:8989',
+ :endpoint_proxy_swift => 'http://127.0.0.1:8080',
+ :endpoint_config_keystone => 'https://127.0.0.1:443/keystone/v2.0',
+ :endpoint_config_zaqar => 'wss://127.0.0.1:443/zaqar',
+ :endpoint_config_heat => 'https://127.0.0.1:443/heat/v1/%(tenant_id)s',
+ :endpoint_config_ironic => 'https://127.0.0.1:443/ironic',
+ :endpoint_config_mistral => 'https://127.0.0.1:443/mistral/v2',
+ :endpoint_config_swift => 'https://127.0.0.1:443/swift/v1/AUTH_%(tenant_id)s'
} }
it 'should configure tripleo ui' do
@@ -42,23 +53,34 @@ describe 'tripleo::ui' do
)
is_expected.to contain_file('/etc/httpd/conf.d/openstack-tripleo-ui.conf').with_content(/cleaned by Puppet/)
is_expected.to contain_file('/var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js')
- .with_content(/"keystone": "http:\/\/127.0.0.1:5000\/"/)
+ .with_content(/"keystone": "https:\/\/127.0.0.1:443\/keystone\/v2.0"/)
+ .with_content(/"heat": "https:\/\/127.0.0.1:443\/heat\/v1\/%\(tenant_id\)s"/)
+ .with_content(/"zaqar-websocket": "wss:\/\/127.0.0.1:443\/zaqar"/)
+ .with_content(/"ironic": "https:\/\/127.0.0.1:443\/ironic"/)
+ .with_content(/"mistral": "https:\/\/127.0.0.1:443\/mistral\/v2"/)
+ .with_content(/"swift": "https:\/\/127.0.0.1:443\/swift\/v1\/AUTH_%\(tenant_id\)s"/)
.with_content(/"zaqar_default_queue": "tripleo"/)
end
end
context 'with all parameters' do
let(:params) { {
- :servername => 'custom.example.com',
- :bind_host => '127.0.0.2',
- :ui_port => 3001,
- :keystone_url => 'http://127.0.0.1:1111/',
- :heat_url => 'http://127.0.0.1:2222/',
- :ironic_url => 'http://127.0.0.1:3333/',
- :mistral_url => 'http://127.0.0.1:4444/',
- :swift_url => 'http://127.0.0.1:5555/',
- :zaqar_websocket_url => 'http://127.0.0.1:6666/',
- :zaqar_default_queue => 'myqueue'
+ :servername => 'custom.example.com',
+ :bind_host => '127.0.0.2',
+ :ui_port => 3001,
+ :endpoint_proxy_keystone => 'http://127.0.0.1:5000',
+ :endpoint_proxy_zaqar => 'ws://127.0.0.1:9000/zaqar',
+ :endpoint_proxy_heat => 'http://127.0.0.1:8004',
+ :endpoint_proxy_ironic => 'http://127.0.0.1:6385',
+ :endpoint_proxy_mistral => 'http://127.0.0.1:8989',
+ :endpoint_proxy_swift => 'http://127.0.0.1:8080',
+ :endpoint_config_keystone => 'https://127.0.0.1:443/keystone/v2.0',
+ :endpoint_config_zaqar => 'wss://127.0.0.1:443/zaqar',
+ :endpoint_config_heat => 'https://127.0.0.1:443/heat/v1/%(tenant_id)s',
+ :endpoint_config_ironic => 'https://127.0.0.1:443/ironic',
+ :endpoint_config_mistral => 'https://127.0.0.1:443/mistral/v2',
+ :endpoint_config_swift => 'https://127.0.0.1:443/swift/v1/AUTH_%(tenant_id)s',
+ :zaqar_default_queue => 'tripleo'
} }
it 'should configure tripleo ui' do
@@ -74,13 +96,13 @@ describe 'tripleo::ui' do
)
is_expected.to contain_file('/etc/httpd/conf.d/openstack-tripleo-ui.conf').with_content(/cleaned by Puppet/)
is_expected.to contain_file('/var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js')
- .with_content(/"keystone": "http:\/\/127.0.0.1:1111\/"/)
- .with_content(/"heat": "http:\/\/127.0.0.1:2222\/"/)
- .with_content(/"ironic": "http:\/\/127.0.0.1:3333\/"/)
- .with_content(/"mistral": "http:\/\/127.0.0.1:4444\/"/)
- .with_content(/"swift": "http:\/\/127.0.0.1:5555\/"/)
- .with_content(/"zaqar-websocket": "http:\/\/127.0.0.1:6666\/"/)
- .with_content(/"zaqar_default_queue": "myqueue"/)
+ .with_content(/"keystone": "https:\/\/127.0.0.1:443\/keystone\/v2.0"/)
+ .with_content(/"heat": "https:\/\/127.0.0.1:443\/heat\/v1\/%\(tenant_id\)s"/)
+ .with_content(/"zaqar-websocket": "wss:\/\/127.0.0.1:443\/zaqar"/)
+ .with_content(/"ironic": "https:\/\/127.0.0.1:443\/ironic"/)
+ .with_content(/"mistral": "https:\/\/127.0.0.1:443\/mistral\/v2"/)
+ .with_content(/"swift": "https:\/\/127.0.0.1:443\/swift\/v1\/AUTH_%\(tenant_id\)s"/)
+ .with_content(/"zaqar_default_queue": "tripleo"/)
end
end