Skip to content

test(vm): add disk attachment test using new framework#2288

Merged
hardcoretime merged 2 commits into
mainfrom
test/vm/add-disk-attachment-test
Apr 29, 2026
Merged

test(vm): add disk attachment test using new framework#2288
hardcoretime merged 2 commits into
mainfrom
test/vm/add-disk-attachment-test

Conversation

@hardcoretime
Copy link
Copy Markdown
Contributor

@hardcoretime hardcoretime commented Apr 27, 2026

Description

Migrating e2e test DiskAttachment from legacy approach to the new framework.

The test verifies that virtual disks can be attached to and detached from running VMs.

Technical changes:

  • Uses framework.NewFramework() instead of kustomize + kubectl
  • Resources are created programmatically via builders (vdbuilder, vmbuilder, vmbdabuilder)
  • State waiting via util.UntilObjectPhase() instead of WaitPhaseByLabel
  • Automatic cleanup via CreateWithDeferredDeletion()
  • Disk count verification via util.GetDiskCount() from centralized utils

Why do we need it, and what problem does it solve?

According to the roadmap, all legacy e2e tests need to be gradually migrated to the new framework. This simplifies test code, makes them more declarative, and faster by using direct API calls instead of kubectl.

What is the expected result?

The DiskAttachment test passes successfully and verifies that virtual disks can be attached to and detached from running VMs, with disk count verified via lsblk.

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: test
type: chore
summary: "Migrate e2e test DiskAttachment to new framework."
impact_level: low

@hardcoretime hardcoretime requested a review from Isteb4k as a code owner April 27, 2026 22:32
@hardcoretime hardcoretime added this to the v1.9.0 milestone Apr 27, 2026
@hardcoretime hardcoretime force-pushed the test/vm/add-disk-attachment-test branch from b040adb to ca74781 Compare April 28, 2026 08:36
@hardcoretime hardcoretime changed the title test(vm): add disk attachment test test(vm): add disk attachment test using new framework Apr 28, 2026
LopatinDmitr
LopatinDmitr previously approved these changes Apr 28, 2026
Add new e2e test for hot attach/detach virtual disk to running VM.

This test replaces the legacy vm_disk_attachment test with a more
maintainable approach using object builders and framework helpers.

- Remove legacy test with kustomize overlays
- Add helper functions for VMBDA to legacy image_hotplug test
- Remove vmDiskAttachment from test config

Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
@hardcoretime hardcoretime force-pushed the test/vm/add-disk-attachment-test branch from b117a4f to 916f88c Compare April 28, 2026 20:58
@hardcoretime hardcoretime merged commit 982d1e0 into main Apr 29, 2026
27 of 28 checks passed
@hardcoretime hardcoretime deleted the test/vm/add-disk-attachment-test branch April 29, 2026 16:27
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