Documentation ¶
Index ¶
- Constants
- Variables
- func AddLabelsOnNode(n node.Node, labels map[string]string) error
- func AfterEachTest(contexts []*scheduler.Context)
- func ChangeNamespaces(contexts []*scheduler.Context, namespaceMapping map[string]string) error
- func CollectEventRecords(recordChan *chan *EventRecord)
- func CollectSupport()
- func CrashVolDriverAndWait(appNodes []node.Node)
- func DeleteVolumes(ctx *scheduler.Context, options *scheduler.VolumeOptions) []*volume.Volume
- func DeleteVolumesAndWait(ctx *scheduler.Context, options *scheduler.VolumeOptions)
- func DescribeNamespace(contexts []*scheduler.Context)
- func GenerateUUID() string
- func GetAppNamespace(ctx *scheduler.Context, taskname string) string
- func GetVolumeParameters(ctx *scheduler.Context) map[string]map[string]string
- func InitInstance()
- func ParseFlags()
- func PerformSystemCheck()
- func ScheduleApplications(testname string) []*scheduler.Context
- func StartVolDriverAndWait(appNodes []node.Node)
- func StopVolDriverAndWait(appNodes []node.Node)
- func TearDownContext(ctx *scheduler.Context, opts map[string]bool)
- func TriggerAppTaskDown(contexts []*scheduler.Context, recordChan *chan *EventRecord)
- func TriggerCrashVolDriver(contexts []*scheduler.Context, recordChan *chan *EventRecord)
- func TriggerEmailReporter(contexts []*scheduler.Context, recordChan *chan *EventRecord)
- func TriggerHADecrease(contexts []*scheduler.Context, recordChan *chan *EventRecord)
- func TriggerHAIncrease(contexts []*scheduler.Context, recordChan *chan *EventRecord)
- func TriggerRebootNodes(contexts []*scheduler.Context, recordChan *chan *EventRecord)
- func TriggerRestartVolDriver(contexts []*scheduler.Context, recordChan *chan *EventRecord)
- func UpdateOutcome(event *EventRecord, err error)
- func UpdateVolumeInVolumeParameters(volParam map[string]map[string]string) map[string]map[string]string
- func ValidateAndDestroy(contexts []*scheduler.Context, opts map[string]bool)
- func ValidateApplications(contexts []*scheduler.Context)
- func ValidateCleanup()
- func ValidateClusterSize(count int64)
- func ValidateContext(ctx *scheduler.Context, errChan ...*chan error)
- func ValidateRestoredApplications(contexts []*scheduler.Context, volumeParameters map[string]map[string]string)
- func ValidateStoragePools(contexts []*scheduler.Context)
- func ValidateVolumeParameters(volParam map[string]map[string]string)
- func ValidateVolumes(ctx *scheduler.Context, errChan ...*chan error)
- func ValidateVolumesDeleted(appName string, vols []*volume.Volume)
- type Event
- type EventRecord
- type Torpedo
Constants ¶
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" )
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" )
const (
// SkipClusterScopedObjects describes option for skipping deletion of cluster wide objects
SkipClusterScopedObjects = "skipClusterScopedObjects"
)
Variables ¶
var EmailRecipients []string
EmailRecipients list of email IDs to send email to
var SendGridEmailAPIKey string
SendGridEmailAPIKey holds API key used to interact with SendGrid Email APIs
var ( // Step is an alias for ginko "By" which represents a step in the spec Step = ginkgo.By )
Functions ¶
func AddLabelsOnNode ¶
AddLabelsOnNode adds labels on the node
func AfterEachTest ¶
AfterEachTest runs collect support bundle after each test when it fails
func ChangeNamespaces ¶
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 CrashVolDriverAndWait ¶
CrashVolDriverAndWait crashes volume driver on given app nodes and waits till driver is back up
func DeleteVolumes ¶
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 ¶
DescribeNamespace takes in the scheduler contexts and describes each object within the test context.
func GetAppNamespace ¶
GetAppNamespace returns namespace in which context is created
func GetVolumeParameters ¶
GetVolumeParameters retuns volume parameters for all volumes for given context
func PerformSystemCheck ¶
func PerformSystemCheck()
PerformSystemCheck check if core files are present on each node
func ScheduleApplications ¶
ScheduleApplications schedules but does not wait for applications
func StartVolDriverAndWait ¶
StartVolDriverAndWait starts volume driver on given app nodes
func StopVolDriverAndWait ¶
StopVolDriverAndWait stops volume driver on given app nodes and waits till driver is down
func TearDownContext ¶
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 ¶
ValidateAndDestroy validates application and then destroys them
func ValidateApplications ¶
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 ¶
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 ¶
ValidateStoragePools is the ginkgo spec for validating storage pools
func ValidateVolumeParameters ¶
ValidateVolumeParameters validates volume parameters using volume driver
func ValidateVolumes ¶
ValidateVolumes is the ginkgo spec for validating volumes of a context
func ValidateVolumesDeleted ¶
ValidateVolumesDeleted checks it given volumes got deleted
Types ¶
type EventRecord ¶
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