Skip to content

Commit db562e8

Browse files
test: delete legacy complex test (#2329)
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
1 parent 1d16d50 commit db562e8

54 files changed

Lines changed: 152 additions & 1019 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,9 @@ func WithUSBDevices(usbDevices []v1alpha2.USBDeviceSpecRef) Option {
161161
vm.Spec.USBDevices = usbDevices
162162
}
163163
}
164+
165+
func WithIpAddress(ipAddress string) Option {
166+
return func(vm *v1alpha2.VirtualMachine) {
167+
vm.Spec.VirtualMachineIPAddress = ipAddress
168+
}
169+
}

test/e2e/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ task runp
9494
- Set LABELS to run tests with specific label(https://onsi.github.io/ginkgo/#spec-labels).
9595
- Manage timeouts for new e2e tests (not for legacy tests) using env variables `E2E_SHORT_TIMEOUT`, `E2E_MIDDLE_TIMEOUT`, `E2E_LONG_TIMEOUT` and `E2E_MAX_TIMEOUT`.
9696

97-
For example, to run only the "ComplexTest" and leave all created resources in the cluster, use the following command:
97+
For example, to run only one test and leave all created resources in the cluster, use the following command:
9898
```bash
99-
FOCUS="ComplexTest" POST_CLEANUP=no task run
99+
FOCUS="VirtualMachineConnectivity" POST_CLEANUP=no task run
100100
```
101101

102102
### PostCleanUp option

test/e2e/blockdevice/virtual_disk_provisioning.go

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ var _ = Describe("VirtualDiskProvisioning", Label(precheck.NoPrecheck), func() {
4747
DeferCleanup(f.After)
4848
})
4949

50-
// Other cases are currently covered in ComplexTest
51-
// After splitting ComplexTest, the remaining disk provisioning checks will also be located here
5250
It("verifies that a VirtualDisk is provisioned successfully from a VirtualImage on a PVC", func() {
5351
var (
5452
vi *v1alpha2.VirtualImage
@@ -90,4 +88,91 @@ var _ = Describe("VirtualDiskProvisioning", Label(precheck.NoPrecheck), func() {
9088
util.UntilObjectPhase(string(v1alpha2.DiskReady), framework.LongTimeout, vd)
9189
})
9290
})
91+
92+
It("verifies that a VirtualDisk is provisioned successfully from a VirtualImage on dvcr", func() {
93+
var (
94+
vi *v1alpha2.VirtualImage
95+
vd *v1alpha2.VirtualDisk
96+
)
97+
By("Creating VirtualImage", func() {
98+
vi = object.NewGeneratedVIFromCVI("vi-", f.Namespace().Name, object.PrecreatedCVIAlpineUEFI)
99+
err := f.CreateWithDeferredDeletion(context.Background(), vi)
100+
Expect(err).NotTo(HaveOccurred())
101+
})
102+
103+
By("Waiting for VirtualImage to be ready", func() {
104+
util.UntilObjectPhase(string(v1alpha2.ImageReady), framework.LongTimeout, vi)
105+
})
106+
107+
By("Creating VirtualDisk", func() {
108+
vd = object.NewVDFromVI("vd", f.Namespace().Name, vi, vdbuilder.WithSize(ptr.To(resource.MustParse("350Mi"))))
109+
err := f.CreateWithDeferredDeletion(context.Background(), vd)
110+
Expect(err).NotTo(HaveOccurred())
111+
})
112+
113+
By("Waiting for VirtualDisk to be ready", func() {
114+
util.UntilObjectPhase(string(v1alpha2.DiskReady), framework.LongTimeout, vd)
115+
})
116+
117+
By("Creating VirtualMachine and waiting for VirtualMachine to be ready", func() {
118+
vm := object.NewMinimalVM("vm-", f.Namespace().Name, vmbuilder.WithBlockDeviceRefs(v1alpha2.BlockDeviceSpecRef{
119+
Kind: v1alpha2.VirtualDiskKind,
120+
Name: vd.Name,
121+
}))
122+
err := f.CreateWithDeferredDeletion(context.Background(), vm)
123+
Expect(err).NotTo(HaveOccurred())
124+
125+
util.UntilObjectPhase(string(v1alpha2.MachineRunning), framework.LongTimeout, vm)
126+
})
127+
})
128+
129+
It("verifies that a VirtualDisk is provisioned successfully from a ClusterVirtualImage", func() {
130+
var vd *v1alpha2.VirtualDisk
131+
132+
By("Creating VirtualDisk", func() {
133+
vd = object.NewVDFromCVI("vd", f.Namespace().Name, object.PrecreatedCVIAlpineBIOS, vdbuilder.WithSize(ptr.To(resource.MustParse("350Mi"))))
134+
err := f.CreateWithDeferredDeletion(context.Background(), vd)
135+
Expect(err).NotTo(HaveOccurred())
136+
})
137+
138+
By("Waiting for VirtualDisk to be ready", func() {
139+
util.UntilObjectPhase(string(v1alpha2.DiskReady), framework.LongTimeout, vd)
140+
})
141+
142+
By("Creating VirtualMachine and waiting for VirtualMachine to be ready", func() {
143+
vm := object.NewMinimalVM("vm-", f.Namespace().Name, vmbuilder.WithBlockDeviceRefs(v1alpha2.BlockDeviceSpecRef{
144+
Kind: v1alpha2.VirtualDiskKind,
145+
Name: vd.Name,
146+
}))
147+
err := f.CreateWithDeferredDeletion(context.Background(), vm)
148+
Expect(err).NotTo(HaveOccurred())
149+
150+
util.UntilObjectPhase(string(v1alpha2.MachineRunning), framework.LongTimeout, vm)
151+
})
152+
})
153+
154+
It("verifies that a VirtualDisk is provisioned successfully from a http", func() {
155+
var vd *v1alpha2.VirtualDisk
156+
157+
By("Creating VirtualDisk", func() {
158+
vd = object.NewHTTPVDAlpineBIOS("vd", f.Namespace().Name, vdbuilder.WithSize(ptr.To(resource.MustParse("350Mi"))))
159+
err := f.CreateWithDeferredDeletion(context.Background(), vd)
160+
Expect(err).NotTo(HaveOccurred())
161+
})
162+
163+
By("Waiting for VirtualDisk to be ready", func() {
164+
util.UntilObjectPhase(string(v1alpha2.DiskReady), framework.LongTimeout, vd)
165+
})
166+
167+
By("Creating VirtualMachine and waiting for VirtualMachine to be ready", func() {
168+
vm := object.NewMinimalVM("vm-", f.Namespace().Name, vmbuilder.WithBlockDeviceRefs(v1alpha2.BlockDeviceSpecRef{
169+
Kind: v1alpha2.VirtualDiskKind,
170+
Name: vd.Name,
171+
}))
172+
err := f.CreateWithDeferredDeletion(context.Background(), vm)
173+
Expect(err).NotTo(HaveOccurred())
174+
175+
util.UntilObjectPhase(string(v1alpha2.MachineRunning), framework.LongTimeout, vm)
176+
})
177+
})
93178
})

test/e2e/default_config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ clusterTransport:
1212
helperImages:
1313
curlImage: "curlimages/curl"
1414
testData:
15-
complexTest: "/tmp/testdata/complex-test"
1615
diskResizing: "/tmp/testdata/disk-resizing"
1716
imageHotplug: "/tmp/testdata/image-hotplug"
1817
sizingPolicy: "/tmp/testdata/sizing-policy"

test/e2e/internal/config/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ type Config struct {
8282
}
8383

8484
type TestData struct {
85-
ComplexTest string `yaml:"complexTest"`
8685
DiskResizing string `yaml:"diskResizing"`
8786
ImageHotplug string `yaml:"imageHotplug"`
8887
VMMigration string `yaml:"vmMigration"`

0 commit comments

Comments
 (0)