Skip to content

Commit

Permalink
test: skip connectivity check for virtual machines migrated from cont…
Browse files Browse the repository at this point in the history
…rol plane (#652)

Temporarily do not check the network connection with virtual machines that have migrated from the master.

---------

Signed-off-by: Isteb4k <[email protected]>
Signed-off-by: Roman Sysoev <[email protected]>
Signed-off-by: Roman Sysoev <[email protected]>
  • Loading branch information
Isteb4k authored Jan 27, 2025
1 parent 345db2d commit 7499b6d
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion tests/e2e/complex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"

virtv2 "github.com/deckhouse/virtualization/api/core/v1alpha2"
"github.com/deckhouse/virtualization/tests/e2e/config"
Expand Down Expand Up @@ -209,6 +210,8 @@ var _ = Describe("Complex test", ginkgoutil.CommonE2ETestDecorators(), func() {
})

Describe("Migrations", func() {
skipConnectivityCheck := make(map[string]struct{})

Context(fmt.Sprintf("When VMs are in %s phases", PhaseRunning), func() {
It("starts migrations", func() {
res := kubectl.List(kc.ResourceVM, kc.GetOptions{
Expand All @@ -219,6 +222,24 @@ var _ = Describe("Complex test", ginkgoutil.CommonE2ETestDecorators(), func() {
Expect(res.Error()).NotTo(HaveOccurred(), res.StdErr())

vms := strings.Split(res.StdOut(), " ")

// TODO: remove this temporary solution after the d8-cni-cilium fix for network accessibility of migrating virtual machines is merged.
for _, name := range vms {
vmObj := virtv2.VirtualMachine{}
err := GetObject(kc.ResourceVM, name, &vmObj, kc.GetOptions{Namespace: conf.Namespace})
Expect(err).NotTo(HaveOccurred(), "%w", err)

nodeObj := corev1.Node{}
err = GetObject("node", vmObj.Status.Node, &nodeObj, kc.GetOptions{})
Expect(err).NotTo(HaveOccurred(), "%w", err)

_, ok := nodeObj.Labels["node-role.kubernetes.io/control-plane"]
if ok {
skipConnectivityCheck[name] = struct{}{}
}
}
// TODO ↥ to delete ↥.

MigrateVirtualMachines(testCaseLabel, conf.TestData.ComplexTest, vms...)
})
})
Expand Down Expand Up @@ -248,7 +269,15 @@ var _ = Describe("Complex test", ginkgoutil.CommonE2ETestDecorators(), func() {
})
Expect(res.Error()).NotTo(HaveOccurred(), res.StdErr())

vms := strings.Split(res.StdOut(), " ")
var vms []string
for _, vm := range strings.Split(res.StdOut(), " ") {
if _, skip := skipConnectivityCheck[vm]; skip {
continue
}

vms = append(vms, vm)
}

CheckExternalConnection(externalHost, httpStatusOk, vms...)
})
})
Expand Down

0 comments on commit 7499b6d

Please sign in to comment.