Skip to content

Commit

Permalink
container_disk_test: reuse tests.RunVMI()
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
  • Loading branch information
dankenigsberg committed Feb 17, 2022
1 parent 3d8e2c1 commit d32ebad
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions tests/container_disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ var _ = Describe("[rfe_id:588][crit:medium][vendor:cnv-qe@redhat.com][level:comp
tests.BeforeTestCleanup()
})

LaunchVMI := func(vmi *v1.VirtualMachineInstance) runtime.Object {
By("Starting a VirtualMachineInstance")
obj, err := virtClient.RestClient().Post().Resource("virtualmachineinstances").Namespace(util.NamespaceTestDefault).Body(vmi).Do(context.Background()).Get()
Expect(err).To(BeNil())
return obj
}

verifyContainerDiskVMI := func(vmi *v1.VirtualMachineInstance, obj runtime.Object) {
_, ok := obj.(*v1.VirtualMachineInstance)
Expect(ok).To(BeTrue(), "Object is not of type *v1.VirtualMachineInstance")
Expand Down Expand Up @@ -186,7 +179,7 @@ var _ = Describe("[rfe_id:588][crit:medium][vendor:cnv-qe@redhat.com][level:comp
vmi := tests.NewRandomVMIWithEphemeralDiskAndUserdata(cd.ContainerDiskFor(cd.ContainerDiskCirros), "#!/bin/bash\necho 'hello'\n")
// FIXME if we give too much ram, the vmis really boot and eat all our memory (cache?)
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1M")
obj := LaunchVMI(vmi)
obj := tests.RunVMI(vmi, 10)
vmis = append(vmis, vmi)
objs = append(objs, obj)
}
Expand Down

0 comments on commit d32ebad

Please sign in to comment.