Skip to content

Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions AzurePowershell.Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
</Target>

<!-- Run the scenario tests -->
<Target Name="ScenarioTest" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="ScenarioTest" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running scenario tests..." />
<MSBuild Targets="InvokeMSTest"
Properties="_testAssembly=$(ScenarioTestDebug);_testSettings=$(TestSettings);_testFilter=$(ScenarioTestFilter);_testResult=$(TestOutputDirectory)\ScenarioTestDebug.trx"
Expand Down Expand Up @@ -275,7 +275,7 @@
IncludeTraits="$(XUnitIncludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
</Target>

<Target Name="RunOneSDKCIT" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="RunOneSDKCIT" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running CIT Scenario tests..." />
<Delete Files="$(TestOutputDirectory)\RunOneSDKCITDebug.trx" />
<Exec
Expand All @@ -284,47 +284,47 @@
</Target>

<!-- Run the AzureRT tests -->
<Target Name="AzureRTBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTBVTs" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT BVT tests..." />
<Delete Files="$(TestOutputDirectory)\RTBVTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:BVT /resultsfile:$(TestOutputDirectory)\RTBVTDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTOne" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTOne" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running a specific tests..." />
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /test:$(TestName) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTRepeat" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTRepeat" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running a specific tests..." />
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
<Exec
Command="for /l %%x in (1, 1, $(RepeatTimes)) do MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /test:$(TestName) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug%%x.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTMulti" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTMulti" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running tests:" />
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) $(TestParams) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTAll" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTAll" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /category:$(AzureRTAllTestFilter) /resultsfile:$(TestOutputDirectory)\RTDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTAllFast" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTAllFast" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />

<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
Expand All @@ -337,7 +337,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTSeq" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTSeq" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />

<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
Expand All @@ -346,7 +346,7 @@
ContinueOnError="true" />
</Target>

<Target Name="AzureRTNetwork" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTNetwork" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />

<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
Expand All @@ -355,7 +355,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTUploadSeq" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTUploadSeq" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />

<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
Expand All @@ -364,7 +364,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTPar" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTPar" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />

<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
Expand All @@ -373,7 +373,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTFunctional" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTFunctional" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT Functional tests..." />

<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
Expand All @@ -382,7 +382,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTScenario" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTScenario" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT Scenario tests..." />

<Delete Files="$(TestOutputDirectory)\RTScenarioDebug.trx" />
Expand All @@ -391,7 +391,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTAllPreview" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTAllPreview" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTAddVhdDebug.trx" />
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
Expand All @@ -403,23 +403,23 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTPreview" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTPreview" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTPreviewDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:Preview /resultsfile:$(TestOutputDirectory)\RTPreviewDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTCleanUp" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTCleanUp" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT clean up tests..." />
<Delete Files="$(TestOutputDirectory)\RTCleanUpDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:AzureRTCleanUp /resultsfile:$(TestOutputDirectory)\RTCleanUpDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="ComputeCodeCoverage" DependsOnTargets="ForceRestorePackages;Clean;BuildDebug">
<Target Name="ComputeCodeCoverage" DependsOnTargets="RestoreNugetPackages;Clean;Build">
<Message Importance="high" Text="Gathering Code Coverage data from Compute tests..." />
<Delete Files="Project.covarage" />
<Exec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,15 @@
<Compile Include="Models\PSVirtualMachineSize.cs" />
<Compile Include="Common\LocationStringExtensions.cs" />
<Compile Include="Models\UploadParameters.cs" />
<Compile Include="Models\VhdDownloadContext.cs" />
<Compile Include="Models\VhdDownloaderModel.cs" />
<Compile Include="Models\VhdUploadContext.cs" />
<Compile Include="Models\VhdUploaderModel.cs" />
<Compile Include="RemoteDesktop\VirtualMachineRemoteDesktopBaseCmdlet.cs" />
<Compile Include="RemoteDesktop\GetAzureRemoteDesktopFileCommand.cs" />
<Compile Include="StorageServices\AddAzureVhdCommand.cs" />
<Compile Include="StorageServices\CloudPageBlobObjectFactory.cs" />
<Compile Include="StorageServices\SaveAzureVhdCommand.cs" />
<Compile Include="StorageServices\StorageCredentialsFactory.cs" />
<Compile Include="Usage\GetAzureVMUsageCommand.cs" />
<Compile Include="Usage\VirtualMachineUsageBaseCmdlet.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static class ValidateSetValues
{
public const string ReadOnly = "ReadOnly";
public const string ReadWrite = "ReadWrite";
public const string None = "None";
}

public static class ProfileNouns
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.IO;

namespace Microsoft.Azure.Commands.Compute.Models
{
public class VhdDownloadContext
{
public FileInfo LocalFilePath { get; set; }
public Uri Source { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.WindowsAzure.Commands.Sync;
using Microsoft.WindowsAzure.Commands.Sync.Download;
using System.IO;

namespace Microsoft.Azure.Commands.Compute.Models
{
public class VhdDownloaderModel
{
public static VhdDownloadContext Download(DownloaderParameters downloadParameters, ComputeClientBaseCmdlet cmdlet)
{
Program.SyncOutput = new PSSyncOutputEvents(cmdlet);

downloadParameters.ProgressDownloadComplete = Program.SyncOutput.ProgressDownloadComplete;
downloadParameters.ProgressDownloadStatus = Program.SyncOutput.ProgressDownloadStatus;

var downloader = new Downloader(downloadParameters);
downloader.Download();

return new VhdDownloadContext
{
LocalFilePath = new FileInfo(downloadParameters.LocalFilePath),
Source = downloadParameters.BlobUri.Uri
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public UploadParameters ValidateParameters()
}
}

var storageCredentialsFactory = CreateStorageCredentialsFactory(destinationUri);
var storageCredentialsFactory = CreateStorageCredentialsFactory();

PathIntrinsics currentPath = SessionState.Path;
var filePath = new FileInfo(currentPath.GetUnresolvedProviderPathFromPSPath(LocalFilePath.ToString()));
Expand All @@ -147,7 +147,7 @@ public UploadParameters ValidateParameters()
return parameters;
}

private StorageCredentialsFactory CreateStorageCredentialsFactory(BlobUri destinationUri)
private StorageCredentialsFactory CreateStorageCredentialsFactory()
{
StorageCredentialsFactory storageCredentialsFactory;

Expand Down
Loading