test_case

package
v0.0.0-...-f665d57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXPECTED_RESULT_FAIL = iota
	EXPECTED_RESULT_PASS
	EXPECTED_RESULT_SOFT_FAIL
	EXPECTED_RESULT_SOFT_PASS
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpectedResult

type ExpectedResult int

func (ExpectedResult) MarshalJSON

func (r ExpectedResult) MarshalJSON() ([]byte, error)

func (ExpectedResult) String

func (r ExpectedResult) String() string

func (*ExpectedResult) UnmarshalJSON

func (r *ExpectedResult) UnmarshalJSON(data []byte) error

type Feature

type Feature int

type TestCase

type TestCase interface {
	// The expected result (whether the client should reject or accept the TLS connection)
	ExpectedResult() ExpectedResult
	// What hostname should be used in the request, e.g. "localhost" or "127.0.0.1".
	GetHostname() string
	// A callback to get the server certificates for this test case
	GetCertificates(rootCert *x509.Certificate, rootKey crypto.Signer) (*tls.Certificate, error)
	// Which supported client features are required in order to meaningfully run this test
	RequiredFeatures() []Feature
}

type TestCaseProvider

type TestCaseProvider interface {
	Name() string
	// How many test cases does this provider supply?
	GetTestCaseCount() (uint, error)
	// Get the "index"th test case.
	GetTestCase(index uint) (TestCase, error)
	// Get a test case index that verifies the client can trusts certificates under the server's root
	GetSanityCheckTestCase() (uint, error)
	// Get a list of features used by this test provider
	GetFeatures() []Feature
	// Get a string description of a feature
	DescribeFeature(feature Feature) string
	// For a given feature, a list of test cases (as indices) that must pass for the client to be considered to support the feature.
	GetTestCasesForFeature(feature Feature) ([]uint, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL