utils

package
v0.0.1-0...-a39e75c Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package utils implements helper functions for the e2e tests.

Index

Constants

View Source
const (
	// Namespace is the default K8s namespace in which infra server is deployed.
	Namespace = "infra"
	// AppLabels are the default K8s labels attached to the infra server deployment.
	AppLabels = "infra-server"
)

Variables

This section is empty.

Functions

func AssertStatusBecomes

func AssertStatusBecomes(t *testing.T, clusterID string, desiredStatus string)

AssertStatusBecomes asserts that an infra cluster eventually reaches a desired status.

func AssertStatusBecomesWithin

func AssertStatusBecomesWithin(t *testing.T, clusterID string, desiredStatus string, timeout time.Duration)

AssertStatusBecomesWithin asserts that an infra cluster reaches a desired status within a defined time.

func AssertStatusRemainsFor

func AssertStatusRemainsFor(t *testing.T, clusterID string, desiredStatus string, timeout time.Duration)

AssertStatusRemainsFor asserts that an infra cluster remains in a desired status for a defined time.

func CheckContext

func CheckContext()

CheckContext aborts an execution if the current kubectl context is not an infra-pr cluster.

func CheckGCSObjectEventuallyDeleted

func CheckGCSObjectEventuallyDeleted(ctx context.Context, t *testing.T, clusterID string)

CheckGCSObjectEventuallyDeleted confirms that an object is eventually deletion from the GCS bucket.

func CheckGCSObjectExists

func CheckGCSObjectExists(ctx context.Context, clusterID string) (bool, error)

CheckGCSObjectExists confirms that an object exists in the GCS bucket.

func DeleteStatusConfigmap

func DeleteStatusConfigmap(namespace string) error

DeleteStatusConfigmap deletes the configmap named status in a given namespace.

func FindInfraPod

func FindInfraPod(ctx context.Context, namespace string, label string) (string, error)

FindInfraPod discovers the infra server pod.

func GetPodLogs

func GetPodLogs(namespace string, label string, startTime *metav1.Time) (string, error)

GetPodLogs retrieves the logs for a labeled pod from a given start time.

func GetUniqueClusterName

func GetUniqueClusterName(baseName string) string

GetUniqueClusterName adds some uniqueness to a cluster name.

Types

This section is empty.

Directories

Path Synopsis
Package mock implements helpers to mock infractl calls and outputs for tests.
Package mock implements helpers to mock infractl calls and outputs for tests.

Jump to

Keyboard shortcuts

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