e2e

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

README

End-to-End Testing

Context

The FSx OpenZFS CSI driver utilizes a variety of workflows to validate end to end functionality in a Kubernetes environment. The framework and existing testsuites for Kubernetes storage E2E testing is leveraged to test common cases. Untested or unique test cases are also tested using a custom testsuite.

Due to the nature of end-to-end tests it is possible to leave testing artifacts stranded. Events such as abrupt termination or server-side API failures can prevent resources from being deleted properly. The fsx hack contains a function that cleans up all testing resources that may have been left stranded. Run bash ../../hack/e2e/fsx.sh fsx_delete_e2e_resources to execute this function.

Running

In order to run the E2E tests, an EKS cluster with an OpenZFS driver installed must be utilized. Follow the respective section depending on if a test environment is already set up.

Existing Environment

The test environment should contain the following:

  1. Kubernetes 1.13+ (CSI 1.0).
  2. EKS Cluster
  3. Ginkgo CLI

Run ginkgo -r --procs=4 --timeout=5h --junit-report=report.xml from the tests/e2e folder to run

Documentation

Index

Constants

View Source
const (
	RESOURCETYPE            = "ResourceType"
	RESOURCETYPE_FILESYSTEM = "filesystem"
	RESOURCETYPE_VOLUME     = "volume"
)
View Source
const (
	CSIDriverE2ETagKey = "OpenZFSCSIDriverE2E"
)

Variables

View Source
var (
	ClusterName string
	Region      string
	PullRequest string
)
View Source
var APIGroup = "snapshot.storage.k8s.io"

Functions

func InitCustomSnapshotsTestSuite

func InitCustomSnapshotsTestSuite(patterns []storageframework.TestPattern) storageframework.TestSuite

InitCustomSnapshotsTestSuite returns snapshotsTestSuite that implements TestSuite interface using custom test patterns

func InitFSxCSIDriver

func InitFSxCSIDriver(parameters map[string]string, restoreSnapshotParameters map[string]string, snapshotParameters map[string]string, createInput any, deleteInput any) storageframework.TestDriver

func InitSnapshotsTestSuite

func InitSnapshotsTestSuite() storageframework.TestSuite

InitSnapshotsTestSuite returns snapshotsTestSuite that implements TestSuite interface\ using test suite default patterns

Types

type Cloud

type Cloud struct {
	FSx       fsx.FSx
	EC2client ec2.EC2
}

func NewCloud

func NewCloud(region string) *Cloud

func (*Cloud) CreateFileSystem

func (c *Cloud) CreateFileSystem(ctx context.Context, input fsx.CreateFileSystemInput) (*fsx.FileSystem, error)

func (*Cloud) CreateVolume

func (c *Cloud) CreateVolume(ctx context.Context, input fsx.CreateVolumeInput) (*fsx.Volume, error)

func (*Cloud) DeleteFileSystem

func (c *Cloud) DeleteFileSystem(ctx context.Context, input fsx.DeleteFileSystemInput) error

func (*Cloud) DeleteVolume

func (c *Cloud) DeleteVolume(ctx context.Context, input fsx.DeleteVolumeInput) error

func (*Cloud) GetDNSName

func (c *Cloud) GetDNSName(ctx context.Context, filesystemId string) (string, error)

func (*Cloud) GetNodeInstance

func (c *Cloud) GetNodeInstance(ctx context.Context, clusterName string) (*ec2.Instance, error)

func (*Cloud) GetSecurityGroupIds

func (c *Cloud) GetSecurityGroupIds(node *ec2.Instance) []string

func (*Cloud) WaitForFilesystemAvailable

func (c *Cloud) WaitForFilesystemAvailable(ctx context.Context, filesystemId string) error

func (*Cloud) WaitForVolumeAvailable

func (c *Cloud) WaitForVolumeAvailable(ctx context.Context, volumeId string) error

type FSxFilesystem

type FSxFilesystem struct {
	RootVolumeId string
	// contains filtered or unexported fields
}

func (*FSxFilesystem) DeleteVolume

func (f *FSxFilesystem) DeleteVolume(ctx context.Context)

type FSxResource

type FSxResource struct {
	// contains filtered or unexported fields
}

type FSxTestDriver

type FSxTestDriver interface {
	storageframework.TestDriver
	GetRestoreSnapshotStorageClass(ctx context.Context) *storagev1.StorageClass
}

type FSxVolume

type FSxVolume struct {
	// contains filtered or unexported fields
}

func (*FSxVolume) DeleteVolume

func (v *FSxVolume) DeleteVolume(ctx context.Context)

Jump to

Keyboard shortcuts

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