Skip to content
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/e2e/vmservice/config/wcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,9 @@ intervals:
# Empirically, Sysprep GOSC on this image reliably reports an IP in
# 5.5-6 minutes so this spec needs a little more room.
windows-sysprep/wait-virtual-machine-vmip: ["10m", "3s"]

# linux-guest-customization overrides apply only to specs that boot VMs
# with LinuxPrep guest customization (VMGOSCSpec's LinuxPrep and vAppConfig
# contexts). LinuxPrep customization triggers a guest network restart/reboot
# that can push the guest's IP report past the default 5m budget.
linux-guest-customization/wait-virtual-machine-vmip: ["8m", "3s"]
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,34 @@ func VMGOSCSpec(ctx context.Context, inputGetter func() VMGOSCSpecInput) {
})

It("should successfully apply vAppConfig properties to VM", Label("experimental"), func() {
createAndVerifyVM(ctx, v1a2vmParameters, true)
// The IP wait is rolled inline rather than createAndVerifyVM /
// vmoperator.WaitForVirtualMachineIP so this spec can use the
// longer "linux-guest-customization" interval (see wcp.yaml)
// without changing that shared helper's timeout for every
// other caller -- the LinuxPrep customization used here
// triggers a guest network restart/reboot that can push the
// guest's IP report past the default budget, the same
// reasoning as the "windows-sysprep" override used for
// Sysprep VMs.
vmYaml = manifestbuilders.GetVirtualMachineYamlA2(v1a2vmParameters)
Expect(clusterProxy.CreateWithArgs(ctx, vmYaml)).To(Succeed(), "failed to create virtualmachine", string(vmYaml))

By(fmt.Sprintf("Verify that a single VirtualMachine '%s/%s' is created", input.WCPNamespaceName, vmName))
vmoperator.WaitForVirtualMachineToExist(ctx, config, svClusterClient, input.WCPNamespaceName, vmName)
vmoperator.WaitForVirtualMachineConditionCreated(ctx, config, svClusterClient, input.WCPNamespaceName, vmName)
vmoperator.WaitForVirtualMachinePowerState(ctx, config, svClusterClient, input.WCPNamespaceName, vmName, string(vmopv1.VirtualMachinePowerStateOn))

By(fmt.Sprintf("Verify that an IP (ipv4) is allocated to the VirtualMachine '%s/%s'", input.WCPNamespaceName, vmName))
Eventually(func() bool {
vm, err := utils.GetVirtualMachine(ctx, svClusterClient, input.WCPNamespaceName, vmName)
if err != nil {
return false
}

return vm.Status.Network != nil &&
vm.Status.Network.PrimaryIP4 != "" &&
net.ParseIP(vm.Status.Network.PrimaryIP4).To4() != nil
}, config.GetIntervals("linux-guest-customization", "wait-virtual-machine-vmip")...).Should(BeTrue())

// Verify that the vAppConfig properties are actually applied to the VM
vmmoid := vmoperator.GetVirtualMachineMOID(ctx, svClusterClient, input.WCPNamespaceName, vmName)
Expand Down
Loading