Skip to content

test: migrate VirtualMachineImageHotplug e2e test to new framework#2443

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

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

Conversation

@eofff

@eofff eofff commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

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 thread test/e2e/internal/config/config.go Outdated
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.

Comment thread test/e2e/vm/image_hotplug.go Outdated
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.

Comment thread test/e2e/vm/image_hotplug.go Outdated
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.

Comment thread test/e2e/vm/image_hotplug.go Outdated
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)

Comment thread test/e2e/vm/image_hotplug.go Outdated
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.

Comment thread test/e2e/vm/image_hotplug.go Outdated
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")

Valeriy Khorunzhin added 2 commits June 8, 2026 08:55
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
@eofff eofff force-pushed the chore/rewrite-image-hotplug-on-new-framework branch from 6ea377b to e7a4413 Compare June 8, 2026 05:59
@universal-itengineer universal-itengineer modified the milestones: v1.9.0, v1.10.0 Jun 10, 2026
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.

3 participants