-
Notifications
You must be signed in to change notification settings - Fork 45
Additional Security Configuration Tests #100
Conversation
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.
Requesting review on both VDS test $Fix
blocks
# The command(s) to match the environment to the config | ||
# Use $Object to help filter, and $Desired to set the correct value | ||
[ScriptBlock]$Fix = { | ||
Get-View -VIObject $object.name | |
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.
This only works for me if I do (Get-View -VIObject $Object).Name
. Do you mind confirming?
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.
Wrapping it in a parathensis returns just the object name, which is not the intended result.
C:\> (get-view -VIObject $object).name
Test-vDSwitch
I wanted to return the actual object, though I don't recall why I added the .name
at the end of the $object
variable, as simply leaving it as Get-View -VIObject $object
returns the same desired results. If that works I can update the two VDS tests.
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.
Oh, right, I'm talking crazy. Either way works for me, I'll approve now and let you decide. Thanks for setting me straight.
Man. So many hardening guide tests have no default value, and are tough to validate from my layman's perspective. 😕 I trust you, though. 😉 I was going to comment on your use of C:\> (Get-VDSwitch)[0].ExtensionData.Config.HealthCheckConfig | fl *
Enable : False
Interval : 0
Enable : False
Interval : 0 You mentioned changing a test type in #103. I'm holding off for a bit in case you want to test that out, but let me know if you just want me to rubber stamp this. |
I will definitely test some more. I ran into an error when I tried using For my sanity, I'm logging this to the Internet, but why would you have two values under a single setting? Especially since the settings are technically under different type names. PowerCLI C:\> $object.ExtensionData.Config.HealthCheckConfig | gm
TypeName: VMware.Vim.VMwareDVSVlanMtuHealthCheckConfig
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Enable Property System.Nullable[bool] Enable {get;set;}
Interval Property System.Nullable[int] Interval {get;set;}
TypeName: VMware.Vim.VMwareDVSTeamingHealthCheckConfig
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Enable Property System.Nullable[bool] Enable {get;set;}
Interval Property System.Nullable[int] Interval {get;set;} |
Ugh of course now |
I want to like that |
I'm good with how the tests are. We can revisit if others have concerns. |
Fixing some old tests that I missed on the format change and adding new tests to the fold.