test

package
v1.13.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTestCase

func RunTestCase(test VeleroBackupRestoreTest) error

func TestFunc

func TestFunc(test VeleroBackupRestoreTest) func()

Types

type TestCase

type TestCase struct {
	BackupName         string
	RestoreName        string
	CaseBaseName       string
	BackupArgs         []string
	RestoreArgs        []string
	NamespacesTotal    int
	TestMsg            *TestMSG
	Client             TestClient
	NSIncluded         *[]string
	NSExcluded         *[]string
	UseVolumeSnapshots bool
	RestorePhaseExpect velerov1api.RestorePhase
	Ctx                context.Context
	CtxCancel          context.CancelFunc
	UUIDgen            string
	// contains filtered or unexported fields
}

func (*TestCase) Backup

func (t *TestCase) Backup() error

func (*TestCase) Clean

func (t *TestCase) Clean() error

func (*TestCase) CreateResources

func (t *TestCase) CreateResources() error

func (*TestCase) Destroy

func (t *TestCase) Destroy() error

func (*TestCase) GenerateUUID

func (t *TestCase) GenerateUUID() string

func (*TestCase) GetTestCase

func (t *TestCase) GetTestCase() *TestCase

func (*TestCase) GetTestMsg

func (t *TestCase) GetTestMsg() *TestMSG

func (*TestCase) Init

func (t *TestCase) Init() error

func (*TestCase) MonitorMetircs

func (t *TestCase) MonitorMetircs(ctx context.Context, collectors *metrics.MetricsCollector)

func (*TestCase) Restore

func (t *TestCase) Restore() error

func (*TestCase) Verify

func (t *TestCase) Verify() error

type TestMSG

type TestMSG struct {
	Desc      string
	Text      string
	FailedMSG string
}

type VeleroBackupRestoreTest

type VeleroBackupRestoreTest interface {
	Init() error
	CreateResources() error
	Backup() error
	Destroy() error
	Restore() error
	Verify() error
	Clean() error
	GetTestMsg() *TestMSG
	GetTestCase() *TestCase
}

The VeleroBackupRestoreTest interface is just could be suit for the cases that follow the test flow of create resources, backup, delete test resource, restore and verify. And the cases have similar execute function and similar data. it's both fine for you to use it or not which depends on your test patterns.

Jump to

Keyboard shortcuts

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