class TLSPretense::TestHarness::SSLTestCase

Represents a single test case.

Attributes

certchain[R]
certchainalias[R]
description[R]
expected_result[R]
hosttotest[R]
id[R]
keychain[R]

Public Class Methods

factory(appctx, test_data, tests_to_create) click to toggle source
# File lib/tlspretense/test_harness/ssl_test_case.rb, line 16
def self.factory(appctx, test_data, tests_to_create)
  if tests_to_create == [] or tests_to_create == nil
    final_test_data = test_data
  else
    final_test_data = tests_to_create.map { |name| test_data.select { |test| test['alias'] == name }[0] }
  end
  final_test_data.map { |data| SSLTestCase.new(appctx, data) }
end
new(appctx, testdesc) click to toggle source
# File lib/tlspretense/test_harness/ssl_test_case.rb, line 25
def initialize(appctx, testdesc)
  @appctx = appctx
  @raw = testdesc.dup
  @id = @raw['alias']
  @description = @raw['name']
  @certchainalias = @raw['certchain']
  @expected_result = @raw['expected_result']
  # ensure that the certificate exists
  @certchain ||= @appctx.cert_manager.get_chain(@certchainalias)
  @keychain ||= @appctx.cert_manager.get_keychain(@certchainalias)
  @hosttotest ||= @appctx.config.hosttotest
  nil
end