Skip to content

Commit

Permalink
restored not required changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dphulkar-msft committed Nov 26, 2024
1 parent 7c18c7e commit d719959
Showing 1 changed file with 2 additions and 58 deletions.
60 changes: 2 additions & 58 deletions e2etest/zt_newe2e_basic_functionality_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package e2etest

import (
"strconv"
"time"

blobsas "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/sas"
"github.com/Azure/azure-storage-azcopy/v10/common"
"strconv"
"time"
)

func init() {
Expand Down Expand Up @@ -485,58 +484,3 @@ func (s *BasicFunctionalitySuite) Scenario_TagsPermission(svm *ScenarioVariation

ValidateMessageOutput(svm, stdOut, "Authorization failed during an attempt to set tags, please ensure you have the appropriate Tags permission")
}

func (s *BasicFunctionalitySuite) Scenario_SingleFile_PanicCheck(svm *ScenarioVariationManager) {
azCopyVerb := ResolveVariation(svm, []AzCopyVerb{AzCopyVerbCopy, AzCopyVerbSync}) // Calculate verb early to create the destination object early
// Scale up from service to object
dstObj := CreateResource[ContainerResourceManager](svm, GetRootResource(svm, ResolveVariation(svm, []common.Location{common.ELocation.Local(), common.ELocation.Blob(), common.ELocation.File(), common.ELocation.BlobFS()})), ResourceDefinitionContainer{}).GetObject(svm, "test", common.EEntityType.File())
// The object must exist already if we're syncing.
if azCopyVerb == AzCopyVerbSync {
dstObj.Create(svm, NewZeroObjectContentContainer(0), ObjectProperties{})

if !svm.Dryrun() {
// Make sure the LMT is in the past
time.Sleep(time.Second * 10)
}
}

body := NewRandomObjectContentContainer(SizeFromString("10K"))
// Scale up from service to object
srcObj := CreateResource[ObjectResourceManager](svm, GetRootResource(svm, ResolveVariation(svm, []common.Location{common.ELocation.Local(), common.ELocation.Blob(), common.ELocation.File(), common.ELocation.BlobFS()})), ResourceDefinitionObject{
ObjectName: pointerTo("test"),
Body: body,
})

// no local->local
if srcObj.Location().IsLocal() && dstObj.Location().IsLocal() {
svm.InvalidateScenario()
return
}

sasOpts := GenericAccountSignatureValues{}
sasOpts.Permissions = (&blobsas.ContainerPermissions{
Read: true, Add: false, Create: false, Write: false, Delete: false, List: false,
}).String()

stdOut, _ := RunAzCopy(
svm,
AzCopyCommand{
Verb: azCopyVerb,
Targets: []ResourceManager{
TryApplySpecificAuthType(srcObj, EExplicitCredentialType.SASToken(), svm, CreateAzCopyTargetOptions{
SASTokenOptions: sasOpts,
}),
TryApplySpecificAuthType(dstObj, EExplicitCredentialType.SASToken(), svm, CreateAzCopyTargetOptions{
SASTokenOptions: sasOpts,
}),
},
Flags: CopyFlags{
CopySyncCommonFlags: CopySyncCommonFlags{
Recursive: pointerTo(true),
},
},
ShouldFail: true,
})
ValidateMessageOutput(svm, stdOut, "panic")

}

0 comments on commit d719959

Please sign in to comment.