e2e

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package e2e contains the end-to-end tests for the meta-collector

Index

Constants

View Source
const (
	// NodeNameEnv name of the environment variable that holds the node name.
	NodeNameEnv = "NODENAME"
	// NodeFieldSelector selector used to get pods for a specific node.
	NodeFieldSelector = "spec.nodeName="
)

NodeNameEnv variable name that contains the node name used to subscribe to the collector.

Variables

This section is empty.

Functions

func MetaToString

func MetaToString(meta *v1.ObjectMeta) (string, error)

MetaToString returns the metadata to string. But before removes all the unnecessary fields.

func NewLogger

func NewLogger(writer io.Writer) terratestlogger.TestLogger

NewLogger returns a new logger for terratest modules.

func PodStatusToString

func PodStatusToString(status *corev1.PodStatus) (string, error)

PodStatusToString returns the pod status to string. It removes all the unnecessary fields.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client that subscribes to the metacollector.

func NewClient

func NewClient(nodeName, port string) (Client, error)

NewClient returns a client.

func (*Client) Add

func (m *Client) Add(item *metadata.Event)

func (*Client) Get

func (m *Client) Get(uid string) (*metadata.Event, bool)

func (*Client) NumMessages

func (m *Client) NumMessages() int

func (*Client) NumMessagesForKind

func (m *Client) NumMessagesForKind(kind string) int

func (*Client) Watch

func (c *Client) Watch(ctx context.Context) error

Watch subscribes to the collector.

type Deployer

type Deployer struct {
	// contains filtered or unexported fields
}

Deployer knows how to deploy resources.

func NewDeployer

func NewDeployer(resourcePath string) Deployer

NewDeployer returns a new deployer.

func (*Deployer) CleanUp

func (dpl *Deployer) CleanUp(t testing.TestingT, writer io.Writer) error

CleanUp removes all resources previously deployed.

func (*Deployer) DeployAll

func (dpl *Deployer) DeployAll(t testing.TestingT, writer io.Writer, namespace string, expectedPods int) error

DeployAll deploys all resources and waits until the expected pods are running.

func (*Deployer) ListDaemonsets

func (dpl *Deployer) ListDaemonsets(t testing.TestingT, writer io.Writer, node string) ([]appsv1.DaemonSet, error)

ListDaemonsets returns all the daemonsets related to the given node.

func (*Deployer) ListDeployments

func (dpl *Deployer) ListDeployments(t testing.TestingT, writer io.Writer, node string) ([]appsv1.Deployment, error)

ListDeployments returns all the deployments related to the given node.

func (*Deployer) ListNamespaces

func (dpl *Deployer) ListNamespaces(t testing.TestingT, writer io.Writer, node string) ([]corev1.Namespace, error)

ListNamespaces returns all the namespaces related to the given node.

func (*Deployer) ListPods

func (dpl *Deployer) ListPods(t testing.TestingT, writer io.Writer, node string) ([]corev1.Pod, error)

ListPods returns all the pods running on the given node.

func (*Deployer) ListReplicaSets

func (dpl *Deployer) ListReplicaSets(t testing.TestingT, writer io.Writer, node string) ([]appsv1.ReplicaSet, error)

ListReplicaSets returns all the replicasets related to the given node.

func (*Deployer) ListReplicationControllers

func (dpl *Deployer) ListReplicationControllers(t testing.TestingT, writer io.Writer, node string) ([]corev1.ReplicationController, error)

ListReplicationControllers returns all the replicationcontrollers related to the given node.

func (*Deployer) ListServices

func (dpl *Deployer) ListServices(t testing.TestingT, writer io.Writer, node string) ([]corev1.Service, error)

ListServices returns all the services related to the given node.

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger implements the terratestlogger.TestLogger.

func (Logger) Logf

func (l Logger) Logf(t testing.TestingT, format string, args ...interface{})

Logf prints the logging message.

Jump to

Keyboard shortcuts

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