e2etest

package
v10.0.0-...-53ebdbe Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EAccountType = AccountType(0)
View Source
var ETestFromTo = TestFromToEnum(0)

An extesion to common.FromTO to support smb mount to file

View Source
var ETestLocation = TestLocation(0)

An extension to common.ELocation to support smb mount location

Functions

func GetContentTypeMap

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

func RunScenarios

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

	requestedCredentialTypesSrc []common.CredentialType,
	requestedCredentialTypesDst []common.CredentialType,
	p params,
	hs *hooks,
	fs testFiles,

	destAccountType AccountType,
	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) Classic

func (AccountType) Classic() AccountType

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

func (GlobalInputManager) GetServicePrincipalAuth() (tenantID string, applicationID string, clientSecret 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 TestFromToEnum

type TestFromToEnum common.FromTo

func (TestFromToEnum) IsDownload

func (ft TestFromToEnum) IsDownload() bool

func (TestFromToEnum) IsS2S

func (ft TestFromToEnum) IsS2S() bool

func (TestFromToEnum) IsUpload

func (ft TestFromToEnum) IsUpload() bool

func (*TestFromToEnum) ParseLocation

func (ft *TestFromToEnum) ParseLocation(s string) error

func (TestFromToEnum) SMBMountFile

func (TestFromToEnum) SMBMountFile() TestFromToEnum

func (TestFromToEnum) String

func (ft TestFromToEnum) String() string

type TestFromToEx

type TestFromToEx TestFromTo

Temporary functions to disable all the not supported scenarios by azCopy fork Just for focusing on the supported scenarios - to be covered by the tests

func (TestFromToEx) AllPairs

func (TestFromToEx) 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 (TestFromToEx) AllRemove

func (TestFromToEx) AllRemove() TestFromTo

AllRemove represents the subset of AllPairs that are remove/delete

func (TestFromToEx) AllSMB

func (TestFromToEx) AllSMB() TestFromTo

func (TestFromToEx) AllSourcesToOneDest

func (TestFromToEx) 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 (TestFromToEx) AllSync

func (TestFromToEx) AllSync() TestFromTo

type TestLocation

type TestLocation common.Location

func (TestLocation) AllStandardLocations

func (TestLocation) AllStandardLocations() []common.Location

func (TestLocation) IsFolderAware

func (l TestLocation) IsFolderAware() bool

func (TestLocation) IsLocal

func (l TestLocation) IsLocal() bool

func (TestLocation) IsRemote

func (l TestLocation) IsRemote() bool

func (TestLocation) SMBMount

func (TestLocation) SMBMount() TestLocation

func (TestLocation) String

func (l TestLocation) 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, baseDir string) (dstDirName string)

func (TestResourceFactory) CreateLocalMountDirectory

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

func (TestResourceFactory) CreateNewContainer

func (TestResourceFactory) CreateNewContainer(c asserter, publicAccess azblob.PublicAccessType, 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) CreateNewFileSystem

func (TestResourceFactory) CreateNewFileSystem(c asserter, accountType AccountType) (fileSystem azbfs.FileSystemURL, name string, rawUrl url.URL)

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

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

func (TestResourceFactory) GetFileSystemURLWithSAS

func (TestResourceFactory) GetFileSystemURLWithSAS(c asserter, accountType AccountType, containerName string) azbfs.FileSystemURL

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, needsOAuth bool, 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, o Operation)

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, fromTo common.FromTo, srcAccountType, dstAccountType AccountType)

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