tests

package
v0.20.4-rc2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// EmailRecipientsConfigMapField is field in config map whos value is comma
	// seperated list of email IDs which will recieve email notifications about logivity
	EmailRecipientsConfigMapField = "emailRecipients"
	// DefaultEmailRecipient is list of email IDs that will recieve email
	// notifications when no EmailRecipientsConfigMapField field present in configMap
	DefaultEmailRecipient = "test@portworx.com"
	// SendGridEmailAPIKeyField is field in config map which stores the SendGrid Email API key
	SendGridEmailAPIKeyField = "sendGridAPIKey"
)
View Source
const (
	// HAIncrease performs repl-add
	HAIncrease = "haIncrease"
	// HADecrease performs repl-reduce
	HADecrease = "haDecrease"
	// AppTaskDown deletes application task for all contexts
	AppTaskDown = "appTaskDown"
	// RestartVolDriver restart volume driver
	RestartVolDriver = "restartVolDriver"
	// CrashVolDriver crashes volume driver
	CrashVolDriver = "crashVolDriver"
	// RebootNode reboots alll nodes one by one
	RebootNode = "rebootNode"
	// EmailReporter notifies via email outcome of past events
	EmailReporter = "emailReporter"
)
View Source
const (
	// SkipClusterScopedObjects describes option for skipping deletion of cluster wide objects
	SkipClusterScopedObjects = "skipClusterScopedObjects"
)

Variables

View Source
var EmailRecipients []string

EmailRecipients list of email IDs to send email to

View Source
var SendGridEmailAPIKey string

SendGridEmailAPIKey holds API key used to interact with SendGrid Email APIs

View Source
var (

	// Step is an alias for ginko "By" which represents a step in the spec
	Step = ginkgo.By
)

Functions

func AddLabelsOnNode

func AddLabelsOnNode(n node.Node, labels map[string]string) error

AddLabelsOnNode adds labels on the node

func AfterEachTest

func AfterEachTest(contexts []*scheduler.Context)

AfterEachTest runs collect support bundle after each test when it fails

func ChangeNamespaces

func ChangeNamespaces(contexts []*scheduler.Context,
	namespaceMapping map[string]string) error

ChangeNamespaces updates the namespace in supplied in-memory contexts. It does not apply changes on scheduler

func CollectEventRecords

func CollectEventRecords(recordChan *chan *EventRecord)

CollectEventRecords collects eventRecords from channel and stores in buffer for future email notifications

func CollectSupport

func CollectSupport()

CollectSupport creates a support bundle

func CrashVolDriverAndWait

func CrashVolDriverAndWait(appNodes []node.Node)

CrashVolDriverAndWait crashes volume driver on given app nodes and waits till driver is back up

func DeleteVolumes

func DeleteVolumes(ctx *scheduler.Context, options *scheduler.VolumeOptions) []*volume.Volume

DeleteVolumes deletes volumes of a given context

func DeleteVolumesAndWait

func DeleteVolumesAndWait(ctx *scheduler.Context, options *scheduler.VolumeOptions)

DeleteVolumesAndWait deletes volumes of given context and waits till they are deleted

func DescribeNamespace

func DescribeNamespace(contexts []*scheduler.Context)

DescribeNamespace takes in the scheduler contexts and describes each object within the test context.

func GenerateUUID

func GenerateUUID() string

GenerateUUID generates unique ID

func GetAppNamespace

func GetAppNamespace(ctx *scheduler.Context, taskname string) string

GetAppNamespace returns namespace in which context is created

func GetVolumeParameters

func GetVolumeParameters(ctx *scheduler.Context) map[string]map[string]string

GetVolumeParameters retuns volume parameters for all volumes for given context

func InitInstance

func InitInstance()

InitInstance is the ginkgo spec for initializing torpedo

func ParseFlags

func ParseFlags()

ParseFlags parses command line flags

func PerformSystemCheck

func PerformSystemCheck()

PerformSystemCheck check if core files are present on each node

func ScheduleApplications

func ScheduleApplications(testname string) []*scheduler.Context

ScheduleApplications schedules but does not wait for applications

func StartVolDriverAndWait

func StartVolDriverAndWait(appNodes []node.Node)

StartVolDriverAndWait starts volume driver on given app nodes

func StopVolDriverAndWait

func StopVolDriverAndWait(appNodes []node.Node)

StopVolDriverAndWait stops volume driver on given app nodes and waits till driver is down

func TearDownContext

func TearDownContext(ctx *scheduler.Context, opts map[string]bool)

TearDownContext is the ginkgo spec for tearing down a scheduled context In the tear down flow we first want to delete volumes, then applications and only then we want to delete StorageClasses StorageClass has to be deleted last because it has information that is required for when deleting PVC, if StorageClass objects are deleted before deleting PVCs, especially with CSI + Auth enabled, PVC deletion will fail as Auth params are stored inside StorageClass objects

func TriggerAppTaskDown

func TriggerAppTaskDown(contexts []*scheduler.Context, recordChan *chan *EventRecord)

TriggerAppTaskDown deletes application task for all contexts

func TriggerCrashVolDriver

func TriggerCrashVolDriver(contexts []*scheduler.Context, recordChan *chan *EventRecord)

TriggerCrashVolDriver crashes vol driver

func TriggerEmailReporter

func TriggerEmailReporter(contexts []*scheduler.Context, recordChan *chan *EventRecord)

TriggerEmailReporter sends email with all reported errors

func TriggerHADecrease

func TriggerHADecrease(contexts []*scheduler.Context, recordChan *chan *EventRecord)

TriggerHADecrease performs repl-reduce on all volumes of given contexts

func TriggerHAIncrease

func TriggerHAIncrease(contexts []*scheduler.Context, recordChan *chan *EventRecord)

TriggerHAIncrease peforms repl-add on all volumes of given contexts

func TriggerRebootNodes

func TriggerRebootNodes(contexts []*scheduler.Context, recordChan *chan *EventRecord)

TriggerRebootNodes reboots node on which apps are running

func TriggerRestartVolDriver

func TriggerRestartVolDriver(contexts []*scheduler.Context, recordChan *chan *EventRecord)

TriggerRestartVolDriver restarts volume driver and validates app

func UpdateOutcome

func UpdateOutcome(event *EventRecord, err error)

UpdateOutcome updates outcome based on error

func UpdateVolumeInVolumeParameters

func UpdateVolumeInVolumeParameters(volParam map[string]map[string]string) map[string]map[string]string

UpdateVolumeInVolumeParameters modifies volume parameters with correct PV name from PVC

func ValidateAndDestroy

func ValidateAndDestroy(contexts []*scheduler.Context, opts map[string]bool)

ValidateAndDestroy validates application and then destroys them

func ValidateApplications

func ValidateApplications(contexts []*scheduler.Context)

ValidateApplications validates applications

func ValidateCleanup

func ValidateCleanup()

ValidateCleanup checks that there are no resource leaks after the test run

func ValidateClusterSize

func ValidateClusterSize(count int64)

ValidateClusterSize validates number of storage nodes in given cluster using total cluster size `count` and max_storage_nodes_per_zone

func ValidateContext

func ValidateContext(ctx *scheduler.Context, errChan ...*chan error)

ValidateContext is the ginkgo spec for validating a scheduled context

func ValidateRestoredApplications

func ValidateRestoredApplications(contexts []*scheduler.Context, volumeParameters map[string]map[string]string)

ValidateRestoredApplications validates applications restored by backup driver

func ValidateStoragePools

func ValidateStoragePools(contexts []*scheduler.Context)

ValidateStoragePools is the ginkgo spec for validating storage pools

func ValidateVolumeParameters

func ValidateVolumeParameters(volParam map[string]map[string]string)

ValidateVolumeParameters validates volume parameters using volume driver

func ValidateVolumes

func ValidateVolumes(ctx *scheduler.Context, errChan ...*chan error)

ValidateVolumes is the ginkgo spec for validating volumes of a context

func ValidateVolumesDeleted

func ValidateVolumesDeleted(appName string, vols []*volume.Volume)

ValidateVolumesDeleted checks it given volumes got deleted

Types

type Event

type Event struct {
	ID   string
	Type string
}

Event describes type of test trigger

type EventRecord

type EventRecord struct {
	Event   Event
	Start   string
	End     string
	Outcome []error
}

EventRecord recodes which event took place at what time with what outcome

type Torpedo

type Torpedo struct {
	InstanceID                          string
	S                                   scheduler.Driver
	V                                   volume.Driver
	N                                   node.Driver
	SpecDir                             string
	AppList                             []string
	LogLoc                              string
	LogLevel                            string
	ScaleFactor                         int
	StorageDriverUpgradeEndpointURL     string
	StorageDriverUpgradeEndpointVersion string
	EnableStorkUpgrade                  bool
	MinRunTimeMins                      int
	ChaosLevel                          int
	Provisioner                         string
	MaxStorageNodesPerAZ                int
	DestroyAppTimeout                   time.Duration
	DriverStartTimeout                  time.Duration
	AutoStorageNodeRecoveryTimeout      time.Duration
	ConfigMap                           string
	BundleLocation                      string
	CustomAppConfig                     map[string]scheduler.AppConfig
	Backup                              backup.Driver
	SecretType                          string
	VaultAddress                        string
	VaultToken                          string
	SchedUpgradeHops                    string
	AutopilotUpgradeImage               string
	CsiGenericDriverConfigMap           string
}

Torpedo is the torpedo testsuite

func Inst

func Inst() *Torpedo

Inst returns the Torpedo instances

Jump to

Keyboard shortcuts

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