test

package
v0.0.0-...-e70be16 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const LOCAL_MODE = "local"
View Source
const MANIFEST_MODE = "manifest"
View Source
const SharedFixturesDir = "../../internal/test/fixtures"

SharedFixturesDir contains fixtures used by multiple tests

Variables

This section is empty.

Functions

func ApplyManifest

func ApplyManifest(t *testing.T, manifestPath, namespace string)

func AuditLocal

func AuditLocal(t *testing.T, fixtureDir, fixture string, auditable kubeaudit.Auditable, namespace string, expectedErrors []string) *kubeaudit.Report

func AuditManifest

func AuditManifest(t *testing.T, fixtureDir, fixture string, auditable kubeaudit.Auditable, expectedErrors []string) *kubeaudit.Report

func AuditMultiple

func AuditMultiple(t *testing.T, fixtureDir, fixture string, auditables []kubeaudit.Auditable, expectedErrors []string, namespace string, mode string) *kubeaudit.Report

func CreateNamespace

func CreateNamespace(t *testing.T, namespace string)

func DeleteNamespace

func DeleteNamespace(t *testing.T, namespace string)

func FixSetup

func FixSetup(t *testing.T, fixtureDir, fixture string, auditable kubeaudit.Auditable) (fixedResources []k8s.Resource, report *kubeaudit.Report)

func FixSetupMultiple

func FixSetupMultiple(t *testing.T, fixtureDir, fixture string, auditables []kubeaudit.Auditable) (fixedResources []k8s.Resource, report *kubeaudit.Report)

FixSetup runs Fix() on a given manifest and returns the resulting resources

func GetAllFileNames

func GetAllFileNames(t *testing.T, directory string) []string

GetAllFileNames returns all file names in the given directory It can be used to retrieve all of the resource manifests from the test/fixtures/all_resources directory This directory is not hardcoded because the working directory for tests is relative to the test

func GetReport

func GetReport(t *testing.T, fixtureDir, fixture string, auditables []kubeaudit.Auditable, namespace string, mode string) *kubeaudit.Report

func UseKind

func UseKind() bool

UseKind returns true if tests which utilize Kind should run

Types

This section is empty.

Jump to

Keyboard shortcuts

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