|
12 | 12 | // limitations under the License.
|
13 | 13 | // ----------------------------------------------------------------------------------
|
14 | 14 |
|
| 15 | +using Microsoft.VisualStudio.TestTools.UnitTesting; |
| 16 | +using Microsoft.WindowsAzure.Commands.ServiceManagement.Test.Properties; |
| 17 | +using Microsoft.WindowsAzure.Commands.Storage.Common; |
| 18 | +using Microsoft.WindowsAzure.Storage.Auth; |
| 19 | +using Microsoft.WindowsAzure.Storage.Blob; |
15 | 20 | using System;
|
16 | 21 | using System.Collections.Generic;
|
17 | 22 | using System.Collections.Specialized;
|
18 | 23 | using System.Diagnostics;
|
19 | 24 | using System.IO;
|
20 |
| -using Microsoft.VisualStudio.TestTools.UnitTesting; |
21 |
| -using Microsoft.WindowsAzure.Commands.ServiceManagement.Test.Properties; |
22 |
| -using Microsoft.WindowsAzure.Storage.Auth; |
23 |
| -using Microsoft.WindowsAzure.Storage.Blob; |
| 25 | +using System.Management.Automation; |
24 | 26 |
|
25 | 27 | namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests
|
26 | 28 | {
|
@@ -263,25 +265,29 @@ public static void CopyTestData(string srcContainer, string srcBlob, string dest
|
263 | 265 | // Create a container
|
264 | 266 | try
|
265 | 267 | {
|
266 |
| - vmPowershellCmdlets.RunPSScript("Get-AzureStorageContainer -Name " + destContainer); |
| 268 | + vmPowershellCmdlets.RunPSScript(String.Format("{0}-{1} -Name {2}", |
| 269 | + VerbsCommon.Get, StorageNouns.Container, destContainer)); |
267 | 270 | }
|
268 | 271 | catch
|
269 | 272 | {
|
270 | 273 | // Create a container.
|
271 |
| - vmPowershellCmdlets.RunPSScript("New-AzureStorageContainer -Name " + destContainer); |
| 274 | + vmPowershellCmdlets.RunPSScript(String.Format("{0}-{1} -Name {2}", |
| 275 | + VerbsCommon.New, StorageNouns.Container, destContainer)); |
272 | 276 | }
|
273 | 277 |
|
274 | 278 | // Make SAS Uri for the source blob.
|
275 | 279 | string srcSasUri = Utilities.GenerateSasUri(CredentialHelper.CredentialBlobUriFormat, storageAccount, storageAccountKey, srcContainer, srcBlob);
|
276 | 280 |
|
277 | 281 | if (string.IsNullOrEmpty(destBlob))
|
278 | 282 | {
|
279 |
| - vmPowershellCmdlets.RunPSScript(string.Format("Start-AzureStorageBlobCopy -SrcContainer {0} -SrcBlob {1} -DestContainer {2} -Force", srcContainer, srcBlob, destContainer)); |
| 283 | + vmPowershellCmdlets.RunPSScript(string.Format("{0}-{1} -SrcContainer {2} -SrcBlob {3} -DestContainer {4} -Force", |
| 284 | + VerbsLifecycle.Start, StorageNouns.CopyBlob, srcContainer, srcBlob, destContainer)); |
280 | 285 | destBlob = srcBlob;
|
281 | 286 | }
|
282 | 287 | else
|
283 | 288 | {
|
284 |
| - vmPowershellCmdlets.RunPSScript(string.Format("Start-AzureStorageBlobCopy -SrcUri \"{0}\" -DestContainer {1} -DestBlob {2} -Force", srcSasUri, destContainer, destBlob)); |
| 289 | + vmPowershellCmdlets.RunPSScript(string.Format("{0}-{1} -SrcUri \"{2}\" -DestContainer {3} -DestBlob {4} -Force", |
| 290 | + VerbsLifecycle.Start, StorageNouns.CopyBlob, srcSasUri, destContainer, destBlob)); |
285 | 291 | }
|
286 | 292 |
|
287 | 293 | for (int i = 0; i < 60; i++)
|
|
0 commit comments