Documentation ¶
Index ¶
- Constants
- Variables
- func GetContentTypeMap(fileExtensions []string) map[string]string
- func RunScenarios(t *testing.T, operations Operation, testFromTo TestFromTo, validate Validate, ...)
- type ARMAsyncError
- type ARMAsyncResponse
- type AccountType
- func (AccountType) Classic() AccountType
- func (AccountType) HierarchicalNamespaceEnabled() AccountType
- func (o AccountType) IsBlobOnly() bool
- func (o AccountType) IsManagedDisk() bool
- func (AccountType) OAuthManagedDisk() AccountType
- func (AccountType) Premium() AccountType
- func (AccountType) Standard() AccountType
- func (AccountType) StdManagedDisk() AccountType
- func (o AccountType) String() string
- type CopyOrSyncCommandResult
- type GlobalInputManager
- func (GlobalInputManager) GetAccountAndKey(accountType AccountType) (string, string)
- func (GlobalInputManager) GetExecutablePath() string
- func (gim GlobalInputManager) GetMDConfig(accountType AccountType) (*ManagedDiskConfig, error)
- func (gim GlobalInputManager) GetOAuthCredential(resource string) (*azcore.AccessToken, error)
- func (GlobalInputManager) GetServicePrincipalAuth() (tenantID string, applicationID string, clientSecret string)
- func (GlobalInputManager) KeepFailedData() bool
- func (GlobalInputManager) TestSummaryLogPath() string
- type JobsShowCommandResult
- type ManagedDiskConfig
- type ManagedDiskGetAccessResponse
- type Operation
- type TestFromTo
- func (TestFromTo) AllAzureS2S() TestFromTo
- func (TestFromTo) AllDownloads() TestFromTo
- func (TestFromTo) AllPairs() TestFromTo
- func (TestFromTo) AllRemove() TestFromTo
- func (TestFromTo) AllS2S() TestFromTo
- func (TestFromTo) AllSourcesDownAndS2S() TestFromTo
- func (TestFromTo) AllSourcesToOneDest() TestFromTo
- func (TestFromTo) AllSync() TestFromTo
- func (TestFromTo) AllUploads() TestFromTo
- func (TestFromTo) Other(values ...common.FromTo) TestFromTo
- func (tft TestFromTo) String() string
- type TestResourceFactory
- func (TestResourceFactory) CreateLocalDirectory(c asserter) (dstDirName string)
- func (TestResourceFactory) CreateNewContainer(c asserter, publicAccess *container.PublicAccessType, accountType AccountType) (cc *container.Client, name string, rawURL string)
- func (TestResourceFactory) CreateNewFileShare(c asserter, accountType AccountType) (fileShare *share.Client, name string, rawSasURL string)
- func (TestResourceFactory) CreateNewFileShareSnapshot(c asserter, fileShare *share.Client) (snapshotID string)
- func (TestResourceFactory) GetBlobServiceURL(accountType AccountType) *blobservice.Client
- func (TestResourceFactory) GetBlobServiceURLWithSAS(c asserter, accountType AccountType) *blobservice.Client
- func (TestResourceFactory) GetBlobURLWithSAS(c asserter, accountType AccountType, containerName string, blobName string) *blob.Client
- func (TestResourceFactory) GetContainerURLWithSAS(c asserter, accountType AccountType, containerName string) *container.Client
- func (TestResourceFactory) GetDatalakeServiceURL(accountType AccountType) azbfs.ServiceURL
- func (TestResourceFactory) GetFileServiceURL(accountType AccountType) *fileservice.Client
- func (TestResourceFactory) GetFileShareURLWithSAS(c asserter, accountType AccountType, containerName string) *share.Client
- type TestResourceNameGenerator
- type TestRunner
- func (t *TestRunner) ExecuteAzCopyCommand(operation Operation, src, dst string, needsOAuth bool, ...) (CopyOrSyncCommandResult, bool, error)
- func (t *TestRunner) ExecuteJobsShowCommand(jobID common.JobID, azcopyDir string) (JobsShowCommandResult, error)
- func (t *TestRunner) SetAllFlags(p params, o Operation)
- func (t *TestRunner) SetAwaitOpenFlag()
- func (t *TestRunner) SetTransferStatusFlag(value string)
- type Validate
- type Validator
Constants ¶
const ( ARMStatusSucceeded = "Succeeded" ARMStatusFailed = "Failed" ARMStatusCanceled = "Canceled" )
Variables ¶
var EAccountType = AccountType(0)
Functions ¶
func GetContentTypeMap ¶
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, srcAccountType 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 ARMAsyncError ¶ added in v10.16.1
type ARMAsyncResponse ¶ added in v10.16.1
type ARMAsyncResponse struct { StartTime string `json:"startTime"` EndTime string `json:"endTime"` Status string `json:"status"` // Set Properties to a pointer of your target struct, encoding/json will handle the magic. Properties interface{} `json:"properties"` Name string `json:"name"` Error ARMAsyncError `json:"error"` }
func ResolveAzureAsyncOperation ¶ added in v10.16.1
func ResolveAzureAsyncOperation(OAuth *azcore.AccessToken, uri string, properties interface{}) (armResp *ARMAsyncResponse, err error)
type AccountType ¶
type AccountType uint8
func (AccountType) Classic ¶ added in v10.14.0
func (AccountType) Classic() AccountType
func (AccountType) HierarchicalNamespaceEnabled ¶
func (AccountType) HierarchicalNamespaceEnabled() AccountType
func (AccountType) IsBlobOnly ¶ added in v10.16.1
func (o AccountType) IsBlobOnly() bool
func (AccountType) IsManagedDisk ¶ added in v10.16.1
func (o AccountType) IsManagedDisk() bool
func (AccountType) OAuthManagedDisk ¶ added in v10.16.1
func (AccountType) OAuthManagedDisk() AccountType
func (AccountType) Premium ¶
func (AccountType) Premium() AccountType
func (AccountType) Standard ¶
func (AccountType) Standard() AccountType
func (AccountType) StdManagedDisk ¶ added in v10.16.1
func (AccountType) StdManagedDisk() 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, azcopyDir string) ([]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) GetMDConfig ¶ added in v10.16.1
func (gim GlobalInputManager) GetMDConfig(accountType AccountType) (*ManagedDiskConfig, error)
func (GlobalInputManager) GetOAuthCredential ¶ added in v10.16.1
func (gim GlobalInputManager) GetOAuthCredential(resource string) (*azcore.AccessToken, error)
func (GlobalInputManager) GetServicePrincipalAuth ¶ added in v10.15.0
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 ManagedDiskConfig ¶ added in v10.16.1
type ManagedDiskConfig struct { SubscriptionID string ResourceGroupName string DiskName string // contains filtered or unexported fields }
{"SubscriptionID":"","ResourceGroupName":"","DiskName":""}
func (*ManagedDiskConfig) GetAccess ¶ added in v10.16.1
func (config *ManagedDiskConfig) GetAccess() (*url.URL, error)
func (*ManagedDiskConfig) GetMDURL ¶ added in v10.16.1
func (config *ManagedDiskConfig) GetMDURL() (*url.URL, error)
func (*ManagedDiskConfig) RevokeAccess ¶ added in v10.16.1
func (config *ManagedDiskConfig) RevokeAccess() error
type ManagedDiskGetAccessResponse ¶ added in v10.16.1
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 (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 ¶ added in v10.11.0
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, publicAccess *container.PublicAccessType, accountType AccountType) (cc *container.Client, name string, rawURL string)
func (TestResourceFactory) CreateNewFileShare ¶
func (TestResourceFactory) CreateNewFileShare(c asserter, accountType AccountType) (fileShare *share.Client, name string, rawSasURL string)
func (TestResourceFactory) CreateNewFileShareSnapshot ¶
func (TestResourceFactory) CreateNewFileShareSnapshot(c asserter, fileShare *share.Client) (snapshotID string)
func (TestResourceFactory) GetBlobServiceURL ¶
func (TestResourceFactory) GetBlobServiceURL(accountType AccountType) *blobservice.Client
func (TestResourceFactory) GetBlobServiceURLWithSAS ¶
func (TestResourceFactory) GetBlobServiceURLWithSAS(c asserter, accountType AccountType) *blobservice.Client
func (TestResourceFactory) GetBlobURLWithSAS ¶
func (TestResourceFactory) GetBlobURLWithSAS(c asserter, accountType AccountType, containerName string, blobName string) *blob.Client
func (TestResourceFactory) GetContainerURLWithSAS ¶
func (TestResourceFactory) GetContainerURLWithSAS(c asserter, accountType AccountType, containerName string) *container.Client
func (TestResourceFactory) GetDatalakeServiceURL ¶
func (TestResourceFactory) GetDatalakeServiceURL(accountType AccountType) azbfs.ServiceURL
func (TestResourceFactory) GetFileServiceURL ¶
func (TestResourceFactory) GetFileServiceURL(accountType AccountType) *fileservice.Client
func (TestResourceFactory) GetFileShareURLWithSAS ¶ added in v10.21.0
func (TestResourceFactory) GetFileShareURLWithSAS(c asserter, accountType AccountType, containerName string) *share.Client
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, logDir string) (CopyOrSyncCommandResult, bool, error)
func (*TestRunner) ExecuteJobsShowCommand ¶
func (t *TestRunner) ExecuteJobsShowCommand(jobID common.JobID, azcopyDir string) (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 ¶
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 ¶
BasicPlusContent also validates the file content
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, expectFolders bool)
func (Validator) ValidateRemoveTransfer ¶
func (Validator) ValidateRemoveTransfer(c asserter, isSrcEncoded bool, isDstEncoded bool, sourcePrefix string, destinationPrefix string, expectedTransfers []*testObject, actualTransfers []common.TransferDetail, statusToTest common.TransferStatus)
Source Files ¶
- arm.go
- azcopyDebugHelper.go
- config.go
- declarativeHelpers.go
- declarativeResourceAdapters.go
- declarativeResourceManagers.go
- declarativeRunner.go
- declarativeScenario.go
- declarativeTestFiles.go
- declarativeWithPropertyProviders.go
- factory.go
- helpers.go
- managedDisks.go
- runner.go
- scenario_helpers.go
- scenario_os_helpers_for_linux.go
- validator.go
- zz_tests_to_add.go