Skip to content

Add cmdlets for RemoteApp #206

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

Closed
wants to merge 55 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7c20e2c
Update Stream Analytics PowerShell To Use Latest SDK
atpham256 Feb 20, 2015
07830b6
Merge pull request #185 from atpham256/master
ogail Feb 21, 2015
3ef3a17
Initial version of the Azure RemoteApp PowerShell cmdlet
yadavbdev Feb 25, 2015
782014a
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yadavbdev Feb 25, 2015
64f6321
Changed to use the Context from Azure Authentication
yadavbdev Feb 25, 2015
28715bd
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yadavb Feb 25, 2015
fe60f9f
Adding RemoteApp projects in to the .sln
yadavb Feb 25, 2015
b8e838d
Updated RemoteApp project to use the public version of Azure RemoteAp…
yadavb Feb 25, 2015
e495a49
Merge branch 'using_public_sdk' into dev
yadavb Feb 25, 2015
2de5272
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yadavbdev Feb 26, 2015
07e643c
Upgrading to use Azure RemoteApp v1.0.7
yadavbdev Feb 26, 2015
0ec01db
Updated to use the Azure RemoteApp v1.0.7
yadavbdev Feb 27, 2015
b166d38
Merge branch 'dev' of https://github.com/yadavbdev/azure-powershell i…
xamarsinx Feb 27, 2015
35aa503
Fixing the CI build break
yadavbdev Feb 27, 2015
312f697
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yadavbdev Feb 27, 2015
09e51ec
Bug 1796479:OneSDK: Address feedback from Azure PS team
yadavbdev Feb 27, 2015
1f51213
Bug 1827560:*Get-AzureRemoteAppCollection should not show vnet if it …
relmer Feb 27, 2015
f19825b
Bug 1856319:$ Remove Get-AzureRemoteAppUploadScript
relmer Feb 27, 2015
5e53e38
Bug 1856290:Remove Get-AzureRemoteAppResetVpnSharedKey -- make Reset-…
yadavbdev Feb 27, 2015
3fe6eac
Bug 1856407:$Set-AzureRemoteAppCollection -- remove OU
relmer Feb 27, 2015
575a09b
Ignoring all the failing tests for now, will revisit later
yadavbdev Feb 27, 2015
97788a2
Merge branch 'bugfix' into dev
yadavbdev Feb 27, 2015
d48983c
Merge branch 'dev' of https://github.com/relmer/azure-powershell into…
yadavbdev Feb 27, 2015
c7f0c4d
Parameter help message updated to include wild card support.
yadavbdev Feb 27, 2015
ac94a29
Bug 1856505:$Vnet cmdlets: param should be VNetName, not VnetName.
relmer Feb 27, 2015
d0f46c3
Fixed the potential null ref issue
yadavbdev Feb 27, 2015
6f7ae0c
Merge branch 'dev' of https://github.com/yadavbdev/azure-powershell i…
xamarsinx Feb 27, 2015
a1e3ac5
Bug 1857745:New-AzureRemoteAppTemplateImage is not catching errors in…
xamarsinx Feb 27, 2015
88966d4
Bug 1856575:*Some cmdlets aren't showing all params in get-help
relmer Feb 27, 2015
d8de3f1
getting region from VNet
xamarsinx Feb 27, 2015
edd4405
adding Region in details
xamarsinx Feb 27, 2015
d84fb76
Merge branch 'dev' of https://github.com/yadavbdev/azure-powershell i…
relmer Feb 27, 2015
2f48d99
Merge branch 'dev' of https://github.com/relmer/azure-powershell into…
yadavbdev Feb 27, 2015
546b0e6
Bug 1856603:Add/Remove user should be a common cmdlet, not separate f…
yadavbdev Feb 27, 2015
d0aeed6
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yadavbdev Feb 27, 2015
4d22570
review comment
xamarsinx Feb 27, 2015
18d840e
Merge branch 'robdev' into dev
yadavbdev Feb 28, 2015
e7552e0
Merge branch 'dev' of https://github.com/Amarsi/azure-powershell into…
yadavbdev Feb 28, 2015
7717e38
Merged several fixes from Bob done in private repo
yadavbdev Feb 28, 2015
f8abc5e
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yadavbdev Feb 28, 2015
7bfabf1
Applying user principal validation pattern
yadavbdev Feb 28, 2015
bf59dfe
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yadavbdev Feb 28, 2015
99c224a
removing bad merge of files outside of RemoteApp project scope
yadavbdev Mar 1, 2015
e2d88d0
bad merge
yadavbdev Mar 1, 2015
0c39461
Revert "bad merge"
yadavbdev Mar 1, 2015
8c87894
Revert "removing bad merge of files outside of RemoteApp project scope"
yadavbdev Mar 1, 2015
699a7f0
Revert "Merge branch 'dev' of https://github.com/yadavbdev/azure-powe…
yadavb Mar 1, 2015
b8ae503
Merge branch 'dev' of https://github.com/yadavbdev/azure-powershell i…
yadavb Mar 1, 2015
48b8847
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
relmer Mar 2, 2015
5fe8009
Fix bogus moq version
relmer Mar 2, 2015
46b8c9c
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yadavb Mar 2, 2015
b5d2574
Add RemoteApp reference to Commands.Resources
relmer Mar 2, 2015
67557a4
Merge branch 'dev' of https://github.com/relmer/azure-powershell into…
yadavb Mar 2, 2015
895fab3
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
relmer Mar 2, 2015
1044e2e
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
Mar 2, 2015
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
15 changes: 14 additions & 1 deletion src/AzurePowershell.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8531411A-0137-4E27-9C5E-49E07C245048}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -165,6 +165,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Insights.Test", "R
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Websites", "ResourceManager\Websites\Commands.Websites\Commands.Websites.csproj", "{80A92297-7C92-456B-8EE7-9FB6CE30149D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RemoteApp.Test", "ServiceManagement\RemoteApp\Commands.RemoteApp.Tests\Commands.RemoteApp.Test.csproj", "{CA82D500-1940-4068-A076-D7A8AD459FB0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RemoteApp", "ServiceManagement\RemoteApp\Commands.RemoteApp\Commands.RemoteApp.csproj", "{492D2AF2-950B-4F2E-8079-8794305313FD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -403,6 +407,14 @@ Global
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.Build.0 = Release|Any CPU
{CA82D500-1940-4068-A076-D7A8AD459FB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CA82D500-1940-4068-A076-D7A8AD459FB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA82D500-1940-4068-A076-D7A8AD459FB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA82D500-1940-4068-A076-D7A8AD459FB0}.Release|Any CPU.Build.0 = Release|Any CPU
{492D2AF2-950B-4F2E-8079-8794305313FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{492D2AF2-950B-4F2E-8079-8794305313FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{492D2AF2-950B-4F2E-8079-8794305313FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{492D2AF2-950B-4F2E-8079-8794305313FD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -436,5 +448,6 @@ Global
{0FA676D5-1349-4086-B33F-65EC2CB7DA41} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{7E6683BE-ECFF-4709-89EB-1325E9E70512} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{469F20E0-9D40-41AD-94C3-B47AD15A4C00} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{CA82D500-1940-4068-A076-D7A8AD459FB0} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@
<Project>{c60342b1-47d3-4a0e-8081-9b97ce60b7af}</Project>
<Name>Commands.Profile</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\ServiceManagement\RemoteApp\Commands.RemoteApp\Commands.RemoteApp.csproj">
<Project>{492d2af2-950b-4f2e-8079-8794305313fd}</Project>
<Name>Commands.RemoteApp</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\ServiceManagement\StorSimple\Commands.StorSimple\Commands.StorSimple.csproj">
<Project>{11524d98-6c40-4091-a8e1-86463fee607c}</Project>
<Name>Commands.StorSimple</Name>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------


namespace Microsoft.Azure.Commands.Test.RemoteApp
{
using Common;
using Microsoft.Azure.Management.RemoteApp.Cmdlets;
using Microsoft.Azure.Management.RemoteApp.Models;
using System;
using System.Collections.Generic;
using System.Management.Automation;
using VisualStudio.TestTools.UnitTesting;

// Get-AzureRemoteAppCollectionUsageDetails, Get-AzureRemoteAppCollectionUsageSummary,
[TestClass]
public class RemoteAppCollectionTest : RemoteAppClientTest
{

[TestMethod]
public void GetAllCollections()
{
int countOfExpectedCollections = 0;
GetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<GetAzureRemoteAppCollection>();

// Setup the environment for testing this cmdlet
countOfExpectedCollections = MockObject.SetUpDefaultRemoteAppCollection(remoteAppManagementClientMock, collectionName);
mockCmdlet.ResetPipelines();

Log("Calling Get-AzureRemoteAppCollection which should have {0} collections.", countOfExpectedCollections);

mockCmdlet.ExecuteCmdlet();
if (mockCmdlet.runTime().ErrorStream.Count != 0)
{
Assert.Fail(
String.Format("Get-AzureRemoteAppCollection returned the following error {0}.",
mockCmdlet.runTime().ErrorStream[0].Exception.Message
)
);
}

List<Collection> collections = MockObject.ConvertList<Collection>(mockCmdlet.runTime().OutputPipeline);
Assert.IsNotNull(collections);

Assert.IsTrue(collections.Count == countOfExpectedCollections,
String.Format("The expected number of collections returned {0} does not match the actual {1}.",
countOfExpectedCollections,
collections.Count
)
);

Assert.IsTrue(MockObject.HasExpectedResults<Collection>(collections, MockObject.ContainsExpectedCollection),
"The actual result does not match the expected."
);

Log("The test for Get-AzureRemoteAppCollection with {0} collections completed successfully", countOfExpectedCollections);
}


[TestMethod]
public void GetCollectionsByName()
{
int countOfExpectedCollections = 1;
GetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<GetAzureRemoteAppCollection>();

// Required parameters for this test
mockCmdlet.CollectionName = collectionName;

// Setup the environment for testing this cmdlet
MockObject.SetUpDefaultRemoteAppCollectionByName(remoteAppManagementClientMock, collectionName);
mockCmdlet.ResetPipelines();

Log("Calling Get-AzureRemoteAppCollection to get this collection {0}.", mockCmdlet.CollectionName);

mockCmdlet.ExecuteCmdlet();

if (mockCmdlet.runTime().ErrorStream.Count != 0)
{
Assert.Fail(
String.Format("Get-AzureRemoteAppUser returned the following error {0}.",
mockCmdlet.runTime().ErrorStream[0].Exception.Message
)
);
}

List<Collection> collections = MockObject.ConvertList<Collection>(mockCmdlet.runTime().OutputPipeline);
Assert.IsNotNull(collections);

Assert.IsTrue(collections.Count == countOfExpectedCollections,
String.Format("The expected number of collections returned {0} does not match the actual {1}.",
countOfExpectedCollections,
collections.Count
)
);

Assert.IsTrue(MockObject.HasExpectedResults<Collection>(collections, MockObject.ContainsExpectedCollection),
"The actual result does not match the expected."
);

Log("The test for Get-AzureRemoteAppCollection with {0} collections completed successfully", countOfExpectedCollections);
}


[TestMethod]
[Ignore]
public void AddCollection()
{
List<TrackingResult> trackingIds = null;
int countOfExpectedCollections = 0;
NewAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<NewAzureRemoteAppCollection>();

// Required parameters for this test
mockCmdlet.CollectionName = collectionName;
mockCmdlet.Region = region;
mockCmdlet.BillingPlan = billingPlan;
mockCmdlet.ImageName = templateName;
mockCmdlet.Description = description;
mockCmdlet.CustomRdpProperty = customRDPString;

// Setup the environment for testing this cmdlet
countOfExpectedCollections = MockObject.SetUpDefaultRemoteAppCollectionCreate(remoteAppManagementClientMock, mockCmdlet.CollectionName, mockCmdlet.Region, mockCmdlet.BillingPlan, mockCmdlet.ImageName, mockCmdlet.Description, mockCmdlet.CustomRdpProperty, trackingId);
mockCmdlet.ResetPipelines();

mockCmdlet.ExecuteCmdlet();
if (mockCmdlet.runTime().ErrorStream.Count != 0)
{
Assert.Fail(
String.Format("New-AzureRemoteAppCollection returned the following error {0}",
mockCmdlet.runTime().ErrorStream[0].Exception.Message
)
);
}

trackingIds = MockObject.ConvertList<TrackingResult>(mockCmdlet.runTime().OutputPipeline);
Assert.IsNotNull(trackingIds);

Assert.IsTrue(trackingIds.Count == countOfExpectedCollections,
String.Format("The expected number of collections returned {0} does not match the actual {1}",
countOfExpectedCollections,
trackingIds.Count
)
);

Assert.IsTrue(MockObject.HasExpectedResults<TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId),
"The actual result does not match the expected."
);

Log("The test for New-AzureRemoteAppCollection completed successfully");
}

[TestMethod]
public void UpdateCollection()
{
List<TrackingResult> trackingIds = null;
int countOfExpectedCollections = 0;
UpdateAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<UpdateAzureRemoteAppCollection>();

// Required parameters for this test
mockCmdlet.CollectionName = collectionName;
mockCmdlet.ImageName = templateName;

// Setup the environment for testing this cmdlet
MockObject.SetUpDefaultRemoteAppCollectionByName(remoteAppManagementClientMock, mockCmdlet.CollectionName);
countOfExpectedCollections = MockObject.SetUpDefaultRemoteAppCollectionSet(remoteAppManagementClientMock, mockCmdlet.CollectionName, subscriptionId, String.Empty, mockCmdlet.ImageName, null, String.Empty, trackingId);
mockCmdlet.ResetPipelines();

mockCmdlet.ExecuteCmdlet();
if (mockCmdlet.runTime().ErrorStream.Count != 0)
{
Assert.Fail(
String.Format("New-AzureRemoteAppCollection returned the following error {0}",
mockCmdlet.runTime().ErrorStream[0].Exception.Message
)
);
}

trackingIds = MockObject.ConvertList<TrackingResult>(mockCmdlet.runTime().OutputPipeline);
Assert.IsNotNull(trackingIds);

Assert.IsTrue(trackingIds.Count == countOfExpectedCollections,
String.Format("The expected number of collections returned {0} does not match the actual {1}",
countOfExpectedCollections,
trackingIds.Count
)
);

Assert.IsTrue(MockObject.HasExpectedResults<TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId),
"The actual result does not match the expected."
);

Log("The test for Update-AzureRemoteAppCollection completed successfully");
}

[TestMethod]
public void SetCollection()
{
List<TrackingResult> trackingIds = null;
int countOfExpectedCollections = 0;
SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<SetAzureRemoteAppCollection>();

System.Security.SecureString password = new System.Security.SecureString();
password.AppendChar('p');

// Required parameters for this test
mockCmdlet.CollectionName = collectionName;
mockCmdlet.BillingPlan = billingPlan;
mockCmdlet.Credential = new PSCredential(@"MyDomain\Administrator", password);

// Setup the environment for testing this cmdlet
MockObject.SetUpDefaultRemoteAppCollectionByName(remoteAppManagementClientMock, mockCmdlet.CollectionName);
countOfExpectedCollections = MockObject.SetUpDefaultRemoteAppCollectionSet(remoteAppManagementClientMock, mockCmdlet.CollectionName, subscriptionId, mockCmdlet.BillingPlan, String.Empty, mockCmdlet.Credential, domainName, trackingId);
mockCmdlet.ResetPipelines();

mockCmdlet.ExecuteCmdlet();
if (mockCmdlet.runTime().ErrorStream.Count != 0)
{
Assert.Fail(
String.Format("New-AzureRemoteAppCollection returned the following error {0}",
mockCmdlet.runTime().ErrorStream[0].Exception.Message
)
);
}

trackingIds = MockObject.ConvertList<TrackingResult>(mockCmdlet.runTime().OutputPipeline);
Assert.IsNotNull(trackingIds);

Assert.IsTrue(trackingIds.Count == countOfExpectedCollections,
String.Format("The expected number of collections returned {0} does not match the actual {1}",
countOfExpectedCollections,
trackingIds.Count
)
);

Assert.IsTrue(MockObject.HasExpectedResults<TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId),
"The actual result does not match the expected."
);

Log("The test for New-AzureRemoteAppCollection completed successfully");
}

[TestMethod]
public void RemoveCollection()
{
List<TrackingResult> trackingIds = null;
RemoveAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<RemoveAzureRemoteAppCollection>();

// Required parameters for this test
mockCmdlet.CollectionName = collectionName;

// Setup the environment for testing this cmdlet
MockObject.SetUpDefaultRemoteAppCollectionByName(remoteAppManagementClientMock, collectionName);
MockObject.SetUpDefaultRemoteAppCollectionDelete(remoteAppManagementClientMock, mockCmdlet.CollectionName, trackingId);
mockCmdlet.ResetPipelines();

Log("Calling Remove-AzureRemoteAppCollection");

mockCmdlet.ExecuteCmdlet();
if (mockCmdlet.runTime().ErrorStream.Count != 0)
{
Assert.Fail(
String.Format("Remove-AzureRemoteAppCollection returned the following error {0}",
mockCmdlet.runTime().ErrorStream[0].Exception.Message
)
);
}

trackingIds = MockObject.ConvertList<TrackingResult>(mockCmdlet.runTime().OutputPipeline);
Assert.IsNotNull(trackingIds);

Assert.IsTrue(MockObject.HasExpectedResults<TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId),
"The actual result does not match the expected."
);

Log("The test for Remove-AzureRemoteAppCollection completed successfully");
}

[TestMethod]
[Ignore]
public void GetRegionList()
{
List<Region> regionList = null;
List<string> regions = null;
GetAzureRemoteAppLocation mockCmdlet = SetUpTestCommon<GetAzureRemoteAppLocation>();

// Setup the environment for testing this cmdlet
MockObject.SetUpDefaultRemoteAppRegionList(remoteAppManagementClientMock);
mockCmdlet.ResetPipelines();

Log("Calling Get-AzureRemoteAppRegionList");

mockCmdlet.ExecuteCmdlet();
if (mockCmdlet.runTime().ErrorStream.Count != 0)
{
Assert.Fail(
String.Format("Get-AzureRemoteAppRegionList returned the following error {0}.",
mockCmdlet.runTime().ErrorStream[0].Exception.Message
)
);
}

Assert.IsNotNull(regionList);
regionList = MockObject.ConvertList<Region>(mockCmdlet.runTime().OutputPipeline);

Assert.IsTrue(MockObject.HasExpectedResults<string>(regions, MockObject.ContainsExpectedRegion), // This is expecting a List<string> instead of LocalModels.RegionList
"The actual result does not match the expected."
);

Log("The test for Get-AzureRemoteAppRegionList");
}

}
}
Loading