-
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 test for DNS function #72
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d58763b
Add test for DNS function
32876d2
Fix after review #1
cda4903
Fix after review #2
09f673d
DNS(tests): Remvoe undeed include
alagoutte 67b7a2f
DNS(tests): fix common.ps1 include
alagoutte 9794e27
DNS(tests): fix trailing whitespace
alagoutte d7dc83e
DNS(tests): use 2 different DNS provider :-)
alagoutte 28b622d
DNS(tests): Add -noconfirm to Remove-ArubaSWDNS
alagoutte 39f65ba
DNS(Tests): Add check when Set-ArubaDNS
alagoutte 3f130e6
DNS(tests): Add Remove-ArubaSWDNS tests
alagoutte 11cd2c0
DNS(Tests): Add test with multiple domain names
alagoutte 9e65947
DNS(tests): Check also domain_name (when it is not set)
alagoutte 8fb5d29
DNS(tests): Remove trailing whitespace
alagoutte c53b9fb
DNS(tests): Fix Missing BOM encoding for non-ASCII encoded file (foun…
alagoutte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,72 @@ | ||
# | ||
# Copyright 2018, Alexis La Goutte <alexis.lagoutte at gmail dot com> | ||
# Copyright 2018, Cédric Moreau <moreaucedric0 at gmail dot com> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
. ../common.ps1 | ||
|
||
Describe "Get-ArubaSWDns" { | ||
It "Get-ArubaSWDns Does not throw an error" { | ||
{ Get-ArubaSWDns } | Should Not Throw | ||
} | ||
} | ||
|
||
Describe "Set-ArubaSWDns" { | ||
It "Set ArubaSWDns ip server 1" { | ||
Set-ArubaSWDns -mode Manual -server1 1.1.1.1 | ||
$dns = Get-ArubaSWDns | ||
$dns.server_1.version | Should be "IAV_IP_V4" | ||
$dns.server_1.octets | Should be "1.1.1.1" | ||
$dns.server_2 | Should -BeNullOrEmpty | ||
$dns.dns_domain_names | Should -BeNullOrEmpty | ||
Remove-ArubaSWDns -mode Manual -noconfirm | ||
} | ||
|
||
It "Set ArubaSWDns ip server 2" { | ||
Set-ArubaSWDns -mode Manual -server2 8.8.8.8 | ||
$dns = Get-ArubaSWDns | ||
$dns.server_1 | Should -BeNullOrEmpty | ||
$dns.server_2.version | Should be "IAV_IP_V4" | ||
$dns.server_2.octets | Should be "8.8.8.8" | ||
$dns.dns_domain_names | Should -BeNullOrEmpty | ||
Remove-ArubaSWDns -mode Manual -noconfirm | ||
} | ||
|
||
It "Set ArubaSWDns dns domain names" { | ||
Set-ArubaSWDns -mode Manual -server1 1.1.1.1 -server2 8.8.8.8 -domain example.org | ||
$dns = Get-ArubaSWDns | ||
$dns.server_1.version | Should be "IAV_IP_V4" | ||
$dns.server_1.octets | Should be "1.1.1.1" | ||
$dns.server_2.version | Should be "IAV_IP_V4" | ||
$dns.server_2.octets | Should be "8.8.8.8" | ||
$dns.dns_domain_names | Should be "example.org" | ||
Remove-ArubaSWDns -mode Manual -noconfirm | ||
} | ||
It "Set ArubaSWDns dns (multiple) domain names" { | ||
Set-ArubaSWDns -mode Manual -server1 1.1.1.1 -server2 8.8.8.8 -domain example.org, example.net | ||
$dns = Get-ArubaSWDns | ||
$dns.server_1.version | Should be "IAV_IP_V4" | ||
$dns.server_1.octets | Should be "1.1.1.1" | ||
$dns.server_2.version | Should be "IAV_IP_V4" | ||
$dns.server_2.octets | Should be "8.8.8.8" | ||
$dns.dns_domain_names[0] | Should be "example.org" | ||
$dns.dns_domain_names[1] | Should be "example.net" | ||
Remove-ArubaSWDns -mode Manual -noconfirm | ||
} | ||
} | ||
|
||
Describe "Remove-ArubaSWDns" { | ||
It "Remove ArubaSWDns (Mode Manual)" { | ||
Set-ArubaSWDns -mode Manual -server1 1.1.1.1 -server2 8.8.8.8 -domain example.org | ||
Remove-ArubaSWDns -mode Manual -noconfirm | ||
$dns = Get-ArubaSWDns | ||
$dns.dns_config_mode | Should be "DCM_MANUAL" | ||
$dns.server_1 | Should -BeNullOrEmpty | ||
$dns.server_2 | Should -BeNullOrEmpty | ||
$dns.dns_domain_names | Should -BeNullOrEmpty | ||
} | ||
} | ||
|
||
Disconnect-ArubaSW -noconfirm |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 a example with DHCP mode ?
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 valid request