Documentation
Index ¶
- func Assert(t *testing.T, result bool, message string)
- func AssertByteEquals(t *testing.T, one []byte, two []byte)
- func AssertContains(t *testing.T, haystack string, needle string)
- func AssertDeepEquals(t *testing.T, one interface{}, two interface{})
- func AssertEquals(t *testing.T, one interface{}, two interface{})
- func AssertError(t *testing.T, err error, message string)
- func AssertErrorIs(t *testing.T, err error, target error)
- func AssertErrorWraps(t *testing.T, err error, target interface{})
- func AssertMarshaledEquals(t *testing.T, one interface{}, two interface{})
- func AssertNotContains(t *testing.T, haystack string, needle string)
- func AssertNotEquals(t *testing.T, one interface{}, two interface{})
- func AssertNotError(t *testing.T, err error, message string)
- func AssertNotNil(t *testing.T, obj interface{}, message string)
- func AssertUnmarshaledEquals(t *testing.T, got, expected string)
- func CountCounter(counter prometheus.Counter) int
- func CountCounterVec(labelName string, value string, counterVec *prometheus.CounterVec) int
- func CountHistogramSamples(obs prometheus.Observer) int
- func GaugeValueWithLabels(vecGauge *prometheus.GaugeVec, labels prometheus.Labels) (int, error)
- func ResetSATestDatabase(t testing.TB) func()
- func ThrowAwayCert(t *testing.T, nameCount int) (string, *x509.Certificate)
- func ThrowAwayCertWithSerial(t *testing.T, nameCount int, sn *big.Int, issuer *x509.Certificate) (string, *x509.Certificate)
- type CleanUpDB
Constants ¶
Variables ¶
Functions ¶
func AssertByteEquals ¶
AssertByteEquals uses bytes.Equal to measure one and two for equality.
func AssertContains ¶
AssertContains determines whether needle can be found in haystack
func AssertDeepEquals ¶
AssertDeepEquals uses the reflect.DeepEqual method to measure one and two
func AssertEquals ¶
AssertEquals uses the equality operator (==) to measure one and two
func AssertError ¶
AssertError checks that err is non-nil
func AssertErrorIs ¶
AssertErrorIs checks that err wraps the given error
func AssertErrorWraps ¶
AssertErrorWraps checks that err can be unwrapped into the given target. NOTE: Has the side effect of actually performing that unwrapping.
func AssertMarshaledEquals ¶
AssertMarshaledEquals marshals one and two to JSON, and then uses the equality operator to measure them
func AssertNotContains ¶
AssertNotContains determines if needle is not found in haystack
func AssertNotEquals ¶
AssertNotEquals uses the equality operator to measure that one and two are different
func AssertNotError ¶
AssertNotError checks that err is nil
func AssertNotNil ¶
AssertNotNil checks an object to be non-nil
func AssertUnmarshaledEquals ¶
AssertUnmarshaledEquals unmarshals two JSON strings (got and expected) to a map[string]interface{} and then uses reflect.DeepEqual to check they are the same
func CountCounter ¶
func CountCounter(counter prometheus.Counter) int
CountCounter returns the count by label and value of a prometheus metric
func CountCounterVec ¶
func CountCounterVec(labelName string, value string, counterVec *prometheus.CounterVec) int
CountCounterVec returns the count by label and value of a prometheus metric
func CountHistogramSamples ¶
func CountHistogramSamples(obs prometheus.Observer) int
func GaugeValueWithLabels ¶
func GaugeValueWithLabels(vecGauge *prometheus.GaugeVec, labels prometheus.Labels) (int, error)
GaugeValueWithLabels returns the current value with the provided labels from the the GaugeVec argument, or an error if there was a problem collecting the value.
func ResetSATestDatabase ¶
ResetSATestDatabase deletes all rows in all tables in the SA DB. If fails the tests if that errors and returns a clean up function that will delete all rows again and close the database. "Tables available" means all tables that can be seen in the MariaDB configuration by the database user except for ones that are configuration only like goose_db_version (for migrations) or the ones describing the internal configuration of the server. To be used only in test code.
func ThrowAwayCert ¶
ThrowAwayCert is a small test helper function that creates a self-signed certificate for nameCount random example.com subdomains and returns the parsed certificate and the random serial in string form or aborts the test. The certificate returned from this function is the bare minimum needed for most tests and isn't a robust example of a complete end entity certificate.
func ThrowAwayCertWithSerial ¶
func ThrowAwayCertWithSerial(t *testing.T, nameCount int, sn *big.Int, issuer *x509.Certificate) (string, *x509.Certificate)
ThrowAwayCertWithSerial is a small test helper function that creates a certificate for nameCount random example.com subdomains and returns the parsed certificate and the serial in string form or aborts the test. The new throwaway certificate is always self-signed (with a random key), but will appear to be issued from issuer if provided. The certificate returned from this function is the bare minimum needed for most tests and isn't a robust example of a complete end entity certificate.
Types ¶
type CleanUpDB ¶
type CleanUpDB interface { Begin() (*sql.Tx, error) Exec(query string, args ...interface{}) (sql.Result, error) Query(query string, args ...interface{}) (*sql.Rows, error) io.Closer }
CleanUpDB is an interface with only what is needed to delete all rows in all tables in a database plus close the database connection. It is satisfied by *sql.DB.
Directories
Path | Synopsis |
---|---|
A quick way to fill up a database with a large number of authz objects, in order to manually test the performance of the expired-authz-purger.
|
A quick way to fill up a database with a large number of authz objects, in order to manually test the performance of the expired-authz-purger. |
block-a-key is a small utility for creating key blocklist entries.
|
block-a-key is a small utility for creating key blocklist entries. |
This is a test server that implements the subset of RFC6962 APIs needed to run Boulder's CT log submission code.
|
This is a test server that implements the subset of RFC6962 APIs needed to run Boulder's CT log submission code. |
acme
Package acme provides ACME client functionality tailored to the needs of the load-generator.
|
Package acme provides ACME client functionality tailored to the needs of the load-generator. |
ocsp
|
|
sd-test-srv runs a simple service discovery system; it returns two hardcoded IP addresses for every A query.
|
sd-test-srv runs a simple service discovery system; it returns two hardcoded IP addresses for every A query. |