Clean existings vms in BeforeEach allows the reporter to dump the content of the launcher pod.
In case of failures, AfterEach cleaned the vms, so the reporter was not able to collect the logs of the launcher.
@@ -88,7 +88,7 @@ var _ = Describe("Multus", func() {
},
}
- AfterEach(func() {
+ BeforeEach(func() {
// Multus tests need to ensure that old VMIs are gone
Expect(virtClient.RestClient().Delete().Namespace(tests.NamespaceTestDefault).Resource("virtualmachineinstances").Do().Error()).To(Succeed())
Expect(virtClient.RestClient().Delete().Namespace(tests.NamespaceTestAlternative).Resource("virtualmachineinstances").Do().Error()).To(Succeed())
@@ -589,7 +589,7 @@ var _ = Describe("SRIOV", func() {
Expect(result.Error()).NotTo(HaveOccurred())
})
- AfterEach(func() {
+ BeforeEach(func() {
// Multus tests need to ensure that old VMIs are gone
Expect(virtClient.RestClient().Delete().Namespace(tests.NamespaceTestDefault).Resource("virtualmachineinstances").Do().Error()).To(Succeed())
Expect(virtClient.RestClient().Delete().Namespace(tests.NamespaceTestAlternative).Resource("virtualmachineinstances").Do().Error()).To(Succeed())
