Skip to content
Merged
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
1 change: 0 additions & 1 deletion test/e2e/default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ testData:
vmMigrationCancel: "/tmp/testdata/vm-migration-cancel"
vmEvacuation: "/tmp/testdata/vm-evacuation"
vmDiskAttachment: "/tmp/testdata/vm-disk-attachment"
vmVersions: "/tmp/testdata/vm-versions"
vdSnapshots: "/tmp/testdata/vd-snapshots"
sshKey: "/tmp/testdata/sshkeys/id_ed"
sshUser: "cloud"
Expand Down
1 change: 0 additions & 1 deletion test/e2e/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ type TestData struct {
VMMigrationCancel string `yaml:"vmMigrationCancel"`
VMEvacuation string `yaml:"vmEvacuation"`
VMDiskAttachment string `yaml:"vmDiskAttachment"`
VMVersions string `yaml:"vmVersions"`
VdSnapshots string `yaml:"vdSnapshots"`
Sshkey string `yaml:"sshKey"`
SSHUser string `yaml:"sshUser"`
Expand Down
15 changes: 0 additions & 15 deletions test/e2e/legacy/testdata/vm-versions/kustomization.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions test/e2e/legacy/testdata/vm-versions/ns.yaml

This file was deleted.

52 changes: 0 additions & 52 deletions test/e2e/legacy/testdata/vm-versions/transformer.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions test/e2e/legacy/testdata/vm-versions/vd/kustomization.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions test/e2e/legacy/testdata/vm-versions/vd/vd-root.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions test/e2e/legacy/testdata/vm-versions/vm/kustomization.yaml

This file was deleted.

54 changes: 0 additions & 54 deletions test/e2e/legacy/testdata/vm-versions/vm/transformer.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions test/e2e/legacy/testdata/vm-versions/vm/vm.yaml

This file was deleted.

114 changes: 0 additions & 114 deletions test/e2e/legacy/vm_version.go

This file was deleted.

77 changes: 77 additions & 0 deletions test/e2e/vm/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
Copyright 2026 Flant JSC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package vm

import (
"context"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/utils/ptr"
crclient "sigs.k8s.io/controller-runtime/pkg/client"

vdbuilder "github.com/deckhouse/virtualization-controller/pkg/builder/vd"
vmbuilder "github.com/deckhouse/virtualization-controller/pkg/builder/vm"
"github.com/deckhouse/virtualization/api/core/v1alpha2"
"github.com/deckhouse/virtualization/test/e2e/internal/framework"
"github.com/deckhouse/virtualization/test/e2e/internal/object"
"github.com/deckhouse/virtualization/test/e2e/internal/util"
)

var _ = Describe("VirtualMachineVersions", func() {
var f *framework.Framework

BeforeEach(func() {
f = framework.NewFramework("vm-versions")
DeferCleanup(f.After)
f.Before()
})

It("should expose qemu and libvirt versions in VM status", func() {
By("Generating VirtualDisk from precreated ClusterVirtualImage")
vdRoot := object.NewVDFromCVI("vd-root", f.Namespace().Name, object.PrecreatedCVIAlpineBIOS,
vdbuilder.WithSize(ptr.To(resource.MustParse("512Mi"))),
)

By("Generating VirtualMachine")
vm := object.NewMinimalVM("vm-", f.Namespace().Name,
vmbuilder.WithBlockDeviceRefs(
v1alpha2.BlockDeviceSpecRef{
Kind: v1alpha2.DiskDevice,
Name: vdRoot.Name,
},
),
)

By("Creating resources")
err := f.CreateWithDeferredDeletion(context.Background(), vdRoot, vm)
Expect(err).NotTo(HaveOccurred())

By("Waiting for VirtualMachine to be Running")
util.UntilObjectPhase(string(v1alpha2.MachineRunning), framework.LongTimeout, vm)

By("Checking VM status has qemu and libvirt versions")
Eventually(func(g Gomega) {
err := f.GenericClient().Get(context.Background(), crclient.ObjectKeyFromObject(vm), vm)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(vm.Status.Versions).NotTo(BeNil())
g.Expect(vm.Status.Versions.Qemu).NotTo(BeEmpty())
g.Expect(vm.Status.Versions.Libvirt).NotTo(BeEmpty())
}).WithTimeout(framework.LongTimeout).WithPolling(framework.PollingInterval).Should(Succeed())
})
})
Loading