e2etest

package
v10.12.12 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EAccountType = AccountType(0)
View Source
var StringContains = &stringContainsChecker{
	&chk.CheckerInfo{Name: "StringContains", Params: []string{"obtained", "expected to find"}},
}

Functions

func GetContentTypeMap

func GetContentTypeMap(fileExtensions []string) map[string]string

func RunScenarios

func RunScenarios(
	t *testing.T,
	operations Operation,
	testFromTo TestFromTo,
	validate Validate,

	p params,
	hs *hooks,
	fs testFiles,

	accountType AccountType,
	scenarioSuffix string)

RunScenarios is the key entry point for declarative testing. It constructs and executes scenarios (subtest in Go-speak), according to its parameters, and checks their results

Types

type AccountType

type AccountType uint8

func (AccountType) HierarchicalNamespaceEnabled

func (AccountType) HierarchicalNamespaceEnabled() AccountType

func (AccountType) Premium

func (AccountType) Premium() AccountType

func (AccountType) Standard

func (AccountType) Standard() AccountType

func (AccountType) String

func (o AccountType) String() string

type CopyOrSyncCommandResult

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

func (*CopyOrSyncCommandResult) GetTransferList

func (c *CopyOrSyncCommandResult) GetTransferList(status common.TransferStatus) ([]common.TransferDetail, error)

type GlobalInputManager

type GlobalInputManager struct{}

clearly define all the inputs to the end-to-end tests it's ok to panic if the inputs are absolutely required the general guidance is to take in as few parameters as possible

func (GlobalInputManager) GetAccountAndKey

func (GlobalInputManager) GetAccountAndKey(accountType AccountType) (string, string)

func (GlobalInputManager) GetExecutablePath

func (GlobalInputManager) GetExecutablePath() string

func (GlobalInputManager) KeepFailedData

func (GlobalInputManager) KeepFailedData() bool

func (GlobalInputManager) TestSummaryLogPath

func (GlobalInputManager) TestSummaryLogPath() string

type JobsShowCommandResult

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

type Operation

type Operation uint8

func (Operation) Copy

func (Operation) Copy() Operation

func (Operation) CopyAndSync

func (Operation) CopyAndSync() Operation

func (Operation) Remove

func (Operation) Remove() Operation

func (Operation) Resume

func (Operation) Resume() Operation

func (Operation) String

func (o Operation) String() string

func (Operation) Sync

func (Operation) Sync() Operation

type TestFromTo

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

TestFromTo is similar to common/FromTo, except that it can have cases where one value represents many possibilities

func NewTestFromTo

func NewTestFromTo(desc string, useAllTos bool, froms []common.Location, tos []common.Location) TestFromTo

func (TestFromTo) AllAzureS2S

func (TestFromTo) AllAzureS2S() TestFromTo

AllAzureS2S is like AllS2S, but it excludes non-Azure sources. (No need to exclude non-Azure destinations, since AzCopy doesn't have those)

func (TestFromTo) AllDownloads

func (TestFromTo) AllDownloads() TestFromTo

AllDownloads represents the subset of AllPairs that are downloads

func (TestFromTo) AllPairs

func (TestFromTo) AllPairs() TestFromTo

AllPairs tests literally all Source/Dest pairings that are supported by AzCopy. Use this sparingly, because it runs a lot of cases. Prefer AllSourcesToOneDest or AllSourcesDownAndS2S or similar.

func (TestFromTo) AllRemove

func (TestFromTo) AllRemove() TestFromTo

AllRemove represents the subset of AllPairs that are remove/delete

func (TestFromTo) AllS2S

func (TestFromTo) AllS2S() TestFromTo

AllS2S represents the subset of AllPairs that are S2S transfers

func (TestFromTo) AllSourcesDownAndS2S

func (TestFromTo) AllSourcesDownAndS2S() TestFromTo

AllSourcesDownAndS2S means use all possible sources, and for each to both Blob and a download to local (except when not applicable. E.g. local source doesn't support download; AzCopy's ADLS Gen doesn't (currently) support S2S. This is a good general purpose choice, because it lets you do exercise things fairly comprehensively without actually getting into all pairwise combinations

func (TestFromTo) AllSourcesToOneDest

func (TestFromTo) AllSourcesToOneDest() TestFromTo

AllSourcesToOneDest means use all possible sources, and test each source to one destination (generally Blob is the destination, except for sources that don't support Blob, in which case, a download to local is done). Use this for tests that are primarily about enumeration of the source (rather than support for a wide range of destinations)

func (TestFromTo) AllSync

func (TestFromTo) AllSync() TestFromTo

func (TestFromTo) AllUploads

func (TestFromTo) AllUploads() TestFromTo

AllUploads represents the subset of AllPairs that are uploads

func (TestFromTo) Other

func (TestFromTo) Other(values ...common.FromTo) TestFromTo

Other is for when you want to list one or more specific from-tos that the test should cover. Generally avoid this method, because it does not automatically pick up new pairs as we add new supported resource types to AzCopy.

func (TestFromTo) String

func (tft TestFromTo) String() string

type TestResourceFactory

type TestResourceFactory struct{}

provide convenient methods to get access to test resources such as accounts, containers/shares, directories

func (TestResourceFactory) CreateLocalDirectory

func (TestResourceFactory) CreateLocalDirectory(c asserter) (dstDirName string)

func (TestResourceFactory) CreateNewContainer

func (TestResourceFactory) CreateNewContainer(c asserter, accountType AccountType) (container azblob.ContainerURL, name string, rawURL url.URL)

func (TestResourceFactory) CreateNewFileShare

func (TestResourceFactory) CreateNewFileShare(c asserter, accountType AccountType) (fileShare azfile.ShareURL, name string, rawSasURL url.URL)

func (TestResourceFactory) CreateNewFileShareSnapshot

func (TestResourceFactory) CreateNewFileShareSnapshot(c asserter, fileShare azfile.ShareURL) (snapshotID string)

func (TestResourceFactory) GetBlobServiceURL

func (TestResourceFactory) GetBlobServiceURL(accountType AccountType) azblob.ServiceURL

func (TestResourceFactory) GetBlobServiceURLWithSAS

func (TestResourceFactory) GetBlobServiceURLWithSAS(c asserter, accountType AccountType) azblob.ServiceURL

func (TestResourceFactory) GetBlobURLWithSAS

func (TestResourceFactory) GetBlobURLWithSAS(c asserter, accountType AccountType, containerName string, blobName string) azblob.BlobURL

func (TestResourceFactory) GetContainerURLWithSAS

func (TestResourceFactory) GetContainerURLWithSAS(c asserter, accountType AccountType, containerName string) azblob.ContainerURL

func (TestResourceFactory) GetDatalakeServiceURL

func (TestResourceFactory) GetDatalakeServiceURL(accountType AccountType) azbfs.ServiceURL

func (TestResourceFactory) GetFileServiceURL

func (TestResourceFactory) GetFileServiceURL(accountType AccountType) azfile.ServiceURL

func (TestResourceFactory) GetFileShareULWithSAS

func (TestResourceFactory) GetFileShareULWithSAS(c asserter, accountType AccountType, containerName string) azfile.ShareURL

type TestResourceNameGenerator

type TestResourceNameGenerator struct{}

func (TestResourceNameGenerator) GenerateContainerName

func (TestResourceNameGenerator) GenerateContainerName(c asserter) string

type TestRunner

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

encapsulates the interaction with the AzCopy instance that is being tested the flag names should be captured here so that in case they change, only 1 place needs to be updated

func (*TestRunner) ExecuteAzCopyCommand

func (t *TestRunner) ExecuteAzCopyCommand(operation Operation, src, dst string, afterStart func() string, chToStdin <-chan string) (CopyOrSyncCommandResult, bool, error)

func (*TestRunner) ExecuteJobsShowCommand

func (t *TestRunner) ExecuteJobsShowCommand(jobID common.JobID) (JobsShowCommandResult, error)

func (*TestRunner) SetAllFlags

func (t *TestRunner) SetAllFlags(p params)

func (*TestRunner) SetAwaitOpenFlag

func (t *TestRunner) SetAwaitOpenFlag()

func (*TestRunner) SetTransferStatusFlag

func (t *TestRunner) SetTransferStatusFlag(value string)

type Validate

type Validate uint8

func (Validate) Auto

func (Validate) Auto() Validate

Auto automatically validates everything except for the actual content of the transferred files. It includes "which transfers did we attempt, and what was their outcome?" AND, if any of the shouldTransfer files specify file properties that should be validated, it validates those too

func (Validate) AutoPlusContent

func (Validate) AutoPlusContent() Validate

BasicPlusContent also validates the file content

func (Validate) String

func (v Validate) String() string

type Validator

type Validator struct{}

func (Validator) ValidateCopyTransfersAreScheduled

func (Validator) ValidateCopyTransfersAreScheduled(c asserter, isSrcEncoded bool, isDstEncoded bool,
	sourcePrefix string, destinationPrefix string, expectedTransfers []*testObject, actualTransfers []common.TransferDetail, statusToTest common.TransferStatus)

func (Validator) ValidateRemoveTransfer

func (Validator) ValidateRemoveTransfer(c asserter, isSrcEncoded bool, isDstEncoded bool,
	sourcePrefix string, destinationPrefix string, expectedTransfers []*testObject, actualTransfers []common.TransferDetail, statusToTest common.TransferStatus)

Jump to

Keyboard shortcuts

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