Add a test that a DV with preallocation means no discard on VMI
@@ -539,6 +539,26 @@ var _ = SIGDescribe("[Serial]DataVolume Integration", func() {
Describe("[rfe_id:3188][crit:high][vendor:cnv-qe@redhat.com][level:system] Starting a VirtualMachine with a DataVolume", func() {
Context("using Alpine http import", func() {
+ It("a DataVolume with preallocation shouldn't have discard=unmap", func() {
+ var vm *v1.VirtualMachine
+ vm = tests.NewRandomVMWithDataVolume(tests.GetUrl(tests.AlpineHttpUrl), tests.NamespaceTestDefault)
+ preallocation := true
+ vm.Spec.DataVolumeTemplates[0].Spec.Preallocation = &preallocation
+
+ vm, err = virtClient.VirtualMachine(tests.NamespaceTestDefault).Create(vm)
+ Expect(err).ToNot(HaveOccurred())
+
+ vm = tests.StartVirtualMachine(vm)
+ vmi, err := virtClient.VirtualMachineInstance(vm.Namespace).Get(vm.Name, &metav1.GetOptions{})
+ Expect(err).ToNot(HaveOccurred())
+
+ domXml, err := tests.GetRunningVirtualMachineInstanceDomainXML(virtClient, vmi)
+ Expect(err).ToNot(HaveOccurred())
+ Expect(domXml).ToNot(ContainSubstring("discard='unmap'"))
+ vm = tests.StopVirtualMachine(vm)
+ Expect(virtClient.VirtualMachine(vm.Namespace).Delete(vm.Name, &metav1.DeleteOptions{})).To(Succeed())
+ })
+
table.DescribeTable("[test_id:3191]should be successfully started and stopped multiple times", func(isHTTP bool) {
var vm *v1.VirtualMachine
if isHTTP {
