Skip to content

Commit 2bd3de4

Browse files
hardcoretimeIsteb4k
authored andcommitted
test(vm): check TCP connection during VM migration (#1436)
Signed-off-by: Roman Sysoev <[email protected]> (cherry picked from commit 6557959)
1 parent 7f0014c commit 2bd3de4

File tree

6 files changed

+386
-13
lines changed

6 files changed

+386
-13
lines changed

images/virtualization-artifact/pkg/builder/vd/option.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,11 @@ func WithDatasource(datasource *v1alpha2.VirtualDiskDataSource) func(vd *v1alpha
4242
}
4343
}
4444

45-
func WithDataSourceHTTP(url string, checksum *v1alpha2.Checksum, caBundle []byte) Option {
45+
func WithDataSourceHTTP(dataSourceHTTP *v1alpha2.DataSourceHTTP) Option {
4646
return func(vd *v1alpha2.VirtualDisk) {
4747
vd.Spec.DataSource = &v1alpha2.VirtualDiskDataSource{
4848
Type: v1alpha2.DataSourceTypeHTTP,
49-
HTTP: &v1alpha2.DataSourceHTTP{
50-
URL: url,
51-
Checksum: checksum,
52-
CABundle: caBundle,
53-
},
49+
HTTP: dataSourceHTTP,
5450
}
5551
}
5652
}

images/virtualization-artifact/pkg/builder/vm/option.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ var (
3535
WithAnnotations = meta.WithAnnotations[*v1alpha2.VirtualMachine]
3636
)
3737

38+
func WithBootloader(bootloader v1alpha2.BootloaderType) Option {
39+
return func(vm *v1alpha2.VirtualMachine) {
40+
vm.Spec.Bootloader = bootloader
41+
}
42+
}
43+
3844
func WithCPU(cores int, coreFraction *string) Option {
3945
return func(vm *v1alpha2.VirtualMachine) {
4046
vm.Spec.CPU.Cores = cores

tests/e2e/framework/framework.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (f *Framework) Before() {
8181
if !f.skipNsCreation {
8282
ns, err := f.CreateNamespace(f.namespacePrefix, nil)
8383
gomega.Expect(err).NotTo(gomega.HaveOccurred())
84-
ginkgo.By(fmt.Sprintf("Created namespace %s", ns.Name))
84+
ginkgo.By(fmt.Sprintf("Create namespace %s", ns.Name))
8585
f.namespace = ns
8686
f.DeferNamespaceDelete(ns.Name)
8787
}

tests/e2e/object/vd.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,8 @@ func NewGeneratedHTTPVDUbuntu(prefix, namespace string) *v1alpha2.VirtualDisk {
6767
return vd.New(
6868
vd.WithGenerateName(prefix),
6969
vd.WithNamespace(namespace),
70-
vd.WithDataSourceHTTP(
71-
UbuntuHTTP,
72-
nil,
73-
nil,
74-
),
70+
vd.WithDataSourceHTTP(&v1alpha2.DataSourceHTTP{
71+
URL: UbuntuHTTP,
72+
}),
7573
)
7674
}

tests/e2e/util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ type Watcher interface {
830830
}
831831

832832
type Resource interface {
833-
*v1alpha2.VirtualMachineIPAddress | *v1alpha2.VirtualMachineIPAddressLease
833+
*v1alpha2.VirtualMachineIPAddress | *v1alpha2.VirtualMachineIPAddressLease | *v1alpha2.VirtualMachine | *v1alpha2.VirtualDisk
834834
}
835835

836836
type EventHandler[R Resource] func(eventType watch.EventType, r R) (bool, error)

0 commit comments

Comments
 (0)