integration

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 32 Imported by: 0

README

Integration Tests

This suite is testing Eirini with a real K8s cluster. For that, it expects the path to a valid kubeconfig file as INTEGRATION_KUBECONFIG environment variable. If INTEGRATION_KUBECONFIG is not provided, this will default to ~/.kube/config.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfigFile

func CreateConfigFile(config interface{}) (*os.File, error)

func CreateEmptySecret

func CreateEmptySecret(namespace, secretName string, clientset kubernetes.Interface) error

func CreateSecretWithStringData

func CreateSecretWithStringData(namespace, secretName string, clientset kubernetes.Interface, stringData map[string]string) error

func CreateTestServer

func CreateTestServer(certPath, keyPath, caCertPath string) (*ghttp.Server, error)

func DefaultControllerConfig

func DefaultControllerConfig(namespace string) *eirinictrl.ControllerConfig

func EnsureStatusConditionTrue added in v0.6.0

func EnsureStatusConditionTrue(clientset eiriniclient.Interface, namespace, taskName, conditionType string) func(g Gomega)

func GetLRP

func GetLRP(clientset eiriniclient.Interface, namespace, lrpName string) *eiriniv1.LRP

func GetPDB

func GetPDB(clientset kubernetes.Interface, namespace, lrpGUID, lrpVersion string) policyv1.PodDisruptionBudget

func GetPDBItems

func GetPDBItems(clientset kubernetes.Interface, namespace, lrpGUID, lrpVersion string) ([]policyv1.PodDisruptionBudget, error)

func GetRegistrySecretName

func GetRegistrySecretName(clientset kubernetes.Interface, namespace, taskGUID, secretName string) string

func GetStatefulSet

func GetStatefulSet(clientset kubernetes.Interface, namespace, guid, version string) *appsv1.StatefulSet

func GetTaskJobConditions

func GetTaskJobConditions(clientset kubernetes.Interface, namespace, taskGUID string) func() []batchv1.JobCondition

func ListJobs

func ListJobs(clientset kubernetes.Interface, namespace, taskGUID string) func() []batchv1.Job

func MakeTestHTTPClient

func MakeTestHTTPClient(certsPath string) (*http.Client, error)

Types

type Binary

type Binary struct {
	PackagePath string `json:"src_path"`
	BinPath     string `json:"bin_path"`
	LocksDir    string `json:"locks_dir"`
	CertsPath   string `json:"cert_path"`
}

func NewBinary

func NewBinary(packagePath, binsPath string, certsPath string) Binary

func (*Binary) Build

func (b *Binary) Build()

Build builds the binary. Normally, you should not use this function as it is built if needed upon first run anyway. However, sometimes it might make sense to explicitly build a common binary that is used across all the tests in SynchronizedBeforeSuite thus preventing running the build on concurrent nodes.

For example, EATs tests will always run API, therefore it is a good idea to build it in advance.

func (*Binary) Restart

func (b *Binary) Restart(configFilePath string, runningSession *gexec.Session) *gexec.Session

func (*Binary) Run

func (b *Binary) Run(config interface{}, envVars ...string) (*gexec.Session, string)

func (*Binary) RunWithConfig

func (b *Binary) RunWithConfig(configFilePath string, envVars ...string) *gexec.Session

type EiriniBinaries

type EiriniBinaries struct {
	EiriniController Binary `json:"eirini_controller"`
	ExternalBinsPath bool
	BinsPath         string
	CertsPath        string
	CABundle         []byte
}

func NewEiriniBinaries

func NewEiriniBinaries() EiriniBinaries

func (*EiriniBinaries) TearDown

func (b *EiriniBinaries) TearDown()

Directories

Path Synopsis
assets

Jump to

Keyboard shortcuts

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