Rewrite post test for ssl keys saving task

Change-Id: I4fa25b87c4a5f31a92a266c3b31fba6698f13807
Closes-Bug: #1523465
This commit is contained in:
Stanislaw Bogatkin 2015-12-11 18:29:26 +03:00
parent 372094d5e4
commit 8bb0135231
1 changed files with 5 additions and 4 deletions

View File

@ -2,13 +2,14 @@ require File.join File.dirname(__FILE__), '../test_common.rb'
class SslKeysSavingPostTest < Test::Unit::TestCase
def has_public_ssl?
TestCommon::Settings.lookup 'public_ssl'
def public_ssl
ssl_hash = TestCommon::Settings.lookup 'public_ssl'
ssl_hash['horizon'] or ssl_hash['services']
end
def test_ssl_keys_availability
return unless has_public_ssl
assert File.file?('/var/lib/astute/haproxy/public_haproxy.pem'), 'No public keypair saved!'
assert File.file?('/var/lib/astute/haproxy/public_haproxy.pem'), 'No public keypair saved!' unless not public_ssl
assert !File.file?('/var/lib/astute/haproxy/public_haproxy.pem'), 'Keypair exist but should not!' unless public_ssl
end
end