-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to on/off/blink led locator (and also change duration) Part of issue #36
- Loading branch information
Showing
1 changed file
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# | ||
# Copyright 2018, Alexis La Goutte <alexis.lagoutte at gmail dot com> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
. ../common.ps1 | ||
#TODO: Add check if no ipaddress/login/password info... | ||
|
||
Describe "Get Led Locator" { | ||
BeforeAll { | ||
#Disable... | ||
Set-ArubaSWLed -status off | ||
} | ||
It "Get LedLocator Does not throw an error" { | ||
{ | ||
Get-ArubaSWLed | ||
} | Should Not Throw | ||
} | ||
|
||
It "Get LedLocator info (first unit)" { | ||
$LED = Get-ArubaSWLed | ||
$LED.status | Should Be "LS_OFF" | ||
$LED.duration_in_seconds | Should BeNullOrEmpty | ||
$LED.when | Should be "LBT_NOW" | ||
$LED.remaining_seconds | Should BeNullOrEmpty | ||
} | ||
} | ||
|
||
Describe "Configure Led Locator" { | ||
|
||
It "Configure Led Locator (with default duration => 30 minutes)" { | ||
Set-ArubaSWLed -status on | ||
$LED = Get-ArubaSWLed | ||
$LED.status | Should Be "LS_ON" | ||
$LED.duration_in_seconds | Should BeNullOrEmpty | ||
$LED.when | Should be "LBT_NOW" | ||
$LED.remaining_seconds | Should -BeGreaterThan 1740 | ||
} | ||
|
||
It "Configure Led Locator (with duration 1 minute)" { | ||
Set-ArubaSWLed -status on -duration 1 | ||
$LED = Get-ArubaSWLed | ||
$LED.status | Should Be "LS_ON" | ||
$LED.duration_in_seconds | Should BeNullOrEmpty | ||
$LED.when | Should be "LBT_NOW" | ||
$LED.remaining_seconds | Should -BeGreaterThan 40 | ||
$LED.remaining_seconds | Should -BeLessThan 60 | ||
} | ||
|
||
It "Disable Led Locator" { | ||
Set-ArubaSWLed -status off | ||
$LED = Get-ArubaSWLed | ||
$LED.status | Should Be "LS_OFF" | ||
$LED.duration_in_seconds | Should BeNullOrEmpty | ||
$LED.when | Should be "LBT_NOW" | ||
$LED.remaining_seconds | Should BeNullOrEmpty | ||
} | ||
|
||
It "Configure Led locator for blink" { | ||
Set-ArubaSWLed -status blink | ||
$LED = Get-ArubaSWLed | ||
$LED.status | Should Be "LS_BLINK" | ||
$LED.duration_in_seconds | Should BeNullOrEmpty | ||
$LED.when | Should be "LBT_NOW" | ||
$LED.remaining_seconds | Should -BeGreaterThan 1740 | ||
} | ||
|
||
It "Disable Led locator blinking" { | ||
Set-ArubaSWLed -status off | ||
$LED = Get-ArubaSWLed | ||
$LED.status | Should Be "LS_OFF" | ||
$LED.duration_in_seconds | Should BeNullOrEmpty | ||
$LED.when | Should be "LBT_NOW" | ||
$LED.remaining_seconds | Should BeNullOrEmpty | ||
} | ||
|
||
It "Configure Led locator to startup" { | ||
Set-ArubaSWLed -status on -when Startup | ||
$LED = Get-ArubaSWLed | ||
$LED.status | Should Be "LS_ON" | ||
$LED.duration_in_seconds | Should be 1800 | ||
$LED.when | Should be "LBT_STARTUP" | ||
$LED.remaining_seconds | Should BeNullOrEmpty | ||
} | ||
|
||
It "Configure Led locator to startup during 1minute" { | ||
Set-ArubaSWLed -status on -when Startup -duration 1 | ||
$LED = Get-ArubaSWLed | ||
$LED.status | Should Be "LS_ON" | ||
$LED.duration_in_seconds | Should be 60 | ||
$LED.when | Should be "LBT_STARTUP" | ||
$LED.remaining_seconds | Should BeNullOrEmpty | ||
} | ||
|
||
It "Disable Led locator blinking" { | ||
Set-ArubaSWLed -status off | ||
$LED = Get-ArubaSWLed | ||
$LED.status | Should Be "LS_OFF" | ||
$LED.duration_in_seconds | Should BeNullOrEmpty | ||
$LED.when | Should be "LBT_NOW" | ||
$LED.remaining_seconds | Should BeNullOrEmpty | ||
} | ||
} | ||
|
||
Disconnect-ArubaSW -noconfirm |