-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
Tests/integration/Radius.Tests.ps1
Outdated
Remove-ArubaSWRadius -id 1 | ||
} | ||
|
||
It "Add-ArubaSWRadius ports" { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 !
Tests/integration/Radius.Tests.ps1
Outdated
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" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change Mandatory Parametre...
There was a problem hiding this 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/RADIUS.ps1
Outdated
This function give you all the informations about the radius servers parameters configured on the switch. | ||
|
||
.EXAMPLE | ||
Get-ArubaSWRadius -id 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forget to update .EXEMPLE
PowerArubaSW/Public/RADIUS.ps1
Outdated
|
||
$run = ($response | ConvertFrom-Json).radius_server_element | ||
|
||
if ( $address ) { |
There was a problem hiding this comment.
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
#> | ||
|
||
Param( | ||
[Parameter (Mandatory = $true)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please pipeline !
PowerArubaSW/Public/RADIUS.ps1
Outdated
|
||
$conf = New-Object -TypeName PSObject | ||
|
||
$ip = New-Object -TypeName PSObject |
There was a problem hiding this comment.
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'))
Tests/integration/Radius.Tests.ps1
Outdated
Remove-ArubaSWRadius -id 1 | ||
} | ||
|
||
It "Add-ArubaSWRadius ports" { |
There was a problem hiding this comment.
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 !
Tests/integration/Radius.Tests.ps1
Outdated
} | ||
|
||
AfterEach { | ||
Remove-ArubaSWRadius -id $radius.radius_server_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use Get-ArubaSWRADIUS before ?
Tests/integration/Radius.Tests.ps1
Outdated
} | ||
|
||
AfterEach { | ||
Remove-ArubaSWRadius -id $id_server.radius_server_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
PowerArubaSW/Public/RADIUS.ps1
Outdated
|
||
$run = ($response | ConvertFrom-Json).radius_server_element | ||
|
||
if ( $address -And !$id ) { |
There was a problem hiding this comment.
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)
There was a problem hiding this 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
There was a problem hiding this 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/RADIUS.ps1
Outdated
|
||
Param( | ||
[Parameter (Mandatory = $false)] | ||
[string]$address, |
There was a problem hiding this comment.
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
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet fixed
PowerArubaSW/Public/RADIUS.ps1
Outdated
Param( | ||
[Parameter (Mandatory = $false)] | ||
[ValidateRange (1, 15)] | ||
[int]$id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add Pipeline too here
PowerArubaSW/Public/RADIUS.ps1
Outdated
#> | ||
|
||
Param( | ||
[Parameter (Mandatory = $true, ValueFromPipeline = $true)] |
There was a problem hiding this comment.
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 ?)
PowerArubaSW/Public/RADIUS.ps1
Outdated
[ValidateRange (1, 15)] | ||
[int]$id, | ||
[Parameter (Mandatory = $false)] | ||
[string]$address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove...
Tests/integration/Radius.Tests.ps1
Outdated
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" |
There was a problem hiding this comment.
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 ?
Tests/integration/Radius.Tests.ps1
Outdated
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" { |
There was a problem hiding this comment.
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
Tests/integration/Radius.Tests.ps1
Outdated
} | ||
|
||
Describe "Remove-ArubaSWRadius" { | ||
It "Remove ArubaSWRadius server" { |
There was a problem hiding this comment.
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
1870ec1
to
4a630ba
Compare
…dd filter with Ip address instead of ID, etc ...
Wrong parameter for address and missing for is_dyn_aut....
and add example with id parameter
add example using pipeline
2f9a664
to
6b939b8
Compare
No description provided.