mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
e2e, qat: divide single It() to have multiple layers
Structure is as follows: Describe("QAT plugin") BeforeEach("deploys plugin") Context("When device resources are available") BeforeEach("checks if resources are available") It("runs a pod requesting resources") It("runs another pod requesting resources if there is") Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
This commit is contained in:
parent
77ad32e008
commit
3286baadb5
@ -57,7 +57,7 @@ func describeQatDpdkPlugin() {
|
|||||||
framework.Failf("unable to locate %q: %v", cryptoTestYaml, err)
|
framework.Failf("unable to locate %q: %v", cryptoTestYaml, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.It("measures performance of DPDK", func() {
|
ginkgo.BeforeEach(func() {
|
||||||
ginkgo.By("deploying QAT plugin in DPDK mode")
|
ginkgo.By("deploying QAT plugin in DPDK mode")
|
||||||
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-k", filepath.Dir(kustomizationPath))
|
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-k", filepath.Dir(kustomizationPath))
|
||||||
|
|
||||||
@ -74,22 +74,30 @@ func describeQatDpdkPlugin() {
|
|||||||
if err := utils.TestPodsFileSystemInfo(podList.Items); err != nil {
|
if err := utils.TestPodsFileSystemInfo(podList.Items); err != nil {
|
||||||
framework.Failf("container filesystem info checks failed: %v", err)
|
framework.Failf("container filesystem info checks failed: %v", err)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
ginkgo.Context("When QAT resources are available", func() {
|
||||||
|
ginkgo.BeforeEach(func() {
|
||||||
ginkgo.By("checking if the resource is allocatable")
|
ginkgo.By("checking if the resource is allocatable")
|
||||||
if err := utils.WaitForNodesWithResource(f.ClientSet, "qat.intel.com/generic", 30*time.Second); err != nil {
|
if err := utils.WaitForNodesWithResource(f.ClientSet, "qat.intel.com/generic", 30*time.Second); err != nil {
|
||||||
framework.Failf("unable to wait for nodes to have positive allocatable resource: %v", err)
|
framework.Failf("unable to wait for nodes to have positive allocatable resource: %v", err)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
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", "-k", filepath.Dir(cryptoTestYamlPath))
|
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-k", filepath.Dir(cryptoTestYamlPath))
|
||||||
|
|
||||||
ginkgo.By("waiting the crypto pod to finish successfully")
|
ginkgo.By("waiting the crypto pod to finish successfully")
|
||||||
e2epod.NewPodClient(f).WaitForSuccess("qat-dpdk-test-crypto-perf-tc1", 60*time.Second)
|
e2epod.NewPodClient(f).WaitForSuccess("qat-dpdk-test-crypto-perf-tc1", 60*time.Second)
|
||||||
|
})
|
||||||
|
|
||||||
|
ginkgo.It("deploys a compress pod requesting QAT resources", func() {
|
||||||
ginkgo.By("submitting a compress pod requesting QAT resources")
|
ginkgo.By("submitting a compress pod requesting QAT resources")
|
||||||
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-k", filepath.Dir(compressTestYamlPath))
|
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-k", filepath.Dir(compressTestYamlPath))
|
||||||
|
|
||||||
ginkgo.By("waiting the compress pod to finish successfully")
|
ginkgo.By("waiting the compress pod to finish successfully")
|
||||||
e2epod.NewPodClient(f).WaitForSuccess("qat-dpdk-test-compress-perf-tc1", 60*time.Second)
|
e2epod.NewPodClient(f).WaitForSuccess("qat-dpdk-test-compress-perf-tc1", 60*time.Second)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ func describeQatKernelPlugin() {
|
|||||||
framework.Failf("unable to locate %q: %v", qatPluginKernelYaml, err)
|
framework.Failf("unable to locate %q: %v", qatPluginKernelYaml, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.It("checks availability of QAT resources", func() {
|
ginkgo.BeforeEach(func() {
|
||||||
ginkgo.By("deploying QAT plugin in kernel mode")
|
ginkgo.By("deploying QAT plugin in kernel mode")
|
||||||
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "create", "-f", yamlPath)
|
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "create", "-f", yamlPath)
|
||||||
|
|
||||||
@ -66,12 +66,17 @@ func describeQatKernelPlugin() {
|
|||||||
if err = utils.TestPodsFileSystemInfo(podList.Items); err != nil {
|
if err = utils.TestPodsFileSystemInfo(podList.Items); err != nil {
|
||||||
framework.Failf("container filesystem info checks failed: %v", err)
|
framework.Failf("container filesystem info checks failed: %v", err)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
ginkgo.Context("When QAT resources are available", func() {
|
||||||
|
ginkgo.BeforeEach(func() {
|
||||||
ginkgo.By("checking if the resource is allocatable")
|
ginkgo.By("checking if the resource is allocatable")
|
||||||
if err = utils.WaitForNodesWithResource(f.ClientSet, "qat.intel.com/cy1_dc0", 30*time.Second); err != nil {
|
if err := utils.WaitForNodesWithResource(f.ClientSet, "qat.intel.com/cy1_dc0", 30*time.Second); err != nil {
|
||||||
framework.Failf("unable to wait for nodes to have positive allocatable resource: %v", err)
|
framework.Failf("unable to wait for nodes to have positive allocatable resource: %v", err)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
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{
|
||||||
ObjectMeta: metav1.ObjectMeta{Name: "qatplugin-tester"},
|
ObjectMeta: metav1.ObjectMeta{Name: "qatplugin-tester"},
|
||||||
@ -98,4 +103,5 @@ func describeQatKernelPlugin() {
|
|||||||
ginkgo.By("waiting the pod to finish successfully")
|
ginkgo.By("waiting the pod to finish successfully")
|
||||||
e2epod.NewPodClient(f).WaitForFinish(pod.ObjectMeta.Name, 60*time.Second)
|
e2epod.NewPodClient(f).WaitForFinish(pod.ObjectMeta.Name, 60*time.Second)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ func describeQatPluginCy() {
|
|||||||
framework.Failf("unable to locate %q: %v", opensslTestYaml, err)
|
framework.Failf("unable to locate %q: %v", opensslTestYaml, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.It("measures performance of QAT Cy Services", func() {
|
ginkgo.BeforeEach(func() {
|
||||||
ginkgo.By("deploying QAT plugin in DPDK mode")
|
ginkgo.By("deploying QAT plugin in DPDK mode")
|
||||||
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-k", filepath.Dir(kustomizationPath))
|
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-k", filepath.Dir(kustomizationPath))
|
||||||
|
|
||||||
@ -68,12 +68,17 @@ func describeQatPluginCy() {
|
|||||||
if err := utils.TestPodsFileSystemInfo(podList.Items); err != nil {
|
if err := utils.TestPodsFileSystemInfo(podList.Items); err != nil {
|
||||||
framework.Failf("container filesystem info checks failed: %v", err)
|
framework.Failf("container filesystem info checks failed: %v", err)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
ginkgo.Context("When QAT4 resources are available", func() {
|
||||||
|
ginkgo.BeforeEach(func() {
|
||||||
ginkgo.By("checking if the resource is allocatable")
|
ginkgo.By("checking if the resource is allocatable")
|
||||||
if err := utils.WaitForNodesWithResource(f.ClientSet, "qat.intel.com/cy", 30*time.Second); err != nil {
|
if err := utils.WaitForNodesWithResource(f.ClientSet, "qat.intel.com/cy", 30*time.Second); err != nil {
|
||||||
framework.Failf("unable to wait for nodes to have positive allocatable resource: %v", err)
|
framework.Failf("unable to wait for nodes to have positive allocatable resource: %v", err)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
@ -84,4 +89,5 @@ func describeQatPluginCy() {
|
|||||||
|
|
||||||
framework.Logf("cpa_sample_code output:\n %s", output)
|
framework.Logf("cpa_sample_code output:\n %s", output)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user