Skip to content

Commit

Permalink
tests: remove outdated e2e test
Browse files Browse the repository at this point in the history
Since kubevirt@921efe2
KubeVirt no longer relies on the Container Runtime
to expose a pullable and reproducible image ID so this test
is now useless as some runtimes like CRIO 1.28 do not export this info
anymore.

Signed-off-by: Antonio Cardace <[email protected]>
  • Loading branch information
acardace committed Dec 22, 2023
1 parent 32b2d0a commit 08e9512
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions tests/migration/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"encoding/xml"
"fmt"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
Expand Down Expand Up @@ -2876,56 +2875,6 @@ var _ = SIGMigrationDescribe("VM Live Migration", func() {
})
})

It("should replace containerdisk and kernel boot images with their reproducible digest during migration", func() {

vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi.Spec.Domain.Firmware = utils.GetVMIKernelBootWithRandName().Spec.Domain.Firmware

By("Starting a VirtualMachineInstance")
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Create(context.Background(), vmi)
Expect(err).ToNot(HaveOccurred())
libwait.WaitForSuccessfulVMIStart(vmi)

pod := tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)
By("Verifying that all relevant images are without the digest on the source")
for _, container := range append(pod.Spec.Containers, pod.Spec.InitContainers...) {
if container.Name == "container-disk-binary" || container.Name == "compute" || container.Name == "guest-console-log" {
continue
}
Expect(container.Image).ToNot(ContainSubstring("@sha256:"), "image:%s should not contain the container digest for container %s", container.Image, container.Name)
}

digestRegex := regexp.MustCompile(`sha256:[a-zA-Z0-9]+`)

By("Collecting digest information from the container statuses")
imageIDs := map[string]string{}
for _, status := range append(pod.Status.ContainerStatuses, pod.Status.InitContainerStatuses...) {
if status.Name == "container-disk-binary" || status.Name == "compute" || status.Name == "guest-console-log" {
continue
}
digest := digestRegex.FindString(status.ImageID)
Expect(digest).ToNot(BeEmpty())
imageIDs[status.Name] = digest
}

By("Performing a migration")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
libmigration.RunMigrationAndExpectToCompleteWithDefaultTimeout(virtClient, migration)

By("Verifying that all imageIDs are in a reproducible form on the target")
pod = tests.GetRunningPodByVirtualMachineInstance(vmi, vmi.Namespace)

for _, container := range append(pod.Spec.Containers, pod.Spec.InitContainers...) {
if container.Name == "container-disk-binary" || container.Name == "compute" || container.Name == "guest-console-log" {
continue
}
digest := digestRegex.FindString(container.Image)
Expect(container.Image).To(ContainSubstring(digest), "image:%s should contain the container digest for container %s", container.Image, container.Name)
Expect(digest).ToNot(BeEmpty())
Expect(imageIDs).To(HaveKeyWithValue(container.Name, digest), "expected image:%s for container %s to be the same like on the source pod but got %s", container.Image, container.Name, imageIDs[container.Name])
}
})

Context("[Serial]Testing host-model cpuModel edge cases in the cluster if the cluster is host-model migratable", Serial, func() {

var sourceNode *k8sv1.Node
Expand Down

0 comments on commit 08e9512

Please sign in to comment.