Skip to content

Commit 9764f6e

Browse files
author
Ajit Navasare (MINDTREE LIMITED)
committed
PR review comments updated
1 parent a021621 commit 9764f6e

File tree

76 files changed

+634
-1790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+634
-1790
lines changed

AzurePowershell.Test.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
<XUnitTests Include=".\src\Common\Commands.Common.Authentication.Test\bin\Debug\Microsoft.Azure.Commands.Common.Authentication.Test.dll"/>
107107
<XUnitTests Include=".\src\ResourceManager\ServiceBus\Commands.ServiceBus.Test\bin\Debug\Microsoft.Azure.Commands.ServiceBus.Test.dll"/>
108108
<XUnitTests Include=".\src\ResourceManager\EventHub\Commands.EventHub.Test\bin\Debug\Microsoft.Azure.Commands.EventHubs.Test.dll"/>
109+
<XUnitTests Include=".\src\ResourceManager\Relay\Commands.Relay.Test\bin\Debug\Microsoft.Azure.Commands.Relay.Test.dll"/>
109110
<XUnitTests Include="@(AsmXUnitTests)"/>
110111
</ItemGroup>
111112
<ItemGroup Condition=" '$(scope)' == 'ServiceManagement' ">

src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/Relay/AzureRM.Relay.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ CLRVersion = '4.0'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '2.7.0'; })
54+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '2.8.0'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
# RequiredAssemblies = @()
@@ -75,7 +75,7 @@ FunctionsToExport = @()
7575
CmdletsToExport = 'New-AzureRmRelayNamespace', 'Get-AzureRmRelayNamespace','Set-AzureRmRelayNamespace', 'Remove-AzureRmRelayNamespace',
7676
'New-AzureRmWcfRelay', 'Get-AzureRmWcfRelay','Set-AzureRmWcfRelay','Remove-AzureRmWcfRelay',
7777
'New-AzureRmRelayHybridConnection', 'Get-AzureRmRelayHybridConnection','Set-AzureRmRelayHybridConnection','Remove-AzureRmRelayHybridConnection',
78-
'Test-AzureRmCheckNameAvailability','Get-AzureRmRelayOperation',
78+
'Test-AzureRmRelayName','Get-AzureRmRelayOperation',
7979
'New-AzureRmRelayKey', 'Get-AzureRmRelayKey',
8080
'New-AzureRmRelayAuthorizationRule', 'Get-AzureRmRelayAuthorizationRule','Set-AzureRmRelayAuthorizationRule', 'Remove-AzureRmRelayAuthorizationRule'
8181

@@ -101,7 +101,7 @@ PrivateData = @{
101101
PSData = @{
102102

103103
# Tags applied to this module. These help with module discovery in online galleries.
104-
Tags = 'Azure','ResourceManager','ARM','Relay'
104+
Tags = 'Azure','ResourceManager','ARM','Relay', 'ServiceBus'
105105

106106
# A URL to the license for this module.
107107
LicenseUri = 'https://raw.githubusercontent.com/Azure/azure-powershell/dev/LICENSE.txt'

src/ResourceManager/Relay/ChangeLog.md

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -19,66 +19,4 @@
1919
-->
2020
## Current Release
2121

22-
## Version 0.0.1
23-
* Adds commandlets for the Azure Relay
24-
25-
- New-AzureRmRelayNamespace
26-
- Adds a New Relay NameSpace in the existing Resource Group.
27-
- Get-AzureRmRelayNamespace
28-
- Gets Relay NameSpace/list of NameSpaces of existing Resource Group.
29-
- Set-AzureRmRelayNamespace
30-
- Updates properties of existing Relay NameSpace.
31-
- Remove-AzureRmRelayNamespace
32-
- Deletes the existing Relay NameSpace.
33-
- New-AzureRmRelayNamespaceAuthorizationRule
34-
- Adds a new AuthorizationRule to the existing Relay NameSpace.
35-
- Get-AzureRmRelayNamespaceAuthorizationRule
36-
- Gets AuthorizationRule / List of AuthorizationRules for the existing Relay NameSpace.
37-
- Set-AzureRmRelayNamespaceAuthorizationRule
38-
- Updates properties of existing AuthorizationRule of Relay NameSpace.
39-
- New-AzureRmRelayNamespaceKey
40-
- Generates a new Primary/Secondary Key for AuthorizationRule of existing Relay NameSpace.
41-
- Get-AzureRmRelayNamespaceKey
42-
- Gets Primary/Secondary Key for AuthorizationRule of existing Relay NameSpace.
43-
- Remove-AzureRmRelayNamespaceAuthorizationRule
44-
- Deletes the existing AuthorizationRule of Relay NameSpace.
45-
- New-AzureRmWcfRelay
46-
- Adds a new WcfRelay to the existing NameSpace.
47-
- Get-AzureRmWcfRelay
48-
- Gets existing Queue/ List of WcfRelay of the existing NameSpace.
49-
- Set-AzureRmWcfRelay
50-
- Updates properties of existing WcfRelay of NameSpace.
51-
- Remove-AzureRmWcfRelay
52-
- Deletes existing WcfRelay of NameSpace.
53-
- New-AzureRmWcfRelayAuthorizationRule
54-
- Adds a new AuthorizationRule to the existing WcfRelay of NameSpace.
55-
- Get-AzureRmWcfRelayAuthorizationRule
56-
- Gets the AuthorizationRule / List of AuthorizationRules of the WcfRelay.
57-
- Set-AzureRmWcfRelayAuthorizationRule
58-
- Updates the AuthorizationRule of the WcfRelay.
59-
- New-AzureRmWcfRelayKey
60-
- Generates a new Primary/Secondary Key for AuthorizationRule of existing WcfRelay.
61-
- Get-AzureRmWcfRelayKey
62-
- Gets Primary/Secondary Key for AuthorizationRule of existing WcfRelay.
63-
- Remove-AzureRmWcfRelayAuthorizationRule
64-
- Deletes the existing AuthorizationRule of WcfRelay.
65-
- New-AzureRmRelayHybridConnections
66-
- Adds a new HybridConnections to the existing NameSpace.
67-
- Get-AzureRmRelayHybridConnections
68-
- Gets existing HybridConnections/ List of HybridConnections of the existing NameSpace.
69-
- Set-AzureRmRelayHybridConnections
70-
- Updates properties of existing HybridConnections of NameSpace.
71-
- Remove-AzureRmRelayHybridConnections
72-
- Deletes existing HybridConnections of NameSpace.
73-
- New-AzureRmRelayHybridConnectionsAuthorizationRule
74-
- Adds a new AuthorizationRule to the existing HybridConnections of NameSpace.
75-
- Get-AzureRmRelayHybridConnectionsAuthorizationRule
76-
- Gets the AuthorizationRule / List of AuthorizationRules of the HybridConnections.
77-
- Set-AzureRmRelayHybridConnectionsAuthorizationRule
78-
- Updates the AuthorizationRule of the HybridConnections.
79-
- New-AzureRmRelayHybridConnectionsKey
80-
- Generates a new Primary/Secondary Key for AuthorizationRule of existing HybridConnections.
81-
- Get-AzureRmRelayHybridConnectionsKey
82-
- Gets Primary/Secondary Key for AuthorizationRule of existing HybridConnections.
83-
- Remove-AzureRmRelayHybridConnectionsAuthorizationRule
84-
- Deletes the existing AuthorizationRule of HybridConnections.
22+
* Adds cmdlets for the Azure Relay which allows users to create and manage all Azure Relay resources.

src/ResourceManager/Relay/Commands.Relay.Test/Commands.Relay.Test.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,13 @@
159159
<None Include="packages.config">
160160
<SubType>Designer</SubType>
161161
</None>
162+
<None Include="ScenarioTests\Common.ps1" />
162163
<None Include="ScenarioTests\OperationsListTest.ps1">
163164
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
164165
</None>
165166
<None Include="ScenarioTests\CheckNameAvailabilityTests.ps1">
166167
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
167168
</None>
168-
<None Include="ScenarioTests\Common.ps1">
169-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
170-
</None>
171169
<None Include="ScenarioTests\RelayNamespaceTests.ps1">
172170
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
173171
</None>

src/ResourceManager/Relay/Commands.Relay.Test/ScenarioTests/CheckNameAvailabilityTests.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Tests Relay Namespace CheckNameAvailability operations.
5656
function CheckNameAvailabilityTests
5757
{
5858
# Setup
59-
$location = Get-Location
59+
$location = "West US"
6060
$namespaceName = Get-NamespaceName
6161
$namespaceName2 = Get-NamespaceName
6262
$resourceGroupName = Get-ResourceGroupName
@@ -70,22 +70,22 @@ function CheckNameAvailabilityTests
7070
Write-Debug "ResourceGroup name : $secondResourceGroup"
7171
New-AzureRmResourceGroup -Name $secondResourceGroup -Location $location -Force
7272

73-
$ResultCheckNameAvailability = Test-AzureRmCheckNameAvailability -Namespace $namespaceName
73+
$ResultCheckNameAvailability = Test-AzureRmRelayName -Namespace $namespaceName
7474
Assert-True {$ResultCheckNameAvailability.NameAvailable} "The Namespace Name not Available"
7575

7676
Write-Debug " Create new Relay namespace"
7777
Write-Debug "NamespaceName : $namespaceName"
78-
$result = New-AzureRmRelayNamespace -ResourceGroup $resourceGroupName -Name $namespaceName -Location $location
78+
$result = New-AzureRmRelayNamespace -ResourceGroupName $resourceGroupName -Name $namespaceName -Location $location
7979
Wait-Seconds 15
8080

8181
# Assert
8282
Assert-True {$result.ProvisioningState -eq "Succeeded"}
8383

84-
$ReCheckNameAvailability = Test-AzureRmCheckNameAvailability -Namespace $namespaceName
84+
$ReCheckNameAvailability = Test-AzureRmRelayName -Namespace $namespaceName
8585
Assert-False {$ReCheckNameAvailability.NameAvailable} "The Namespace Name Available failed"
8686

8787
Write-Debug " Delete namespaces"
88-
Remove-AzureRmRelayNamespace -ResourceGroup $resourceGroupName -Name $namespaceName
88+
Remove-AzureRmRelayNamespace -ResourceGroupName $resourceGroupName -Name $namespaceName
8989

9090
Write-Debug " Delete resourcegroup"
9191
Remove-AzureRmResourceGroup -Name $resourceGroupName -Force

src/ResourceManager/Relay/Commands.Relay.Test/ScenarioTests/Common.ps1

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -20,53 +20,4 @@ Gets a resource group name for testing.
2020
function Get-ResourceGroupName
2121
{
2222
return getAssetName
23-
}
24-
25-
26-
<#
27-
.SYNOPSIS
28-
Gets the location for the Website. Default to West US if none found.
29-
#>
30-
function Get-Location
31-
{
32-
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
33-
{
34-
$namespace = "Microsoft.Web"
35-
$type = "sites"
36-
$location = Get-AzureRmResourceProvider -ProviderNamespace $namespace | where {$_.ResourceTypes[0].ResourceTypeName -eq $type}
37-
38-
if ($location -eq $null)
39-
{
40-
return "West US"
41-
} else
42-
{
43-
return $location.Locations[0]
44-
}
45-
}
46-
47-
return "West US"
48-
}
49-
50-
<#
51-
.SYNOPSIS
52-
Gets the location for the Website. Default to West US if none found.
53-
#>
54-
function Get-SecondaryLocation
55-
{
56-
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
57-
{
58-
$namespace = "Microsoft.Web"
59-
$type = "sites"
60-
$location = Get-AzureRmResourceProvider -ProviderNamespace $namespace | where {$_.ResourceTypes[0].ResourceTypeName -eq $type}
61-
62-
if ($location -eq $null)
63-
{
64-
return "East US"
65-
} else
66-
{
67-
return $location.Locations[1]
68-
}
69-
}
70-
71-
return "East US"
7223
}

src/ResourceManager/Relay/Commands.Relay.Test/ScenarioTests/HybridConnectionsTests.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,5 @@ public void HybridConnectionsCRUD()
3232
{
3333
RelayController.NewInstance.RunPsTest("HybridConnectionsTests");
3434
}
35-
36-
//[Fact]
37-
//[Trait(Category.AcceptanceType, Category.CheckIn)]
38-
//public void HybridConnectionsAuthorizationRulesCRUD()
39-
//{
40-
// RelayController.NewInstance.RunPsTest("HybridConnectionsAuthTests");
41-
//}
4235
}
4336
}

src/ResourceManager/Relay/Commands.Relay.Test/ScenarioTests/HybridConnectionsTests.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Tests HybridConnections Create Get List Remove operations.
5757
function HybridConnectionsTests
5858
{
5959
# Setup
60-
$location = Get-Location
60+
$location = "West US"
6161
$resourceGroupName = Get-ResourceGroupName
6262
$namespaceName = Get-NamespaceName
6363
$HybridConnectionsName = Get-HybridConnectionsName
@@ -71,44 +71,44 @@ function HybridConnectionsTests
7171
# Create Relay Namespace
7272
Write-Debug " Create new Relay namespace"
7373
Write-Debug " Namespace name : $namespaceName"
74-
$result = New-AzureRmRelayNamespace -ResourceGroup $resourceGroupName -Name $namespaceName -Location $location
74+
$result = New-AzureRmRelayNamespace -ResourceGroupName $resourceGroupName -Name $namespaceName -Location $location
7575
Wait-Seconds 15
7676

7777
# Assert
7878
Assert-True {$result.ProvisioningState -eq "Succeeded"}
7979

8080
# get the created Relay Namespace
8181
Write-Debug " Get the created namespace within the resource group"
82-
$returnedNamespace = Get-AzureRmRelayNamespace -ResourceGroup $resourceGroupName -Name $namespaceName
82+
$returnedNamespace = Get-AzureRmRelayNamespace -ResourceGroupName $resourceGroupName -Name $namespaceName
8383
# Assert
8484
Assert-AreEqual $location $returnedNamespace.Location "NameSpace Location Not matched."
8585
Assert-True {$returnedNamespace.Name -eq $namespaceName} "Namespace created earlier is not found."
8686

8787
# Create a HybridConnections
8888
Write-Debug "Create new HybridConnections"
8989
$userMetadata = "User Meta data"
90-
$result = New-AzureRmRelayHybridConnection -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $HybridConnectionsName -RequiresClientAuthorization $True -UserMetadata $userMetadata
90+
$result = New-AzureRmRelayHybridConnection -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Name $HybridConnectionsName -RequiresClientAuthorization $True -UserMetadata $userMetadata
9191

9292

9393
Write-Debug " Get the created HybridConnections "
94-
$createdHybridConnections = Get-AzureRmRelayHybridConnection -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $HybridConnectionsName
94+
$createdHybridConnections = Get-AzureRmRelayHybridConnection -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Name $HybridConnectionsName
9595

96-
$result2 = Set-AzureRmRelayHybridConnection -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $HybridConnectionsName -UserMetadata "Test UserMetdata"
96+
$result2 = Set-AzureRmRelayHybridConnection -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Name $HybridConnectionsName -UserMetadata "Test UserMetdata"
9797

9898
#Assert
9999
Assert-True {$result2.Name -eq $HybridConnectionsName} "HybridConnections created earlier is not found."
100100

101101
# Get the Created HybridConnections
102102
Write-Debug " Get all the created HybridConnections "
103-
$createdHybridConnectionsList = Get-AzureRmRelayHybridConnection -ResourceGroup $resourceGroupName -Namespace $namespaceName
103+
$createdHybridConnectionsList = Get-AzureRmRelayHybridConnection -ResourceGroupName $resourceGroupName -Namespace $namespaceName
104104

105105
#Assert
106106
Assert-True {$createdHybridConnectionsList[0].Name -eq $HybridConnectionsName }"HybridConnections created earlier is not found."
107107

108108
# Update the Created HybridConnections
109109
Write-Debug " Update HybridConnections "
110110
$createdHybridConnections.UserMetadata = "usermetadata is a placeholder to store user-defined string data for the HybridConnection endpoint.e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored."
111-
$result1 = Set-AzureRmRelayHybridConnection -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $HybridConnectionsName -InputObject $createdHybridConnections
111+
$result1 = Set-AzureRmRelayHybridConnection -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Name $HybridConnectionsName -InputObject $createdHybridConnections
112112
Wait-Seconds 15
113113

114114
# Assert
@@ -119,7 +119,7 @@ function HybridConnectionsTests
119119
Write-Debug " Delete the HybridConnections"
120120
for ($i = 0; $i -lt $createdHybridConnectionsList.Count; $i++)
121121
{
122-
$delete1 = Remove-AzureRmRelayHybridConnection -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $HybridConnectionsName
122+
$delete1 = Remove-AzureRmRelayHybridConnection -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Name $HybridConnectionsName
123123
}
124124
Write-Debug " Delete namespaces"
125125
Remove-AzureRmRelayNamespace -ResourceGroupName $resourceGroupName -Name $namespaceName

src/ResourceManager/Relay/Commands.Relay.Test/ScenarioTests/Namespace.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ public RelayNamespaceTests(ITestOutputHelper output)
3131
public void RelayNamespaceCRUD()
3232
{
3333
RelayController.NewInstance.RunPsTest("RelayNamespaceTests");
34-
}
35-
36-
//[Fact]
37-
//[Trait(Category.AcceptanceType, Category.CheckIn)]
38-
//public void RelayNamespaceAuthorizationRulesCRUD()
39-
//{
40-
// RelayController.NewInstance.RunPsTest("RelayNamespaceAuthTests");
41-
//}
34+
}
4235
}
4336
}

0 commit comments

Comments
 (0)