@@ -141,7 +141,7 @@ func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockWithAutoGeneratedCRC64()
141141 // _require.Equal(resp.RawResponse.StatusCode, 201)
142142
143143 // test append block with valid CRC64 value
144- readerToBody , body := testcommon .GetRandomDataAndReader ( 1024 )
144+ readerToBody , body := testcommon .GetDataAndReader ( testName , 1024 )
145145 contentCRC64 := crc64 .Checksum (body , shared .CRC64Table )
146146 appendBlockOptions := appendblob.AppendBlockOptions {
147147 TransactionalValidation : blob .TransferValidationTypeComputeCRC64 (),
@@ -163,7 +163,7 @@ func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockWithAutoGeneratedCRC64()
163163 _require .Equal ((* appendResp .Date ).IsZero (), false )
164164
165165 // test bad CRC64
166- readerToBody , body = testcommon .GetRandomDataAndReader ( 1024 )
166+ readerToBody , body = testcommon .GetDataAndReader ( testName , 1024 )
167167 badCRC64 := rand .Uint64 ()
168168 _ = body
169169 appendBlockOptions = appendblob.AppendBlockOptions {
@@ -176,7 +176,7 @@ func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockWithAutoGeneratedCRC64()
176176 testcommon .ValidateBlobErrorCode (_require , err , bloberror .CRC64Mismatch )
177177}
178178
179- func (s * AppendBlobUnrecordedTestsSuite ) TestAppendBlockWithMD5 () {
179+ func (s * AppendBlobRecordedTestsSuite ) TestAppendBlockWithMD5 () {
180180 _require := require .New (s .T ())
181181 testName := s .T ().Name ()
182182 svcClient , err := testcommon .GetServiceClient (s .T (), testcommon .TestAccountDefault , nil )
@@ -193,7 +193,7 @@ func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockWithMD5() {
193193 // _require.Equal(resp.RawResponse.StatusCode, 201)
194194
195195 // test append block with valid MD5 value
196- readerToBody , body := testcommon .GetRandomDataAndReader ( 1024 )
196+ readerToBody , body := testcommon .GetDataAndReader ( testName , 1024 )
197197 md5Value := md5 .Sum (body )
198198 _ = body
199199 contentMD5 := md5Value [:]
@@ -215,8 +215,8 @@ func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockWithMD5() {
215215 _require .Equal ((* appendResp .Date ).IsZero (), false )
216216
217217 // test append block with bad MD5 value
218- readerToBody , body = testcommon .GetRandomDataAndReader ( 1024 )
219- _ , badMD5 := testcommon .GetRandomDataAndReader ( 16 )
218+ readerToBody , body = testcommon .GetDataAndReader ( testName , 1024 )
219+ _ , badMD5 := testcommon .GetDataAndReader ( testName , 16 )
220220 _ = body
221221 appendBlockOptions = appendblob.AppendBlockOptions {
222222 TransactionalValidation : blob .TransferValidationTypeMD5 (badMD5 ),
@@ -239,7 +239,7 @@ func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockFromURL() {
239239
240240 //ctx := ctx
241241 contentSize := 4 * 1024 // 4KB
242- r , sourceData := testcommon .GetRandomDataAndReader ( contentSize )
242+ r , sourceData := testcommon .GetDataAndReader ( testName , contentSize )
243243 contentMD5 := md5 .Sum (sourceData )
244244 srcBlob := containerClient .NewAppendBlobClient (testcommon .GenerateBlobName ("appendsrc" ))
245245 destBlob := containerClient .NewAppendBlobClient (testcommon .GenerateBlobName ("appenddest" ))
@@ -321,7 +321,7 @@ func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockFromURLWithMD5() {
321321
322322 //ctx := ctx
323323 contentSize := 4 * 1024 // 4KB
324- r , sourceData := testcommon .GetRandomDataAndReader ( contentSize )
324+ r , sourceData := testcommon .GetDataAndReader ( testName , contentSize )
325325 contentMD5 := md5 .Sum (sourceData )
326326 srcBlob := containerClient .NewAppendBlobClient (testcommon .GenerateBlobName ("appendsrc" ))
327327 destBlob := containerClient .NewAppendBlobClient (testcommon .GenerateBlobName ("appenddest" ))
@@ -397,7 +397,7 @@ func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockFromURLWithMD5() {
397397 _require .Equal (destBuffer , sourceData )
398398
399399 // Test append block from URL with bad MD5 value
400- _ , badMD5 := testcommon .GetRandomDataAndReader ( 16 )
400+ _ , badMD5 := testcommon .GetDataAndReader ( testName , 16 )
401401 var badMD5Validator blob.SourceContentValidationTypeMD5 = badMD5 [:]
402402 appendBlockURLOptions = appendblob.AppendBlockFromURLOptions {
403403 Range : blob.HTTPRange {Offset : 0 , Count : count },
@@ -414,10 +414,6 @@ func (s *AppendBlobRecordedTestsSuite) TestAppendBlockFromURLCopySourceAuth() {
414414 svcClient , err := testcommon .GetServiceClient (s .T (), testcommon .TestAccountDefault , nil )
415415 _require .NoError (err )
416416
417- // Random seed for data generation
418- seed := int64 (crc64 .Checksum ([]byte (testName ), shared .CRC64Table ))
419- random := rand .New (rand .NewSource (seed ))
420-
421417 // Getting AAD Authentication
422418 cred , err := testcommon .GetGenericTokenCredential ()
423419 _require .NoError (err )
@@ -434,7 +430,7 @@ func (s *AppendBlobRecordedTestsSuite) TestAppendBlockFromURLCopySourceAuth() {
434430 _ , err = srcABClient .Create (context .Background (), nil )
435431 _require .Nil (err )
436432 contentSize := 4 * 1024 // 4KB
437- r , sourceData := testcommon .GetDataAndReader (random , contentSize )
433+ r , sourceData := testcommon .GetDataAndReader (testName , contentSize )
438434 _ , err = srcABClient .AppendBlock (context .Background (), streaming .NopCloser (r ), nil )
439435 _require .Nil (err )
440436 _ , err = destABClient .Create (context .Background (), nil )
@@ -465,10 +461,6 @@ func (s *AppendBlobRecordedTestsSuite) TestAppendBlockFromURLCopySourceAuthNegat
465461 svcClient , err := testcommon .GetServiceClient (s .T (), testcommon .TestAccountDefault , nil )
466462 _require .NoError (err )
467463
468- // Random seed for data generation
469- seed := int64 (crc64 .Checksum ([]byte (testName ), shared .CRC64Table ))
470- random := rand .New (rand .NewSource (seed ))
471-
472464 containerName := testcommon .GenerateContainerName (testName )
473465 containerClient := testcommon .CreateNewContainer (context .Background (), _require , containerName , svcClient )
474466 defer testcommon .DeleteContainer (context .Background (), _require , containerClient )
@@ -481,7 +473,7 @@ func (s *AppendBlobRecordedTestsSuite) TestAppendBlockFromURLCopySourceAuthNegat
481473 _ , err = srcABClient .Create (context .Background (), nil )
482474 _require .Nil (err )
483475 contentSize := 4 * 1024 // 4KB
484- r , _ := testcommon .GetDataAndReader (random , contentSize )
476+ r , _ := testcommon .GetDataAndReader (testName , contentSize )
485477 _ , err = srcABClient .AppendBlock (context .Background (), streaming .NopCloser (r ), nil )
486478 _require .Nil (err )
487479 _ , err = destABClient .Create (context .Background (), nil )
0 commit comments