Documentation ¶
Index ¶
- type EndToEndTestSuite
- func (ts *EndToEndTestSuite) Run(t *testing.T)
- func (ts *EndToEndTestSuite) Setup(t *testing.T)
- func (ts *EndToEndTestSuite) ShouldSkipTest(testName string) bool
- func (ts *EndToEndTestSuite) Teardown()
- func (ts *EndToEndTestSuite) TestCreatePodWithMandatoryInexistentConfigMap(t *testing.T)
- func (ts *EndToEndTestSuite) TestCreatePodWithMandatoryInexistentSecrets(t *testing.T)
- func (ts *EndToEndTestSuite) TestCreatePodWithOptionalInexistentConfigMap(t *testing.T)
- func (ts *EndToEndTestSuite) TestCreatePodWithOptionalInexistentSecrets(t *testing.T)
- func (ts *EndToEndTestSuite) TestGetPods(t *testing.T)
- func (ts *EndToEndTestSuite) TestGetStatsSummary(t *testing.T)
- func (ts *EndToEndTestSuite) TestNodeCreateAfterDelete(t *testing.T)
- func (ts *EndToEndTestSuite) TestPodLifecycleForceDelete(t *testing.T)
- func (ts *EndToEndTestSuite) TestPodLifecycleGracefulDelete(t *testing.T)
- type EndToEndTestSuiteConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndToEndTestSuite ¶
type EndToEndTestSuite struct {
// contains filtered or unexported fields
}
EndToEndTestSuite holds the setup, teardown, and shouldSkipTest functions for a specific provider
func NewEndToEndTestSuite ¶
func NewEndToEndTestSuite(cfg EndToEndTestSuiteConfig) *EndToEndTestSuite
NewEndToEndTestSuite returns a new EndToEndTestSuite given a test suite configuration, setup, and teardown functions from provider
func (*EndToEndTestSuite) Run ¶
func (ts *EndToEndTestSuite) Run(t *testing.T)
Run runs tests registered in the test suite
func (*EndToEndTestSuite) Setup ¶
func (ts *EndToEndTestSuite) Setup(t *testing.T)
Setup runs the setup function from the provider and other procedures before running the test suite
func (*EndToEndTestSuite) ShouldSkipTest ¶
func (ts *EndToEndTestSuite) ShouldSkipTest(testName string) bool
ShouldSkipTest returns true if a provider wants to skip running a particular test
func (*EndToEndTestSuite) Teardown ¶
func (ts *EndToEndTestSuite) Teardown()
Teardown runs the teardown function from the provider and other procedures after running the test suite
func (*EndToEndTestSuite) TestCreatePodWithMandatoryInexistentConfigMap ¶
func (ts *EndToEndTestSuite) TestCreatePodWithMandatoryInexistentConfigMap(t *testing.T)
TestCreatePodWithMandatoryInexistentConfigMap tries to create a pod referencing inexistent secrets. It then verifies that the pod is not created.
func (*EndToEndTestSuite) TestCreatePodWithMandatoryInexistentSecrets ¶
func (ts *EndToEndTestSuite) TestCreatePodWithMandatoryInexistentSecrets(t *testing.T)
TestCreatePodWithMandatoryInexistentSecrets tries to create a pod referencing inexistent secrets. It then verifies that the pod is not created.
func (*EndToEndTestSuite) TestCreatePodWithOptionalInexistentConfigMap ¶
func (ts *EndToEndTestSuite) TestCreatePodWithOptionalInexistentConfigMap(t *testing.T)
TestCreatePodWithOptionalInexistentConfigMap tries to create a pod referencing optional, inexistent config map. It then verifies that the pod is created successfully.
func (*EndToEndTestSuite) TestCreatePodWithOptionalInexistentSecrets ¶
func (ts *EndToEndTestSuite) TestCreatePodWithOptionalInexistentSecrets(t *testing.T)
TestCreatePodWithOptionalInexistentSecrets tries to create a pod referencing optional, inexistent secrets. It then verifies that the pod is created successfully.
func (*EndToEndTestSuite) TestGetPods ¶
func (ts *EndToEndTestSuite) TestGetPods(t *testing.T)
TestGetPods tests that the /pods endpoint works, and only returns pods for our kubelet
func (*EndToEndTestSuite) TestGetStatsSummary ¶
func (ts *EndToEndTestSuite) TestGetStatsSummary(t *testing.T)
TestGetStatsSummary creates a pod having two containers and queries the /stats/summary endpoint of the virtual-kubelet. It expects this endpoint to return stats for the current node, as well as for the aforementioned pod and each of its two containers.
func (*EndToEndTestSuite) TestNodeCreateAfterDelete ¶
func (ts *EndToEndTestSuite) TestNodeCreateAfterDelete(t *testing.T)
TestNodeCreateAfterDelete makes sure that a node is automatically recreated if it is deleted while VK is running.
func (*EndToEndTestSuite) TestPodLifecycleForceDelete ¶
func (ts *EndToEndTestSuite) TestPodLifecycleForceDelete(t *testing.T)
TestPodLifecycleForceDelete creates one podsand verifies that the provider has created them and put them in the running lifecycle. It then does a force delete on the pod, and verifies the provider has deleted it.
func (*EndToEndTestSuite) TestPodLifecycleGracefulDelete ¶
func (ts *EndToEndTestSuite) TestPodLifecycleGracefulDelete(t *testing.T)
TestPodLifecycleGracefulDelete creates a pod and verifies that the provider has been asked to create it. Then, it deletes the pods and verifies that the provider has been asked to delete it. These verifications are made using the /stats/summary endpoint of the virtual-kubelet, by checking for the presence or absence of the pods. Hence, the provider being tested must implement the PodMetricsProvider interface.
type EndToEndTestSuiteConfig ¶
type EndToEndTestSuiteConfig struct { // Kubeconfig is the path to the kubeconfig file to use when running the test suite outside a Kubernetes cluster. Kubeconfig string // Namespace is the name of the Kubernetes namespace to use for running the test suite (i.e. where to create pods). Namespace string // NodeName is the name of the virtual-kubelet node to test. NodeName string // WatchTimeout is the duration for which the framework watch a particular condition to be satisfied (e.g. watches a pod becoming ready) WatchTimeout time.Duration // Setup is a function that sets up provider-specific resource in the test suite Setup suite.SetUpFunc // Teardown is a function that tears down provider-specific resources from the test suite Teardown suite.TeardownFunc // ShouldSkipTest is a function that determines whether the test suite should skip certain tests ShouldSkipTest suite.ShouldSkipTestFunc }
EndToEndTestSuiteConfig is the config passed to initialize the testing framework and test suite.