-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixes #55 Start-RemotelyJobPorcessing logic - Fixes use of alias within the code - Fixes indentation * Fixes #48 naming convention for tests file and the NUnit XMl result file - based on the nodename the above files are named. * Adds unit test for Start-RemotelyJobProcessing function logic - Fixes Write-VerboseLog to handle Pester mocks - Fixes Start-RemotelyJobProcessing to stop when ProcessRemotely* function fail in pipeline * Fixes PSRemotely.json of the empty element in ModulesRequired * Adds Enter-PSRemotely function and Integration tests for it * Adds integration tests for issue #48 - naminv convention for tests & results file * Refactors config data tests * Adds another fix for #48 - the tests file dumped should also use nodename * Add -PassThru switch to Enter-PSRemotely * Fixes typo in the Debug.Integration.Tests * Fixes another set of typos in Debug.Integration.Tests * Adds check for invalid filename chars #56 * Adds check for invalid filename chars to Invoke-PSRemotely & bootstrap.ps1 #56 * Fixes integration tests for #48 & #56 * Removes the empty element in the modulesrequired @ PSRemotely.json * Fixes the naming logic for the Nunit XML file * Fixes typo in the Debug.Integration.Tests - replaces the localhost with Node1 in nodename * Adds unit and integration tests for issue #27 - issue with parsing describe blocks * Refactor the integration tests for issue #27 * Adds code logic for issue #27 * Adds quick refactor to the integration test for issue #27 * Fixes typo * Swaps $Env:BHPSModulePath with $ENV:BHModulePath * Fixes Invoke-Pester call in the remote Invoke-PSRemotely function * Swaps BHPSModulePath with BHModulePath in psremotely.psdeploy file * Adds logo #58 * Initial draft of the PITCHME.md #57 * Removing PITCHME.MD * Adds back PITCHME.md * Adds pitchme badge to README * Fixes typo in doc & adds content to PITCHME * Fixes for presentation at PSBUG * Updates doc TroubleShoot.md - now references new Enter-PSRemotely function * Fixes typos in Integration tests * Fixes for the integration tests failing - Not enough storage for IPv6Address.Integration.Tests - Typos in the ConfigData.Integration.Tests * Adds enable-rdp to Appveyor * Block RDP in appveyor.yml * Block Appveyor VM on build finish * Fixes possible race condition issue with IPv6 integration tests
- Loading branch information
1 parent
6d15547
commit 0d885af
Showing
36 changed files
with
920 additions
and
150 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,98 @@ | ||
## Operations Validation | ||
|
||
- <span style="font-size:0.9em; color:gray">Validating your Infrastructure as Code.</span> | ||
- <span style="font-size:0.9em; color:gray">Tests if the infrastructure components are functional.</span> | ||
|
||
+++ | ||
|
||
<span style="font-size:1.0em; color:gray">Fits into the DevOps ecosystem.</span> | | ||
<span style="font-size:1.0em; color:gray">Is my infrastructure functioning as expected?</span> | ||
|
||
--- | ||
## PowerShell Scripts ? | ||
|
||
- <span style="font-size:0.9em; color:gray">Can be used.</span> | ||
- <span style="font-size:0.9em; color:gray">Maintenance nightmare.</span> | ||
|
||
+++ | ||
|
||
<span style="font-size:1.0em; color:red">Tip - Avoid writing scripts for validating your infrastructure.</span> | ||
|
||
--- | ||
|
||
## Pester and PoshSpec | ||
|
||
Pester is a Unit testing framework. | ||
Only the code logic is tested. | ||
|
||
```powershell | ||
Function Get-ServerInfo { | ||
Get-CIMInstance -Class Win32_ComputerSystem | | ||
Select-Object -Property * | ||
} | ||
Describe 'Get-ServerInfo Unit tests' { | ||
# Arrange | ||
Mock -Command Get-CimInstance -FilterParameter {$Class -eq 'Win32_ComputerSystem' } | ||
# Act | ||
Get-ServerInfo | ||
# Assert | ||
It "Should query the Win32_ComputerSystem class" { | ||
Assert-MockCalled -Command Get-CimInstance -Times 1 -Exactly -Scope Describe | ||
} | ||
} | ||
``` | ||
|
||
+++ | ||
### Pester for Ops validation | ||
|
||
But Pester can be extended to validate/test Infrastructure as well. | ||
|
||
```powershell | ||
Describe "TestIPConfiguration" { | ||
It "Should have a valid IP address on the Management NIC" { | ||
(Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias 'vEthernet(Management)' | Select-Object -ExpandProperty IPAddress) | | ||
Should be '10.10.10.1' | ||
} | ||
} | ||
``` | ||
|
||
+++ | ||
|
||
### PoshSpec fits in | ||
|
||
PoshSpec adds yet another layer of abstraction on our infrastructure tests. | ||
The tests look concise and easy to maintain. | ||
|
||
```powershell | ||
Describe "TestIPConfiguration" { | ||
Context "Validate the Management NIC " { | ||
# Custom public type added to PoshSpec for our use. | ||
IPv4Address 'vEthernet(Management)' {Should be '10.10.10.1'} | ||
} | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## Challenges for Solution stack Ops validation | ||
- <span style="font-size:0.9em; color:gray">Targeting remote nodes for ops validation is still an overhead.</span> | ||
- <span style="font-size:0.9em; color:gray">Remote nodes need to bootstrapped before invoking the ops validation.</span> | ||
- <span style="font-size:0.9em; color:gray">Challenge in specifying node and solution configuration data.</span> | ||
|
||
|
||
--- | ||
|
||
## Remote Ops validation | ||
Targeting tests written to remote node(s). | ||
PSRemotely was engineered with solution stack operations validation in mind. Few of its features:- | ||
- <span style="font-size:0.6em; color:gray">Target Pester/PoshSpec based operations validation tests on the remote nodes.</span> | ||
- <span style="font-size:0.6em; color:gray">Decouples node and solution configuration data using DSC config data syntax.</span> | ||
- <span style="font-size:0.6em; color:gray">Self-contained framework, bootstraps remote node(s) for running the ops validation.</span> | ||
- <span style="font-size:0.6em; color:gray">Allows re-running failed tests.</span> | ||
- <span style="font-size:0.6em; color:gray">Easier debugging.</span> | ||
--- | ||
|
||
## Demo Validating a S2D cluster using PSRemotely | ||
|
||
![alt](PSRemotely.png) |
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,2 @@ | ||
theme : black | ||
highlight : monokai |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Oops, something went wrong.