✨ Add E2E tests for VM ExtraConfig reconciler#1688
Open
hpannem wants to merge 2 commits into
Open
Conversation
Minimum allowed line rate is |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds test coverage for the
VirtualMachineAdvancedSpecExtraConfig reconciler introduced for the Telco VM Service API. The reconciler applies first-class VMX fields (numa.vcpu.preferHT,sched.mem.lpage.enable1GPage,sched.swap.vmxSwapEnabled, etc.) and user-defined bag keys to vSphere ExtraConfig, with deferred application for keys that require a power cycle or power off. Without this coverage, regressions in the reconciler or its condition-reporting logic would go undetected.Changes:
pkg/vmconfig/extraconfig/reconciler_test.go— Adds unit tests for the two previously uncovered paths inReconcileandOnResult:PNUMANodeAffinitychange on a powered-on VM emitsvmx.reboot.powerCycleand setsPowerCyclePending.HugePages1GEnabled) on a powered-on VM defers the change and setsPowerOffRequired.OnResultcorrectly prioritisesPowerOffRequiredoverPowerCyclePendingwhen both are pending simultaneously.OnResultleavesstatus.ExtraConfigunchanged whenmoVM.Configis nil.test/e2e/vmservice/vmservice/virtualmachine/vm_extraconfig.go— New E2E spec (VMExtraConfigSpec) gated on thesupports_telco_vm_service_apisupervisor capability. NineItblocks cover:PowerCyclePendingon a running VM — cleared after operator-driven power cycle.PowerOffRequireddeferred key — absent from status while VM is on, applied after power-off.PowerCyclePendingand restoresPoweredOn.status.UniqueIDchange, notBiosUUID, since the operator preserves BiosUUID across recreations).PNUMANodeAffinity(only[]int32field) — comma-encoded, triggersPowerCyclePending, clears after power cycle.PowerOffRequiredpriority overPowerCyclePendingwhen both change simultaneously.PromoteDisksMode=Online) — guards against ordering bugs between the extraConfig and diskpromo reconcilers. All other blocks usePromoteDisksMode: Disabledto keep each test's failure signal unambiguous.test/e2e/vmservice/config/wcp.yaml— Addswait-vm-extraconfig-synced(5 m / 10 s) andwait-vm-extraconfig-powerstate(3 m / 10 s) interval pairs.test/e2e/vmservice/consts/consts.go— AddsTelcoVMServiceAPICapabilityNameconstant.test/e2e/vmservice/vmservice_test.go— Registers the newVM-EXTRACONFIGcontext.Which issue(s) is/are addressed by this PR? (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Are there any special notes for your reviewer:
Please add a release note if necessary: