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

	// set up the source container with numerous blobs
	blobList := scenarioHelper{}.generateCommonRemoteScenarioForBlob(c, srcContainerURL, "")
	c.Assert(len(blobList), chk.Not(chk.Equals), 0)

	// set up the destination container with a single blob
	singleBlobName := "single"
	scenarioHelper{}.generateBlobsFromList(c, dstContainerURL, []string{singleBlobName}, blockBlobDefaultData)

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

	// construct the raw input to simulate user input
	srcContainerURLWithSAS := scenarioHelper{}.getRawContainerURLWithSAS(c, srcContainerName)
	dstBlobURLWithSAS := scenarioHelper{}.getRawBlobURLWithSAS(c, dstContainerName, singleBlobName)
	raw := getDefaultSyncRawInput(srcContainerURLWithSAS.String(), dstBlobURLWithSAS.String())

	// type mismatch, we should get an error
	runSyncAndVerify(c, raw, func(err error) {
		c.Assert(err, chk.NotNil)

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

	// reverse the source and destination
	raw = getDefaultSyncRawInput(dstBlobURLWithSAS.String(), srcContainerURLWithSAS.String())

	// type mismatch again, we should also get an error
	runSyncAndVerify(c, raw, func(err error) {
		c.Assert(err, chk.NotNil)

		// validate that the right number of transfers were scheduled
		c.Assert(len(mockedRPC.transfers), chk.Equals, 0)
	})
}
// there is a type mismatch between the source and destination
there is a type mismatch between the source and destination
// there is a type mismatch between the source and destination
func (s *cmdIntegrationSuite) TestSyncS2SMismatchContainerAndBlob(c *chk.C) {
	bsu := getBSU()
	srcContainerURL, srcContainerName := createNewContainer(c, bsu)
	dstContainerURL, dstContainerName := createNewContainer(c, bsu)
	defer deleteContainer(c, srcContainerURL)
	defer deleteContainer(c, dstContainerURL)
	blobList := scenarioHelper{}.generateCommonRemoteScenarioForBlob(c, srcContainerURL, "")
	c.Assert(len(blobList), chk.Not(chk.Equals), 0)
	singleBlobName := "single"
	scenarioHelper{}.generateBlobsFromList(c, dstContainerURL, []string{singleBlobName}, blockBlobDefaultData)
	mockedRPC := interceptor{}
	Rpc = mockedRPC.intercept
	mockedRPC.init()
	srcContainerURLWithSAS := scenarioHelper{}.getRawContainerURLWithSAS(c, srcContainerName)
	dstBlobURLWithSAS := scenarioHelper{}.getRawBlobURLWithSAS(c, dstContainerName, singleBlobName)
	raw := getDefaultSyncRawInput(srcContainerURLWithSAS.String(), dstBlobURLWithSAS.String())
	runSyncAndVerify(c, raw, func(err error) {
		c.Assert(err, chk.NotNil)
		c.Assert(len(mockedRPC.transfers), chk.Equals, 0)
	})
	raw = getDefaultSyncRawInput(dstBlobURLWithSAS.String(), srcContainerURLWithSAS.String())
	runSyncAndVerify(c, raw, func(err error) {
		c.Assert(err, chk.NotNil)
		c.Assert(len(mockedRPC.transfers), chk.Equals, 0)
	})
}
func ( s * cmdIntegrationSuite ) TestSyncS2SMismatchContainerAndBlob ( c * chk . C ) { bsu := getBSU ( ) srcContainerURL , srcContainerName := createNewContainer ( c , bsu ) dstContainerURL , dstContainerName := createNewContainer ( c , bsu ) defer deleteContainer ( c , srcContainerURL ) defer deleteContainer ( c , dstContainerURL ) blobList := scenarioHelper { } . generateCommonRemoteScenarioForBlob ( c , srcContainerURL , " " ) c . Assert ( len ( blobList ) , chk . Not ( chk . Equals ) , 0 ) singleBlobName := " " scenarioHelper { } . generateBlobsFromList ( c , dstContainerURL , [ ] string { singleBlobName } , blockBlobDefaultData ) mockedRPC := interceptor { } Rpc = mockedRPC . intercept mockedRPC . init ( ) srcContainerURLWithSAS := scenarioHelper { } . getRawContainerURLWithSAS ( c , srcContainerName ) dstBlobURLWithSAS := scenarioHelper { } . getRawBlobURLWithSAS ( c , dstContainerName , singleBlobName ) raw := getDefaultSyncRawInput ( srcContainerURLWithSAS . String ( ) , dstBlobURLWithSAS . String ( ) ) runSyncAndVerify ( c , raw , func ( err error ) { c . Assert ( err , chk . NotNil ) c . Assert ( len ( mockedRPC . transfers ) , chk . Equals , 0 ) } ) raw = getDefaultSyncRawInput ( dstBlobURLWithSAS . String ( ) , srcContainerURLWithSAS . String ( ) ) runSyncAndVerify ( c , raw , func ( err error ) { c . Assert ( err , chk . NotNil ) c . Assert ( len ( mockedRPC . transfers ) , chk . Equals , 0 ) } ) }
there is a type mismatch between the source and destination
there is a type mismatch between the source and destination
// set up the source container with numerous blobs // set up the destination container with a single blob // set up interceptor // construct the raw input to simulate user input // type mismatch, we should get an error // validate that the right number of transfers were scheduled // reverse the source and destination // type mismatch again, we should also get an error // validate that the right number of transfers were scheduled