SSL support for pre/post modular tests

This commit adds SSL support in the common library for pre/post modular tests.
It also fix all the modular tests to use public ssl-endpoints.

Change-Id: I75b8e97d165932c132706ee825a4b0712f954fe2
Closes-Bug: #1524689
This commit is contained in:
Maksim Malchuk 2015-12-11 13:12:35 +03:00
parent 15d966e164
commit 4d609ea1b6
5 changed files with 8 additions and 8 deletions

View File

@ -74,7 +74,7 @@ class DatabaseInstallPostTest < Test::Unit::TestCase
def test_mysql_status_check_ok
check_port = 49000
url = "http://#{TestCommon::Settings.internal_address}:#{check_port}"
url = "http://#{TestCommon::Settings.fqdn}:#{check_port}"
assert TestCommon::Network.url_accessible?(url), 'Cannot connect to the MySQL Checker URL!'
end

View File

@ -13,7 +13,7 @@ class GlancePostTest < Test::Unit::TestCase
end
def test_glance_public_url_accessible
url = "http://#{TestCommon::Settings.public_vip}:#{PORT}"
url = "https://#{TestCommon::Settings.public_vip}:#{PORT}"
assert TestCommon::Network.url_accessible?(url), "Public Glance URL '#{url}' is not accessible!"
end

View File

@ -14,8 +14,8 @@ heat-api-cloudwatch
)
HOSTS = {
'public' => TestCommon::Settings.public_vip,
'management' => TestCommon::Settings.management_vip,
'https' => TestCommon::Settings.public_vip,
'http' => TestCommon::Settings.management_vip,
}
PORTS = {
@ -44,7 +44,7 @@ class HeatPostTest < Test::Unit::TestCase
PORTS.each do |port_type, port|
method_name = "test_#{host_type}_heat_#{port_type}_accessible"
define_method method_name do
url = "http://#{ip}:#{port}"
url = "#{host_type}://#{ip}:#{port}"
assert TestCommon::Network.url_accessible?(url), "URL '#{url}' is unaccessible?"
end
end

View File

@ -6,11 +6,11 @@ ADMIN_PORT = 35357
class KeystonePostTest < Test::Unit::TestCase
def test_keystone_is_running
assert TestCommon::Process.running?('/usr/bin/keystone-all'), 'Keystone is not running!'
assert TestCommon::Process.running?('/usr/sbin/apache2'), 'Keystone is not running!'
end
def test_keystone_public_url_accessible
url = "http://#{TestCommon::Settings.public_vip}:#{PUBLIC_PORT}"
url = "https://#{TestCommon::Settings.public_vip}:#{PUBLIC_PORT}"
assert TestCommon::Network.url_accessible?(url), "Public Keystone URL '#{url}' is not accessible!"
end

View File

@ -548,7 +548,7 @@ module TestCommon
# @param url [String] the url to check
# @return [true,false]
def self.url_accessible?(url)
out = TestCommon::Cmd.run "curl --fail '#{url}' 1>/dev/null 2>/dev/null"
out = TestCommon::Cmd.run "curl --fail --insecure '#{url}' 1>/dev/null 2>/dev/null"
out.last == 0
end