@@ -561,28 +561,22 @@ func (s *FileTestSuite) Scenario_UploadFilesWithQuota(svm *ScenarioVariationMana
561
561
svm .Assert ("Quota is 1GB" , Equal {Deep : true },
562
562
DerefOrZero (shareResource .GetProperties (svm ).FileContainerProperties .Quota ), int32 (1 ))
563
563
564
- fileNames := []string {"file_1.txt" , "file_2.txt" }
565
-
566
- // Create src obj mapping
567
- srcObjs := make (ObjectResourceMappingFlat )
568
-
569
- // Create source files
570
- srcContainer := CreateResource [ContainerResourceManager ](svm , GetRootResource (svm , common .ELocation .Local ()),
571
- ResourceDefinitionContainer {Objects : srcObjs })
572
- for _ , fileName := range fileNames {
573
- body := NewRandomObjectContentContainer (int64 (1 ) * common .GigaByte )
574
- obj := ResourceDefinitionObject {
575
- ObjectName : & fileName ,
576
- Body : body ,
577
- Size : "1.00 GiB" ,
578
- }
579
- srcObjs [fileName ] = obj
580
- CreateResource [ObjectResourceManager ](svm , srcContainer , obj )
564
+ // Fill the share up
565
+ if ! svm .Dryrun () {
566
+ shareClient := shareResource .(* FileShareResourceManager ).internalClient
567
+ fileClient := shareClient .NewRootDirectoryClient ().NewFileClient ("big.txt" )
568
+ _ , err := fileClient .Create (ctx , 990 * common .MegaByte , nil )
569
+ svm .NoError ("Create large file" , err )
581
570
}
582
571
572
+ srcOverflowObject := CreateResource [ObjectResourceManager ](svm , GetRootResource (svm , common .ELocation .Local ()),
573
+ ResourceDefinitionObject {
574
+ Body : NewRandomObjectContentContainer (common .GigaByte ),
575
+ })
576
+
583
577
stdOut , _ := RunAzCopy (svm , AzCopyCommand {
584
578
Verb : AzCopyVerbCopy ,
585
- Targets : []ResourceManager {srcContainer , shareResource },
579
+ Targets : []ResourceManager {srcOverflowObject , shareResource },
586
580
Flags : CopyFlags {
587
581
CopySyncCommonFlags : CopySyncCommonFlags {
588
582
Recursive : pointerTo (true ),
@@ -595,7 +589,7 @@ func (s *FileTestSuite) Scenario_UploadFilesWithQuota(svm *ScenarioVariationMana
595
589
ValidateContainsError (svm , stdOut , []string {"Increase the file share quota and call Resume command." })
596
590
597
591
fileMap := shareResource .ListObjects (svm , "" , true )
598
- svm .Assert ("One file should be uploaded within the quota" , Equal {}, len (fileMap )- 1 , 1 ) // -1 to Account for root dir in fileMap
592
+ svm .Assert ("One file should be uploaded within the quota" , Equal {}, len (fileMap ), 1 ) // -1 to Account for root dir in fileMap
599
593
600
594
// Increase quota to fit all files
601
595
newQuota := int32 (2 )
@@ -609,5 +603,4 @@ func (s *FileTestSuite) Scenario_UploadFilesWithQuota(svm *ScenarioVariationMana
609
603
svm .Assert ("Quota should be updated" , Equal {},
610
604
DerefOrZero (shareResource .GetProperties (svm ).FileContainerProperties .Quota ),
611
605
newQuota )
612
-
613
606
}
0 commit comments