Skip to content

test: migrate VirtualMachineImageHotplug e2e test to new framework#2443

Draft
eofff wants to merge 2 commits into
mainfrom
chore/rewrite-image-hotplug-on-new-framework
Draft

test: migrate VirtualMachineImageHotplug e2e test to new framework#2443
eofff wants to merge 2 commits into
mainfrom
chore/rewrite-image-hotplug-on-new-framework

Conversation

@eofff
Copy link
Copy Markdown
Contributor

@eofff eofff commented Jun 4, 2026

Description

Migrate VirtualMachineImageHotplug e2e test to the new framework.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: vm
type: chore
summary: Migrate VirtualMachineImageHotplug e2e test to new framework.

Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
@eofff eofff force-pushed the chore/rewrite-image-hotplug-on-new-framework branch from 8ae0ba1 to 6dd1ae7 Compare June 4, 2026 08:22
@eofff eofff added this to the v1.9.0 milestone Jun 4, 2026
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
@eofff eofff requested a review from hardcoretime June 4, 2026 09:24
Comment on lines 113 to +116
type TestData struct {
ImageHotplug string `yaml:"imageHotplug"`
VMMigration string `yaml:"vmMigration"`
Sshkey string `yaml:"sshKey"`
SSHUser string `yaml:"sshUser"`
VMMigration string `yaml:"vmMigration"`
Sshkey string `yaml:"sshKey"`
SSHUser string `yaml:"sshUser"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the last legacy test case, and unused configurations and legacy test data should be removed as well.
Also, delete the .keep files in the test data directory.

vmbuilder.WithName("vm"),
vmbuilder.WithNamespace(f.Namespace().Name),
vmbuilder.WithCPU(1, ptr.To("100%")),
vmbuilder.WithMemory(resource.MustParse("256Mi")),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 512Mi to prevent problems with out-of-memory (OOM) errors.
#2444

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this test be placed in the block device section? Also, the block device util contains some lsblk structures.

attached++
}
}
g.Expect(attached).To(BeNumerically(">=", expectedAttached+1))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a short description to the error message.

util.UntilGuestCommandsReady(f, vm, []string{"lsblk"}, framework.ShortTimeout)

By("Calculating initial block devices count")
initialDiskCnt, err := util.GetDiskCount(f, vm.Name, vm.Namespace)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
initialDiskCnt, err := util.GetDiskCount(f, vm.Name, vm.Namespace)
initialDiskCount, err := util.GetDiskCount(f, vm.Name, vm.Namespace)

Eventually(func(g Gomega) {
count, diskErr := util.GetDiskCount(f, vm.Name, vm.Namespace)
g.Expect(diskErr).NotTo(HaveOccurred())
g.Expect(count).To(Equal(initialDiskCnt + hotplugImagesCount))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a short description to the error message.

util.UntilSSHReady(f, vm, framework.MiddleTimeout)
util.UntilGuestCommandsReady(f, vm, []string{"lsblk"}, framework.ShortTimeout)

By("Calculating initial block devices count")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By("Calculating initial block devices count")
By("Getting initial block devices count")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants