Skip to content

Rdfe remote app #861

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 35 commits into from
Sep 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b095fb7
Merge branch 'master' of https://github.com/Azure/azure-powershell-pr
robertla Apr 10, 2015
4284699
Merge branch 'master' of https://github.com/Azure/azure-powershell
robertla Apr 10, 2015
e0f24ce
bug:1778355 Desktop Support/Add paging for SP
robertla Apr 13, 2015
1bd4cd8
bug:1778355 Desktop Support/Add paging for SP
robertla Apr 13, 2015
a90b9c7
Merge branch 'ChunkedSP' into CITest bad merge deleting file and merg…
robertla Apr 23, 2015
f4b2cbc
bug:1778355 Desktop Support/Add paging for SP
robertla Apr 23, 2015
b188115
Adding Check-In Test to ARA
robertla Apr 24, 2015
d52ef02
Adding Checkin Tests to Azure RemoteApp
robertla Apr 29, 2015
b4f2ab9
Adding Checkin Tests to Azure RemoteApp
robertla May 5, 2015
cff97c6
Adding Checkin Tests to Azure RemoteApp
robertla May 5, 2015
67c965f
Merge branch 'dev' of https://github.com/robertla/azure-powershell in…
robertla May 6, 2015
251e17d
Adding Checkin Tests to Azure RemoteApp
robertla May 6, 2015
aaf9c36
Adding Checkin Tests to Azure RemoteApp
robertla May 15, 2015
9da648c
Merging from Azure/Dev
robertla May 20, 2015
dd530ef
Backing out Paged User code
robertla May 28, 2015
2b8afa5
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
robertla Jun 1, 2015
371f96e
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
robertla Jun 8, 2015
0045bef
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
robertla Jul 12, 2015
7101f23
Removing AD requirement for VNets
robertla Jul 15, 2015
393b299
Merge branch 'master' of https://github.com/Azure/azure-powershell in…
robertla Aug 4, 2015
8e57dd8
Deprecating VNets
robertla Aug 6, 2015
41bf97c
Updating code based off of the review
robertla Aug 10, 2015
edbc5c8
Updating code based off of the review
robertla Aug 10, 2015
c80ee5d
Merge branch 'RemoteApp' of https://github.com/robertla/azure-powersh…
robertla Aug 10, 2015
6c18a04
Merge branch 'master' of https://github.com/Azure/azure-powershell
robertla Aug 10, 2015
a108bd8
Merge branch 'RemoteApp' of https://github.com/robertla/azure-powersh…
robertla Aug 10, 2015
e7ac8cb
Merge branch 'master' of https://github.com/Azure/azure-powershell
robertla Aug 17, 2015
24875b7
Removing Scenario test
robertla Aug 17, 2015
72b8faf
Merge branch 'master' of https://github.com/Azure/azure-powershell
robertla Aug 19, 2015
275f5ca
Merge branch 'master' of https://github.com/Azure/azure-powershell
robertla Aug 24, 2015
54b8681
Merge branch 'master' of https://github.com/Azure/azure-powershell in…
robertla Aug 28, 2015
fb38b57
Merge branch 'master' of https://github.com/robertla/azure-powershell
robertla Sep 1, 2015
16fca57
Merge branch 'master' into RDFE_RemoteApp
robertla Sep 1, 2015
af71940
Merge branch 'master' into RDFE_RemoteApp
robertla Sep 1, 2015
8935f84
Merge branch 'RDFE_RemoteApp' of https://github.com/robertla/azure-po…
robertla Sep 4, 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
4 changes: 4 additions & 0 deletions src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,10 @@
<Project>{58a78f29-8c0c-4a5e-893e-3953c0f29c8a}</Project>
<Name>Commands.ServiceManagement.Test</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\Services\Commands.Test.Utilities\Commands.Test.Utilities.csproj">
<Project>{bc420543-c04e-4bf3-96e1-cd81b823bdd7}</Project>
<Name>Commands.Test.Utilities</Name>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
 Set-Variable -Name VerbosePreference -Value Continue

function PollingInterval()
{
if ($env:AZURE_TEST_MODE -eq 'Playback')
{
$pollingIntervalSecs = 5
}
else
{
$pollingIntervalSecs = 60 * 5
}
$pollingIntervalSecs
}

function Assert([ScriptBlock] $Condition)
{
if ((& $Condition) -eq $false)
{
throw "Assertion Failed $($Condition.ToString()): $(Get-PSCallStack | Out-String)"
}
}

<#
This will pick a location, image, billing plan and create a ARA App collection and returns the collection name.
#>
function CreateCloudCollection([string] $Collection)
{

Write-Verbose "Entering $($MyInvocation.MyCommand.name)"
[PSObject[]] $locationList = Get-AzureRemoteAppLocation | % Name
Assert -Condition {$locationList -ne $null -or $locationList.Count -lt 1}

[PSObject[]] $templateImageList = Get-AzureRemoteAppTemplateImage | ? {$_.Type -eq 'Platform' -and $_.OfficeType -ne 'Office365'}
Assert -Condition {$templateImageList -ne $null -or $templateImageList.Count -lt 1}

$templateImage = $null
$locCounter = 0
$imageCounter = 0
$found = $false
do
{
$location = $locationList[$locCounter]
do
{
$templateImage = $templateImageList[$imageCounter]
if ($templateImage.RegionList -contains $location)
{
$found = $true
}

$imageCounter++
} while ($imageCounter -lt $templateImageList.Count -and -not $found)

$locCounter++
} while ($locCounter -lt $locationList.Count -and -not $found)

Assert -Condition {$found}

$billingPlans = Get-AzureRemoteAppPlan | % Name
$billingPlan = $billingPlans[0]
Assert -Condition {-not [String]::IsNullOrWhiteSpace($billingPlan)}

Write-Verbose "New-AzureRemoteAppCollection -CollectionName $Collection -ImageName $($templateImage.Name) -Plan $billingPlan -Location $location -Description 'Test Collection'"
$trackIdCollection = New-AzureRemoteAppCollection -CollectionName $Collection -ImageName $templateImage.Name -Plan $billingPlan -Location $location -Description 'Test Collection' -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}

do
{
Write-Verbose "Waiting current time: $(Get-Date)"
sleep -Seconds (PollingInterval)

$collectionState = Get-AzureRemoteAppOperationResult -TrackingId $trackIdCollection.TrackingId -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}

Write-Verbose "Collection state: $($collectionState.Status)"
} while ($collectionState.Status -eq 'InProgress' -or $collectionState.Status -eq 'Pending')

Assert -Condition {$collectionState.Status -eq 'Success'}
Write-Verbose "$($MyInvocation.MyCommand.name) succsssfully created this collection $Collection"
}


<#
This will pick a 5 applications to publish, verifies that they've been published and returns the Publishing Info.
#>
function PublishRemoteApplications([string] $Collection)
{
Write-Verbose "Entering $($MyInvocation.MyCommand.name)"
$numOfApps = 5
$availablePrograms = Get-AzureRemoteAppStartMenuProgram $Collection -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}

Assert({$availablePrograms.Count -ge $numOfApps})

$currentPrograms = Get-AzureRemoteAppProgram -CollectionName $Collection -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}

$programsToPublish = $availablePrograms[0..2]
$programsToPublish += $availablePrograms[$($availablePrograms.Count-2)..$($availablePrograms.Count-1)]
Assert({$programsToPublish.Count -eq $numOfApps})
$applications = $programsToPublish | % {
Publish-AzureRemoteAppProgram -CollectionName $Collection -StartMenuAppId $_.StartMenuAppId -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}
}

$publishedPrograms = Get-AzureRemoteAppProgram -CollectionName $Collection -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}

Assert -Condition {($publishedPrograms.Count - $currentPrograms.Count) -eq $numOfApps}

$applications | % {Write-Verbose "($([IO.FileInfo]$_.ApplicationVirtualPath))"}
Write-Verbose "$($MyInvocation.MyCommand.name) completed succsssfully"

$applications
}


<#
This will pick a add the given users to the collection.
#>
function AddRemoteAppUsers([string] $Collection, [string[]] $msaUsers)
{
Write-Verbose "Entering $($MyInvocation.MyCommand.name)"
$previousUsers = Get-AzureRemoteAppUser -CollectionName $Collection -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}

$msaUsers | % {
Add-AzureRemoteAppUser -CollectionName $Collection -Type MicrosoftAccount -UserUpn $_ -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}
}

$currentUsers = Get-AzureRemoteAppUser -CollectionName $Collection -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}

Assert -Condition {($previousUsers.Count + $msaUsers.Count) -eq $currentUsers.Count}
Write-Verbose "$($MyInvocation.MyCommand.name) completed succsssfully"

$currentUsers | % {Write-Verbose "Username: $($_.Name),and Type: $($_.UserIdType)" }
}

<#
This will remove the given users from the collection.
#>
function RemoveRemoteAppUsers([string] $Collection, [string[]] $msaUsers)
{
Write-Verbose "Entering $($MyInvocation.MyCommand.name)"
$previousUsers = Get-AzureRemoteAppUser -CollectionName $Collection -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}

$msaUsers | % {
Remove-AzureRemoteAppUser -CollectionName $Collection -Type MicrosoftAccount -UserUpn $_ -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}
}

$currentUsers = Get-AzureRemoteAppUser -CollectionName $Collection -ErrorAction SilentlyContinue -ErrorVariable er
Assert -Condition {$currentUsers -eq $null}
Write-Verbose "$($MyInvocation.MyCommand.name) completed succsssfully"
}

<#
This will unpublish the specified applications from the collection.
#>
function UnpublishRemoteApplications([string] $Collection, [string[]] $applications)
{
Write-Verbose "Entering $($MyInvocation.MyCommand.name)"
$applications | % {
Unpublish-AzureRemoteAppProgram -CollectionName $Collection -Alias $_ -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}
}

Sleep 60 # seconds
$remainingApps = Get-AzureRemoteAppProgram $Collection | % Alias

$failedToUnpublish = $remainingApps | ? {$applications -contains $_}
Assert -Condition {$failedToUnpublish -eq $null}
Write-Verbose "$($MyInvocation.MyCommand.name) completed succsssfully"
}

<#
This delete the collection
#>
function DeleteRemoteAppCollection([string] $Collection)
{
Write-Verbose "Entering $($MyInvocation.MyCommand.name)"
$trackIdCollection = Remove-AzureRemoteAppCollection -CollectionName $Collection

do
{
Write-Verbose "Waiting current time: $(Get-Date)"
sleep -Seconds (PollingInterval)

$collectionState = Get-AzureRemoteAppOperationResult -TrackingId $trackIdCollection.TrackingId -ErrorAction SilentlyContinue -ErrorVariable er
if ($? -eq $false)
{
throw $er
}

Write-Verbose "Collection state: $($collectionState.Status)"
} while ($collectionState.Status -eq 'InProgress' -or $collectionState.Status -eq 'Pending')

Assert -Condition {$collectionState.Status -eq 'Success'}
Write-Verbose "$($MyInvocation.MyCommand.name) completed succsssfully"
}


function TestRemoteAppEndToEnd()
{
$collection = 'CICollection'
$msaUsers = "[email protected]", "[email protected]", "[email protected]"

Write-Verbose "Starting current time: $(Get-Date)"
CreateCloudCollection $collection
$applications = PublishRemoteApplications $collection
AddRemoteAppUsers $collection $msaUsers
RemoveRemoteAppUsers $collection $msaUsers
UnpublishRemoteApplications $collection ($applications | % {$_.ApplicationAlias})
DeleteRemoteAppCollection $collection
Write-Verbose "Done current time: $(Get-Date)"
}
Loading