func (s *cmdIntegrationSuite) TestSyncS2SWithSingleBlob(c *chk.C) {
	bsu := getBSU()
	srcContainerURL, srcContainerName := createNewContainer(c, bsu)
	dstContainerURL, dstContainerName := createNewContainer(c, bsu)
	defer deleteContainer(c, srcContainerURL)
	defer deleteContainer(c, dstContainerURL)

	for _, blobName := range []string{"singleblobisbest", "打麻将.txt", "%4509%4254$85140&"} {
		// set up the source container with a single blob
		blobList := []string{blobName}
		scenarioHelper{}.generateBlobsFromList(c, srcContainerURL, blobList, blockBlobDefaultData)

		// set up the destination container with the same single blob
		scenarioHelper{}.generateBlobsFromList(c, dstContainerURL, blobList, blockBlobDefaultData)

		// set up interceptor
		mockedRPC := interceptor{}
		Rpc = mockedRPC.intercept
		mockedRPC.init()

		// construct the raw input to simulate user input
		srcBlobURLWithSAS := scenarioHelper{}.getRawBlobURLWithSAS(c, srcContainerName, blobList[0])
		dstBlobURLWithSAS := scenarioHelper{}.getRawBlobURLWithSAS(c, dstContainerName, blobList[0])
		raw := getDefaultSyncRawInput(srcBlobURLWithSAS.String(), dstBlobURLWithSAS.String())

		// the destination was created after the source, so no sync should happen
		runSyncAndVerify(c, raw, func(err error) {
			c.Assert(err, chk.IsNil)

			// validate that the right number of transfers were scheduled
			c.Assert(len(mockedRPC.transfers), chk.Equals, 0)
		})

		// recreate the source blob to have a later last modified time
		scenarioHelper{}.generateBlobsFromList(c, srcContainerURL, blobList, blockBlobDefaultData)
		mockedRPC.reset()

		runSyncAndVerify(c, raw, func(err error) {
			c.Assert(err, chk.IsNil)
			validateS2SSyncTransfersAreScheduled(c, "", "", []string{""}, mockedRPC)
		})
	}
}
// regular blob->file sync
regular blob->file sync
// regular blob - > file sync
func (s *cmdIntegrationSuite) TestSyncS2SWithSingleBlob(c *chk.C) {
	bsu := getBSU()
	srcContainerURL, srcContainerName := createNewContainer(c, bsu)
	dstContainerURL, dstContainerName := createNewContainer(c, bsu)
	defer deleteContainer(c, srcContainerURL)
	defer deleteContainer(c, dstContainerURL)
	for _, blobName := range []string{"singleblobisbest", "打麻将.txt", "%4509%4254$85140&"} {
		blobList := []string{blobName}
		scenarioHelper{}.generateBlobsFromList(c, srcContainerURL, blobList, blockBlobDefaultData)
		scenarioHelper{}.generateBlobsFromList(c, dstContainerURL, blobList, blockBlobDefaultData)
		mockedRPC := interceptor{}
		Rpc = mockedRPC.intercept
		mockedRPC.init()
		srcBlobURLWithSAS := scenarioHelper{}.getRawBlobURLWithSAS(c, srcContainerName, blobList[0])
		dstBlobURLWithSAS := scenarioHelper{}.getRawBlobURLWithSAS(c, dstContainerName, blobList[0])
		raw := getDefaultSyncRawInput(srcBlobURLWithSAS.String(), dstBlobURLWithSAS.String())
		runSyncAndVerify(c, raw, func(err error) {
			c.Assert(err, chk.IsNil)
			c.Assert(len(mockedRPC.transfers), chk.Equals, 0)
		})
		scenarioHelper{}.generateBlobsFromList(c, srcContainerURL, blobList, blockBlobDefaultData)
		mockedRPC.reset()
		runSyncAndVerify(c, raw, func(err error) {
			c.Assert(err, chk.IsNil)
			validateS2SSyncTransfersAreScheduled(c, "", "", []string{""}, mockedRPC)
		})
	}
}
func ( s * cmdIntegrationSuite ) TestSyncS2SWithSingleBlob ( c * chk . C ) { bsu := getBSU ( ) srcContainerURL , srcContainerName := createNewContainer ( c , bsu ) dstContainerURL , dstContainerName := createNewContainer ( c , bsu ) defer deleteContainer ( c , srcContainerURL ) defer deleteContainer ( c , dstContainerURL ) for _ , blobName := range [ ] string { " " , " 5 0 % blobList := [ ] string { blobName } scenarioHelper { } . generateBlobsFromList ( c , srcContainerURL , blobList , blockBlobDefaultData ) scenarioHelper { } . generateBlobsFromList ( c , dstContainerURL , blobList , blockBlobDefaultData ) mockedRPC := interceptor { } Rpc = mockedRPC . intercept mockedRPC . init ( ) srcBlobURLWithSAS := scenarioHelper { } . getRawBlobURLWithSAS ( c , srcContainerName , blobList [ 0 ] ) dstBlobURLWithSAS := scenarioHelper { } . getRawBlobURLWithSAS ( c , dstContainerName , blobList [ 0 ] ) raw := getDefaultSyncRawInput ( srcBlobURLWithSAS . String ( ) , dstBlobURLWithSAS . String ( ) ) runSyncAndVerify ( c , raw , func ( err error ) { c . Assert ( err , chk . IsNil ) c . Assert ( len ( mockedRPC . transfers ) , chk . Equals , 0 ) } ) scenarioHelper { } . generateBlobsFromList ( c , srcContainerURL , blobList , blockBlobDefaultData ) mockedRPC . reset ( ) runSyncAndVerify ( c , raw , func ( err error ) { c . Assert ( err , chk . IsNil ) validateS2SSyncTransfersAreScheduled ( c , " " , " " , [ ] string { " " } , mockedRPC ) } ) } }
regular blob->file sync
regular blob - > file sync
// set up the source container with a single blob // set up the destination container with the same single blob // set up interceptor // construct the raw input to simulate user input // the destination was created after the source, so no sync should happen // validate that the right number of transfers were scheduled // recreate the source blob to have a later last modified time