Documentation
¶
Index ¶
- func ContextWithTimeout(tb testing.TB, timeout time.Duration) context.Context
- func GenerateCA(g *WithT) ([]byte, *x509.Certificate, *ecdsa.PrivateKey)
- func GenerateKubeletCert(g *WithT, issuer *x509.Certificate, issuerKey *ecdsa.PrivateKey, ...) []byte
- func RunInstallTest(t *testing.T, td TestData)
- type FakeInformer
- type TestData
- type TestServer
- func NewEKSDescribeClusterAPI(tb testing.TB, resp *eks.DescribeClusterOutput) TestServer
- func NewHTTPSServer(tb testing.TB, handle func(w http.ResponseWriter, r *http.Request)) TestServer
- func NewHTTPSServerForJSON(tb testing.TB, status int, resp any) TestServer
- func NewHTTPServer(tb testing.TB, handle func(w http.ResponseWriter, r *http.Request)) TestServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithTimeout ¶ added in v1.0.6
ContextWithTimeout returns a context with a timeout that is cancelled when the test ends.
func GenerateCA ¶ added in v1.0.7
func GenerateCA(g *WithT) ([]byte, *x509.Certificate, *ecdsa.PrivateKey)
GenerateCA creates a new CA certificate and returns the PEM encoded certificate, the parsed certificate, and the private key
func GenerateKubeletCert ¶ added in v1.0.7
func GenerateKubeletCert(g *WithT, issuer *x509.Certificate, issuerKey *ecdsa.PrivateKey, validFrom, validTo time.Time) []byte
GenerateKubeletCert creates a new kubelet certificate signed by the given CA
func RunInstallTest ¶ added in v1.0.4
RunInstallTest runs the standard installation test suite
Types ¶
type FakeInformer ¶
type FakeInformer struct {
// Started indicates if Starting was called.
Started bool
// DoneWith is the error passed to Done.
DoneWith error
}
FakeInformer is a fake implementation of validation.Informer.
type TestData ¶ added in v1.0.4
type TestData struct {
ArtifactName string
BinaryName string
Data []byte
Install func(context.Context, string, aws.Source, *tracker.Tracker) error
Verify func(*GomegaWithT, string, *tracker.Tracker)
VerifyFilePaths []string
}
TestData represents the data needed to run an installation test
type TestServer ¶
TestServer is a wrapper around httptest.Server.
func NewEKSDescribeClusterAPI ¶
func NewEKSDescribeClusterAPI(tb testing.TB, resp *eks.DescribeClusterOutput) TestServer
NewEKSDescribeClusterAPI creates a new TestServer that behaves like the EKS DescribeCluster API.
func NewHTTPSServer ¶
func NewHTTPSServer(tb testing.TB, handle func(w http.ResponseWriter, r *http.Request)) TestServer
NewHTTPSServer creates a new TestServer with a TLS certificate. The server is automatically closed when the test ends.
func NewHTTPSServerForJSON ¶
func NewHTTPSServerForJSON(tb testing.TB, status int, resp any) TestServer
NewHTTPSServerForJSON creates a new TestServer that responds with a JSON body.
func NewHTTPServer ¶ added in v1.0.3
func NewHTTPServer(tb testing.TB, handle func(w http.ResponseWriter, r *http.Request)) TestServer
NewHTTPServer creates a new TestServer without TLS. The server is automatically closed when the test ends.
func (TestServer) CAPEM ¶
func (s TestServer) CAPEM() []byte
CAPEM returns the PEM-encoded certificate of the server.
func (TestServer) Port ¶
func (s TestServer) Port() (int, error)
Port returns the port the server is listening on.