Merge "Rewrite post test for ssl keys saving task"
This commit is contained in:
commit
897ec3a3fb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue