Skip to content
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

Add Function and Tests for Radius function #107

Merged
merged 23 commits into from
Jan 2, 2020

Conversation

CedricMoreau
Copy link
Contributor

No description provided.

PowerArubaSW/Public/Ipadress.ps1 Outdated Show resolved Hide resolved
PowerArubaSW/Public/RADIUS.ps1 Outdated Show resolved Hide resolved
PowerArubaSW/Public/RADIUS.ps1 Outdated Show resolved Hide resolved
PowerArubaSW/Public/RADIUS.ps1 Outdated Show resolved Hide resolved
PowerArubaSW/Public/RADIUS.ps1 Outdated Show resolved Hide resolved
PowerArubaSW/Public/RADIUS.ps1 Outdated Show resolved Hide resolved
Tests/integration/Radius.Tests.ps1 Outdated Show resolved Hide resolved
Tests/integration/Radius.Tests.ps1 Outdated Show resolved Hide resolved
Remove-ArubaSWRadius -id 1
}

It "Add-ArubaSWRadius ports" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add RADIUS with change ports... (same for other after)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename title of test !

Add-ArubaSWRadius -address 192.0.2.1 -shared_secret powerarubasw -is_dyn_autorization_enabled -time_window_type TW_PLUS_OR_MINUS_TIME_WINDOW -time_window 0 -authentication_port 1800 -accounting_port 1801
}

It "Set-ArubaSWRadius mandatory parameters" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change Mandatory Parametre...

Copy link
Collaborator

@alagoutte alagoutte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have also check the indent ? (using Visual Code Formater ?)

PowerArubaSW/Public/Ipadress.ps1 Outdated Show resolved Hide resolved
This function give you all the informations about the radius servers parameters configured on the switch.

.EXAMPLE
Get-ArubaSWRadius -id 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forget to update .EXEMPLE


$run = ($response | ConvertFrom-Json).radius_server_element

if ( $address ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kept always id (and address)

PowerArubaSW/Public/RADIUS.ps1 Outdated Show resolved Hide resolved
#>

Param(
[Parameter (Mandatory = $true)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pipeline !


$conf = New-Object -TypeName PSObject

$ip = New-Object -TypeName PSObject
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move in if ($PsBoundParameters.ContainsKey('address'))

Remove-ArubaSWRadius -id 1
}

It "Add-ArubaSWRadius ports" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename title of test !

}

AfterEach {
Remove-ArubaSWRadius -id $radius.radius_server_id
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use Get-ArubaSWRADIUS before ?

}

AfterEach {
Remove-ArubaSWRadius -id $id_server.radius_server_id
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


$run = ($response | ConvertFrom-Json).radius_server_element

if ( $address -And !$id ) {
Copy link
Collaborator

@alagoutte alagoutte Oct 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use ParameterSet (when you specific parameter)

Copy link
Collaborator

@alagoutte alagoutte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always some issue no yet fixed

Copy link
Collaborator

@alagoutte alagoutte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check pipeline stuff and minor stuff

PowerArubaSW/Public/Ipadress.ps1 Outdated Show resolved Hide resolved

Param(
[Parameter (Mandatory = $false)]
[string]$address,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[string] -> ipaddress ?

PowerArubaSW/Public/RADIUS.ps1 Outdated Show resolved Hide resolved
Set-ArubaSWRadius -id 1 -address 192.0.2.1 -shared_secret powerarubasw
Change parameters for a radius server
.EXAMPLE
Set-ArubaSWRadius -id 2 -address 192.0.2.2 -shared_secret powerarubasw -authentication_port 1812 -accounting_port 1813 -is_dyn_autorization_enabled -time_window_type TW_PLUS_OR_MINUS_TIME_WINDOW -time_window 0 -is_oobm
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet fixed

Param(
[Parameter (Mandatory = $false)]
[ValidateRange (1, 15)]
[int]$id,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add Pipeline too here

#>

Param(
[Parameter (Mandatory = $true, ValueFromPipeline = $true)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add example with pipeline (do you have ? working ?)

[ValidateRange (1, 15)]
[int]$id,
[Parameter (Mandatory = $false)]
[string]$address,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove...

Add-ArubaSWRadius -address 192.0.2.1 -shared_secret powerarubasw -time_window_type TW_PLUS_OR_MINUS_TIME_WINDOW -time_window 0
$radius = Get-ArubaSWRadius -address 192.0.2.1
$radius.time_window_type | Should be "TW_PLUS_OR_MINUS_TIME_WINDOW"
$radius.time_window | Should be "0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the value by default ?

Add-ArubaSWRadius -address 192.0.2.1 -shared_secret powerarubasw -authentication_port 1800 -accounting_port 1801 -time_window_type TW_PLUS_OR_MINUS_TIME_WINDOW -time_window 0 -is_dyn_authorization_enabled
}

It "Check change on shared secret" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add check also with pipeline

}

Describe "Remove-ArubaSWRadius" {
It "Remove ArubaSWRadius server" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same add also example with pipeline

@alagoutte alagoutte merged commit cfcbd7c into PowerAruba:master Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants