This patch enhances the simulator's support for the upgradeVm API as well as introduces the helper type vim25/types.HardwareVersion for parsing and comparing VMX hardware versions.
Closes: NA
Type of change
Please mark options that are relevant:
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
[ ] Build related change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. If applicable, please also list any relevant
details for your test configuration.
[x] Test 1
$ go test -v -count 1 -run 'TestUpgradeVm' ./simulator
=== RUN TestUpgradeVm
=== RUN TestUpgradeVm/InvalidPowerState
=== RUN TestUpgradeVm/InvalidState
=== RUN TestUpgradeVm/InvalidState/MaintenanceMode
=== RUN TestUpgradeVm/InvalidState/Template
=== RUN TestUpgradeVm/InvalidState/LatestHardwareVersion
=== RUN TestUpgradeVm/NotSupported
=== RUN TestUpgradeVm/NotSupported/AtAll
=== RUN TestUpgradeVm/NotSupported/OnVmHost
=== RUN TestUpgradeVm/AlreadyUpgraded
=== RUN TestUpgradeVm/AlreadyUpgraded/EqualToTargetVersion
=== RUN TestUpgradeVm/AlreadyUpgraded/GreaterThanTargetVersion
=== RUN TestUpgradeVm/InvalidArgument
=== RUN TestUpgradeVm/UpgradeFrom15To17
=== RUN TestUpgradeVm/UpgradeFrom17To20
=== RUN TestUpgradeVm/UpgradeFrom15To17To20
--- PASS: TestUpgradeVm (0.22s)
--- PASS: TestUpgradeVm/InvalidPowerState (0.00s)
--- PASS: TestUpgradeVm/InvalidState (0.00s)
--- PASS: TestUpgradeVm/InvalidState/MaintenanceMode (0.00s)
--- PASS: TestUpgradeVm/InvalidState/Template (0.00s)
--- PASS: TestUpgradeVm/InvalidState/LatestHardwareVersion (0.00s)
--- PASS: TestUpgradeVm/NotSupported (0.00s)
--- PASS: TestUpgradeVm/NotSupported/AtAll (0.00s)
--- PASS: TestUpgradeVm/NotSupported/OnVmHost (0.00s)
--- PASS: TestUpgradeVm/AlreadyUpgraded (0.00s)
--- PASS: TestUpgradeVm/AlreadyUpgraded/EqualToTargetVersion (0.00s)
--- PASS: TestUpgradeVm/AlreadyUpgraded/GreaterThanTargetVersion (0.00s)
--- PASS: TestUpgradeVm/InvalidArgument (0.00s)
--- PASS: TestUpgradeVm/UpgradeFrom15To17 (0.00s)
--- PASS: TestUpgradeVm/UpgradeFrom17To20 (0.00s)
--- PASS: TestUpgradeVm/UpgradeFrom15To17To20 (0.00s)
PASS
ok github.com/vmware/govmomi/simulator 0.952s
[x] Test 2
$ go test -v -count 1 -run TestHardwareVersion ./vim25/types
=== RUN TestHardwareVersion
=== RUN TestHardwareVersion/empty_string
=== RUN TestHardwareVersion/vmx_prefix_sans_number
=== RUN TestHardwareVersion/number_sans_vmx_prefix
=== RUN TestHardwareVersion/vmx-13
=== RUN TestHardwareVersion/VMX-18
--- PASS: TestHardwareVersion (0.00s)
--- PASS: TestHardwareVersion/empty_string (0.00s)
--- PASS: TestHardwareVersion/vmx_prefix_sans_number (0.00s)
--- PASS: TestHardwareVersion/number_sans_vmx_prefix (0.00s)
--- PASS: TestHardwareVersion/vmx-13 (0.00s)
--- PASS: TestHardwareVersion/VMX-18 (0.00s)
PASS
ok github.com/vmware/govmomi/vim25/types 0.322s
Checklist:
[x] My code follows the CONTRIBUTIONguidelines of this project
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
Description
This patch enhances the simulator's support for the upgradeVm API as well as introduces the helper type
vim25/types.HardwareVersion
for parsing and comparing VMX hardware versions.Closes: NA
Type of change
Please mark options that are relevant:
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. If applicable, please also list any relevant details for your test configuration.
[x] Test 1
[x] Test 2
Checklist:
CONTRIBUTION
guidelines of this project