test

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 9 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestClientInstance TestClient

Functions

func RunTestCase

func RunTestCase(test VeleroBackupRestoreTest) error

func TestFunc

func TestFunc(test VeleroBackupRestoreTest) func()

func TestFuncWithMultiIt

func TestFuncWithMultiIt(tests []VeleroBackupRestoreTest) func()

Types

type TestCase

type TestCase struct {
	BackupName      string
	RestoreName     string
	NSBaseName      string
	BackupArgs      []string
	RestoreArgs     []string
	NamespacesTotal int
	TestMsg         *TestMSG
	Client          TestClient
	Ctx             context.Context
	NSIncluded      *[]string
}

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) GetTestMsg

func (t *TestCase) GetTestMsg() *TestMSG

func (*TestCase) Init

func (t *TestCase) Init() error

func (*TestCase) Restore

func (t *TestCase) Restore() error

func (*TestCase) StartRun added in v1.9.0

func (t *TestCase) StartRun() 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
	StartRun() error
	CreateResources() error
	Backup() error
	Destroy() error
	Restore() error
	Verify() error
	Clean() error
	GetTestMsg() *TestMSG
}

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