-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail on File to Blob OAuth early since service does not support it yet (
- Loading branch information
1 parent
4ab5733
commit d02fa56
Showing
6 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package e2etest | ||
|
||
import ( | ||
"fmt" | ||
"github.com/Azure/azure-storage-azcopy/v10/common" | ||
) | ||
|
||
func init() { | ||
suiteManager.RegisterSuite(&FileOAuthTestSuite{}) | ||
} | ||
|
||
type FileOAuthTestSuite struct{} | ||
|
||
func (s *FileOAuthTestSuite) Scenario_FileBlobOAuthError(svm *ScenarioVariationManager) { | ||
azCopyVerb := ResolveVariation(svm, []AzCopyVerb{AzCopyVerbCopy, AzCopyVerbSync}) // Calculate verb early to create the destination object early | ||
|
||
srcContainer := CreateResource[ContainerResourceManager](svm, GetRootResource(svm, common.ELocation.File()), ResourceDefinitionContainer{}) | ||
dstContainer := CreateResource[ContainerResourceManager](svm, GetRootResource(svm, common.ELocation.Blob()), ResourceDefinitionContainer{}) | ||
|
||
dstAuth := ResolveVariation(svm, []ExplicitCredentialTypes{EExplicitCredentialType.SASToken(), EExplicitCredentialType.OAuth()}) | ||
|
||
stdout, _ := RunAzCopy( | ||
svm, | ||
AzCopyCommand{ | ||
Verb: azCopyVerb, | ||
Targets: []ResourceManager{ | ||
TryApplySpecificAuthType(srcContainer, EExplicitCredentialType.OAuth(), svm, CreateAzCopyTargetOptions{}), | ||
TryApplySpecificAuthType(dstContainer, dstAuth, svm, CreateAzCopyTargetOptions{}), | ||
}, | ||
Flags: CopyFlags{ | ||
CopySyncCommonFlags: CopySyncCommonFlags{ | ||
Recursive: pointerTo(true), | ||
}, | ||
}, | ||
ShouldFail: true, | ||
}) | ||
|
||
ValidateErrorOutput(svm, stdout, fmt.Sprintf("S2S %s from Azure File authenticated with Azure AD to Blob/BlobFS is not supported", azCopyVerb)) | ||
} |