Merge pull request #1388 from hj-johannes-lee/e2e-fix-aftereach

e2e: fix aftereach to be in the correct location
This commit is contained in:
Mikko Ylinen 2023-04-24 16:29:43 +03:00 committed by GitHub
commit 73e4750140
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 24 deletions

View File

@ -85,6 +85,14 @@ func describe() {
} }
}) })
ginkgo.AfterEach(func() {
ginkgo.By("undeploying DSA plugin")
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "delete", "-k", filepath.Dir(kustomizationPath))
if err := e2epod.WaitForPodNotFoundInNamespace(f.ClientSet, dpPodName, f.Namespace.Name, 30*time.Second); err != nil {
framework.Failf("failed to terminate pod: %v", err)
}
})
ginkgo.Context("When DSA resources are available", func() { ginkgo.Context("When DSA resources are available", func() {
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
ginkgo.By("checking if the resource is allocatable") ginkgo.By("checking if the resource is allocatable")
@ -93,14 +101,6 @@ func describe() {
} }
}) })
ginkgo.AfterEach(func() {
ginkgo.By("undeploying DSA plugin")
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "delete", "-k", filepath.Dir(kustomizationPath))
if err := e2epod.WaitForPodNotFoundInNamespace(f.ClientSet, dpPodName, f.Namespace.Name, 30*time.Second); err != nil {
framework.Failf("failed to terminate pod: %v", err)
}
})
ginkgo.It("deploys a demo app", func() { ginkgo.It("deploys a demo app", func() {
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-f", demoPath) e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-f", demoPath)

View File

@ -85,6 +85,14 @@ func describeQatDpdkPlugin() {
} }
}) })
ginkgo.AfterEach(func() {
ginkgo.By("undeploying QAT plugin")
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "delete", "-k", filepath.Dir(kustomizationPath))
if err := e2epod.WaitForPodNotFoundInNamespace(f.ClientSet, dpPodName, f.Namespace.Name, 30*time.Second); err != nil {
framework.Failf("failed to terminate pod: %v", err)
}
})
ginkgo.Context("When QAT Gen4 resources are available", func() { ginkgo.Context("When QAT Gen4 resources are available", func() {
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
ginkgo.By("checking if the resource is allocatable") ginkgo.By("checking if the resource is allocatable")
@ -93,14 +101,6 @@ func describeQatDpdkPlugin() {
} }
}) })
ginkgo.AfterEach(func() {
ginkgo.By("undeploying QAT plugin")
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "delete", "-k", filepath.Dir(kustomizationPath))
if err := e2epod.WaitForPodNotFoundInNamespace(f.ClientSet, dpPodName, f.Namespace.Name, 30*time.Second); err != nil {
framework.Failf("failed to terminate pod: %v", err)
}
})
ginkgo.It("deploys a crypto pod requesting QAT resources", func() { ginkgo.It("deploys a crypto pod requesting QAT resources", func() {
ginkgo.By("submitting a crypto pod requesting QAT resources") ginkgo.By("submitting a crypto pod requesting QAT resources")
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-f", opensslTestYamlPath) e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-f", opensslTestYamlPath)
@ -113,6 +113,7 @@ func describeQatDpdkPlugin() {
framework.Logf("cpa_sample_code output:\n %s", output) framework.Logf("cpa_sample_code output:\n %s", output)
}) })
}) })
ginkgo.Context("When QAT Gen2 resources are available", func() { ginkgo.Context("When QAT Gen2 resources are available", func() {
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
ginkgo.By("checking if the resource is allocatable") ginkgo.By("checking if the resource is allocatable")

View File

@ -71,6 +71,14 @@ func describeQatKernelPlugin() {
} }
}) })
ginkgo.AfterEach(func() {
ginkgo.By("undeploying QAT plugin")
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "delete", "-f", yamlPath)
if err := e2epod.WaitForPodNotFoundInNamespace(f.ClientSet, dpPodName, f.Namespace.Name, 30*time.Second); err != nil {
framework.Failf("failed to terminate pod: %v", err)
}
})
ginkgo.Context("When QAT resources are available", func() { ginkgo.Context("When QAT resources are available", func() {
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
ginkgo.By("checking if the resource is allocatable") ginkgo.By("checking if the resource is allocatable")
@ -79,14 +87,6 @@ func describeQatKernelPlugin() {
} }
}) })
ginkgo.AfterEach(func() {
ginkgo.By("undeploying QAT plugin")
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "delete", "-f", yamlPath)
if err := e2epod.WaitForPodNotFoundInNamespace(f.ClientSet, dpPodName, f.Namespace.Name, 30*time.Second); err != nil {
framework.Failf("failed to terminate pod: %v", err)
}
})
ginkgo.It("deploys a pod requesting QAT resources", func() { ginkgo.It("deploys a pod requesting QAT resources", func() {
ginkgo.By("submitting a pod requesting QAT resources") ginkgo.By("submitting a pod requesting QAT resources")
podSpec := &v1.Pod{ podSpec := &v1.Pod{