Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Issue #183 - Adding new vCenter Advanced Setting tests #184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-AgentUpgradeautoUpgradeAgents.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'AgentUpgrade.autoUpgradeAgents'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'vCenter Agent Upgrade'

# The config entry stating the desired values
$Desired = $cfg.vcenter.AgentUpgradeautoUpgradeAgents

# The test value's data type, to help with conversion: bool/string/int
$Type = 'Boolean'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "AgentUpgrade.autoUpgradeAgents").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "AgentUpgrade.autoUpgradeAgents" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-AgentUpgradecheckPeriodSeconds.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'AgentUpgrade.checkPeriodSeconds'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Host upgrade check frequency'

# The config entry stating the desired values
$Desired = $cfg.vcenter.AgentUpgradecheckPeriodSeconds

# The test value's data type, to help with conversion: bool/string/int
$Type = 'Int32'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "AgentUpgrade.checkPeriodSeconds").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "AgentUpgrade.checkPeriodSeconds" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogBuffer.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Buffer'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'DB procedures log buffer'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogBuffer

# The test value's data type, to help with conversion: bool/string/int
$Type = 'Int32'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Buffer").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Buffer" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogLevelStatsPurge1.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Level.Stats.Purge1'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Log level for daily stats purge'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogLevelStatsPurge1

# The test value's data type, to help with conversion: bool/string/int
$Type = 'String'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Purge1").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Purge1" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogLevelStatsPurge2.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Level.Stats.Purge2'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Log level for weekly stats purge'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogLevelStatsPurge2

# The test value's data type, to help with conversion: bool/string/int
$Type = 'String'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Purge2").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Purge2" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogLevelStatsPurge3.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Level.Stats.Purge3'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Log level for monthly and yearly stats purge'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogLevelStatsPurge3

# The test value's data type, to help with conversion: bool/string/int
$Type = 'String'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Purge3").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Purge3" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogLevelStatsRollup1.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Level.Stats.Rollup1'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Log level for daily stats rollup'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogLevelStatsRollup1

# The test value's data type, to help with conversion: bool/string/int
$Type = 'String'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Rollup1").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Rollup1" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogLevelStatsRollup2.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Level.Stats.Rollup2'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Log level for weekly stats rollup'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogLevelStatsRollup2

# The test value's data type, to help with conversion: bool/string/int
$Type = 'String'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Rollup2").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Rollup2" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogLevelStatsRollup3.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Level.Stats.Rollup3'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Log level for monthly stats rollup'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogLevelStatsRollup3

# The test value's data type, to help with conversion: bool/string/int
$Type = 'String'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Rollup3").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Stats.Rollup3" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogLevelTopnCalc1.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Level.Topn.Calc1'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Log level for topn rank of daily stats'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogLevelTopnCalc1

# The test value's data type, to help with conversion: bool/string/int
$Type = 'String'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Topn.Calc1").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Topn.Calc1" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogLevelTopnCalc2.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Level.Topn.Calc2'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Log level for topn rank of weekly stats'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogLevelTopnCalc2

# The test value's data type, to help with conversion: bool/string/int
$Type = 'String'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Topn.Calc2").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Topn.Calc2" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogLevelTopnCalc3.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Level.Topn.Calc3'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Log level for topn rank of monthly stats'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogLevelTopnCalc3

# The test value's data type, to help with conversion: bool/string/int
$Type = 'String'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Topn.Calc3").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Topn.Calc3" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogLevelTopnCalc4.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Level.Topn.Calc4'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Log level for topn rank of yearly stats'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogLevelTopnCalc4

# The test value's data type, to help with conversion: bool/string/int
$Type = 'String'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Topn.Calc4").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Topn.Calc4" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
27 changes: 27 additions & 0 deletions Vester/Tests/vCenter/VC-DBProcLogLevelTopnPurge1.Vester.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1

# Test title, e.g. 'DNS Servers'
$Title = 'DBProc.Log.Level.Topn.Purge1'

# Test description: How New-VesterConfig explains this value to the user
$Description = 'Log level for purge of daily topns'

# The config entry stating the desired values
$Desired = $cfg.vcenter.DBProcLogLevelTopnPurge1

# The test value's data type, to help with conversion: bool/string/int
$Type = 'String'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
(Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Topn.Purge1").Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and to set the correct value
[ScriptBlock]$Fix = {
Get-AdvancedSetting -Entity $Object -Name "DBProc.Log.Level.Topn.Purge1" |
Set-AdvancedSetting -value $Desired -Confirm:$false -ErrorAction Stop
}
Loading