From f353ca182c719b2d9787db1a5173fd00055a7926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moreau?= Date: Fri, 8 Nov 2019 10:02:43 +0100 Subject: [PATCH] Fix minor issues on code --- PowerArubaSW/Public/RADIUS_GROUP.ps1 | 15 +++++++++------ Tests/integration/RADIUS_GROUP.Tests.ps1 | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/PowerArubaSW/Public/RADIUS_GROUP.ps1 b/PowerArubaSW/Public/RADIUS_GROUP.ps1 index 630221f..6536a24 100644 --- a/PowerArubaSW/Public/RADIUS_GROUP.ps1 +++ b/PowerArubaSW/Public/RADIUS_GROUP.ps1 @@ -16,6 +16,7 @@ function Get-ArubaSWRadiusGroup { .EXAMPLE Get-ArubaSWRadiusGroup -server_group_name PowerArubaSW + This function give you all the informations about the radius servers in the group PowerArubaSW configured on the switch. #> @@ -56,6 +57,7 @@ function Add-ArubaSWRadiusGroup { .EXAMPLE Add-ArubaSWRadiusGroup -server_group_name PowerArubaSWGroup -server1 192.0.2.1 -server2 192.0.2.2 -server3 192.0.2.3 + Add the group PowerArubaSWGroup with servers. #> @@ -63,11 +65,11 @@ function Add-ArubaSWRadiusGroup { [Parameter (Mandatory = $true)] [string]$server_group_name, [Parameter (Mandatory = $true)] - [string]$server1, + [string]$ipaddress1, [Parameter (Mandatory = $false)] - [string]$server2, + [string]$ipaddress2, [Parameter (Mandatory = $false)] - [string]$server3, + [string]$ipaddress3, [Parameter (Mandatory=$False)] [ValidateNotNullOrEmpty()] [PSObject]$connection=$DefaultArubaSWConnection @@ -88,7 +90,7 @@ function Add-ArubaSWRadiusGroup { $serverip1 | Add-Member -name "version" -MemberType NoteProperty -Value "IAV_IP_V4" - $serverip1 | Add-Member -name "octets" -MemberType NoteProperty -Value $server1 + $serverip1 | Add-Member -name "octets" -MemberType NoteProperty -Value $ipaddress1 $servers += $serverip1 @@ -97,7 +99,7 @@ function Add-ArubaSWRadiusGroup { $serverip2 | Add-Member -name "version" -MemberType NoteProperty -Value "IAV_IP_V4" - $serverip2 | Add-Member -name "octets" -MemberType NoteProperty -Value $server2 + $serverip2 | Add-Member -name "octets" -MemberType NoteProperty -Value $ipaddress2 $servers += $serverip2 } @@ -107,7 +109,7 @@ function Add-ArubaSWRadiusGroup { $serverip3 | Add-Member -name "version" -MemberType NoteProperty -Value "IAV_IP_V4" - $serverip3 | Add-Member -name "octets" -MemberType NoteProperty -Value $server3 + $serverip3 | Add-Member -name "octets" -MemberType NoteProperty -Value $ipaddress3 $servers += $serverip3 } @@ -138,6 +140,7 @@ function Remove-ArubaSWRadiusGroup { .EXAMPLE Remove-ArubaSWRadius -server_group_name PowerArubaSW + Remove the radius server group with name PowerArubaSW. #> diff --git a/Tests/integration/RADIUS_GROUP.Tests.ps1 b/Tests/integration/RADIUS_GROUP.Tests.ps1 index 3a1ae90..427f0eb 100644 --- a/Tests/integration/RADIUS_GROUP.Tests.ps1 +++ b/Tests/integration/RADIUS_GROUP.Tests.ps1 @@ -7,6 +7,16 @@ . ../common.ps1 +Describe "Get-ArubaSWRadiusGroup" { + It "Get-ArubaSWRadiusGroup Does not throw an error" { + Add-ArubaSWRadius -address 192.0.2.1 -shared_secret powerarubasw + Add-ArubaSWRadiusGroup -server_group_name PowerArubaSW -server1 192.0.2.1 + { Get-ArubaSWRadiusGroup -server_group_name PowerArubaSW } | Should Not Throw + Remove-ArubaSWRadiusGroup -server_group_name PowerArubaSW -noconfirm + Remove-ArubaSWRadius -address 192.0.2.1 -noconfirm + } +} + Describe "Add-ArubaSWRadiusGroup" { BeforeEach { @@ -35,16 +45,6 @@ Describe "Add-ArubaSWRadiusGroup" { } } -Describe "Get-ArubaSWRadiusGroup" { - It "Get-ArubaSWRadiusGroup Does not throw an error" { - Add-ArubaSWRadius -address 192.0.2.1 -shared_secret powerarubasw - Add-ArubaSWRadiusGroup -server_group_name PowerArubaSW -server1 192.0.2.1 - { Get-ArubaSWRadiusGroup -server_group_name PowerArubaSW } | Should Not Throw - Remove-ArubaSWRadiusGroup -server_group_name PowerArubaSW -noconfirm - Remove-ArubaSWRadius -address 192.0.2.1 -noconfirm - } -} - Describe "Remove-ArubaSWRadiusGroup" { It "Remove RADIUS group server" { Add-ArubaSWRadius -address 192.0.2.1 -shared_secret powerarubasw