mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
e2e: add labels for device, resource, mode, app
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
This commit is contained in:
parent
b38141d835
commit
9ccdbf3e05
@ -39,7 +39,7 @@ const (
|
||||
)
|
||||
|
||||
func init() {
|
||||
ginkgo.Describe("DLB plugin", describe)
|
||||
ginkgo.Describe("DLB plugin [Device:dlb]", describe)
|
||||
}
|
||||
|
||||
func describe() {
|
||||
@ -81,7 +81,7 @@ func describe() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.Context("When PF resources are available", func() {
|
||||
ginkgo.Context("When PF resources are available [Resource:pf]", func() {
|
||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||
resource := v1.ResourceName("dlb.intel.com/pf")
|
||||
if err := utils.WaitForNodesWithResource(ctx, f.ClientSet, resource, 30*time.Second); err != nil {
|
||||
@ -89,12 +89,16 @@ func describe() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.It("can run demo app", func(ctx context.Context) {
|
||||
ginkgo.It("can run demo app [App:libdlb]", func(ctx context.Context) {
|
||||
runDemoApp(ctx, "PF", demoPFYaml, f)
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
|
||||
ginkgo.Context("When VF resources are available", func() {
|
||||
ginkgo.Context("When VF resources are available [Resource:vf]", func() {
|
||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||
resource := v1.ResourceName("dlb.intel.com/vf")
|
||||
if err := utils.WaitForNodesWithResource(ctx, f.ClientSet, resource, 30*time.Second); err != nil {
|
||||
@ -102,9 +106,13 @@ func describe() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.It("can run demo app", func(ctx context.Context) {
|
||||
ginkgo.It("can run demo app [App:libdlb]", func(ctx context.Context) {
|
||||
runDemoApp(ctx, "VF", demoVFYaml, f)
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ const (
|
||||
)
|
||||
|
||||
func init() {
|
||||
ginkgo.Describe("DSA plugin", describe)
|
||||
ginkgo.Describe("DSA plugin [Device:dsa]", describe)
|
||||
}
|
||||
|
||||
func describe() {
|
||||
@ -94,7 +94,7 @@ func describe() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.Context("When DSA resources are available", func() {
|
||||
ginkgo.Context("When DSA resources are available [Resource:dedicated]", func() {
|
||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||
ginkgo.By("checking if the resource is allocatable")
|
||||
if err := utils.WaitForNodesWithResource(ctx, f.ClientSet, "dsa.intel.com/wq-user-dedicated", 300*time.Second); err != nil {
|
||||
@ -102,12 +102,16 @@ func describe() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.It("deploys a demo app", func(ctx context.Context) {
|
||||
ginkgo.It("deploys a demo app [App:accel-config]", func(ctx context.Context) {
|
||||
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-f", demoPath)
|
||||
|
||||
ginkgo.By("waiting for the DSA demo to succeed")
|
||||
err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, podName, f.Namespace.Name, 200*time.Second)
|
||||
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, podName, podName))
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ const (
|
||||
)
|
||||
|
||||
func init() {
|
||||
ginkgo.Describe("FPGA Plugin", describe)
|
||||
ginkgo.Describe("FPGA Plugin [Device:fpga]", describe)
|
||||
}
|
||||
|
||||
func describe() {
|
||||
@ -64,23 +64,43 @@ func describe() {
|
||||
fmw := framework.NewDefaultFramework("fpgaplugin-e2e")
|
||||
fmw.NamespacePodSecurityEnforceLevel = admissionapi.LevelPrivileged
|
||||
|
||||
ginkgo.Context("When FPGA plugin is running in region mode", func() {
|
||||
ginkgo.Context("When FPGA plugin is running in region mode [Mode:region]", func() {
|
||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||
runDevicePlugin(ctx, fmw, pluginKustomizationPath, mappingsCollectionPath, arria10NodeResource, "region")
|
||||
})
|
||||
ginkgo.It("runs an opae-nlb-demo pod two times", func(ctx context.Context) {
|
||||
ginkgo.It("runs an opae-nlb-demo pod two times [App:opae-nlb-demo]", func(ctx context.Context) {
|
||||
runTestCase(ctx, fmw, "region", nlb3PodResource, "nlb3", "nlb0")
|
||||
runTestCase(ctx, fmw, "region", nlb0PodResource, "nlb0", "nlb3")
|
||||
})
|
||||
})
|
||||
|
||||
ginkgo.Context("When FPGA plugin is running in af mode", func() {
|
||||
ginkgo.Context("When FPGA plugin is running in af mode [Mode:af]", func() {
|
||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||
runDevicePlugin(ctx, fmw, pluginKustomizationPath, mappingsCollectionPath, nlb0NodeResource, "af")
|
||||
})
|
||||
ginkgo.It("runs an opae-nlb-demo pod", func(ctx context.Context) {
|
||||
ginkgo.It("runs an opae-nlb-demo pod [App:opae-nlb-demo]", func(ctx context.Context) {
|
||||
runTestCase(ctx, fmw, "af", nlb0PodResourceAF, "nlb0", "nlb3")
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
|
||||
ginkgo.Context("When FPGA plugin is running in region mode [Mode:region]", func() {
|
||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||
runDevicePlugin(ctx, fmw, pluginKustomizationPath, mappingsCollectionPath, arria10NodeResource, "region")
|
||||
})
|
||||
ginkgo.It("runs [App:opae-nlb-demo]", func(ctx context.Context) {
|
||||
runTestCase(ctx, fmw, "region", nlb3PodResource, "nlb3", "nlb0")
|
||||
})
|
||||
ginkgo.It("runs an opae-nlb-demo pod [App:opae-nlb-demo]", func(ctx context.Context) {
|
||||
runTestCase(ctx, fmw, "region", nlb0PodResource, "nlb0", "nlb3")
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ const (
|
||||
)
|
||||
|
||||
func init() {
|
||||
ginkgo.Describe("GPU plugin", describe)
|
||||
ginkgo.Describe("GPU plugin [Device:gpu]", describe)
|
||||
}
|
||||
|
||||
func describe() {
|
||||
@ -74,14 +74,14 @@ func describe() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.Context("When GPU resources are available", func() {
|
||||
ginkgo.Context("When GPU resources are available [Resource:i915]", func() {
|
||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||
ginkgo.By("checking if the resource is allocatable")
|
||||
if err := utils.WaitForNodesWithResource(ctx, f.ClientSet, "gpu.intel.com/i915", 30*time.Second); err != nil {
|
||||
framework.Failf("unable to wait for nodes to have positive allocatable resource: %v", err)
|
||||
}
|
||||
})
|
||||
ginkgo.It("checks availability of GPU resources", func(ctx context.Context) {
|
||||
ginkgo.It("checks availability of GPU resources [App:busybox]", func(ctx context.Context) {
|
||||
ginkgo.By("submitting a pod requesting GPU resources")
|
||||
podSpec := &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "gpuplugin-tester"},
|
||||
@ -122,7 +122,7 @@ func describe() {
|
||||
framework.Logf("found card and renderD from the log")
|
||||
})
|
||||
|
||||
ginkgo.It("run a small workload on the GPU", func(ctx context.Context) {
|
||||
ginkgo.It("run a small workload on the GPU [App:tensorflow]", func(ctx context.Context) {
|
||||
kustomYaml, err := utils.LocateRepoFile(tfKustomizationYaml)
|
||||
if err != nil {
|
||||
framework.Failf("unable to locate %q: %v", tfKustomizationYaml, err)
|
||||
@ -139,5 +139,9 @@ func describe() {
|
||||
|
||||
framework.Logf("tensorflow execution succeeded!")
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ const (
|
||||
)
|
||||
|
||||
func init() {
|
||||
ginkgo.Describe("IAA plugin", describe)
|
||||
ginkgo.Describe("IAA plugin [Device:iaa]", describe)
|
||||
}
|
||||
|
||||
func describe() {
|
||||
@ -94,7 +94,7 @@ func describe() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.Context("When IAA resources are available", func() {
|
||||
ginkgo.Context("When IAA resources are available [Resource:dedicated]", func() {
|
||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||
ginkgo.By("checking if the resource is allocatable")
|
||||
if err := utils.WaitForNodesWithResource(ctx, f.ClientSet, "iaa.intel.com/wq-user-dedicated", 300*time.Second); err != nil {
|
||||
@ -102,12 +102,16 @@ func describe() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.It("deploys a demo app", func(ctx context.Context) {
|
||||
ginkgo.It("deploys a demo app [App:accel-config]", func(ctx context.Context) {
|
||||
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-f", demoPath)
|
||||
|
||||
ginkgo.By("waiting for the IAA demo to succeed")
|
||||
err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, podName, f.Namespace.Name, 300*time.Second)
|
||||
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, podName, podName))
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ const (
|
||||
)
|
||||
|
||||
func init() {
|
||||
ginkgo.Describe("QAT plugin in DPDK mode", describeQatDpdkPlugin)
|
||||
ginkgo.Describe("QAT plugin in DPDK mode [Device:qat] [Mode:dpdk]", describeQatDpdkPlugin)
|
||||
}
|
||||
|
||||
func describeQatDpdkPlugin() {
|
||||
@ -118,7 +118,7 @@ func describeQatDpdkPlugin() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.Context("When QAT Gen4 resources are available with crypto (cy) services enabled", func() {
|
||||
ginkgo.Context("When QAT Gen4 resources are available with crypto (cy) services enabled [Resource:cy]", func() {
|
||||
// This BeforeEach runs even before the JustBeforeEach above.
|
||||
ginkgo.BeforeEach(func() {
|
||||
ginkgo.By("creating a configMap before plugin gets deployed")
|
||||
@ -128,11 +128,11 @@ func describeQatDpdkPlugin() {
|
||||
resourceName = "qat.intel.com/cy"
|
||||
})
|
||||
|
||||
ginkgo.It("deploys a crypto pod (openssl) requesting QAT resources", func(ctx context.Context) {
|
||||
ginkgo.It("deploys a crypto pod (openssl) requesting QAT resources [App:openssl]", func(ctx context.Context) {
|
||||
runCpaSampleCode(ctx, f, symmetric, resourceName)
|
||||
})
|
||||
|
||||
ginkgo.It("deploys a crypto pod (dpdk crypto-perf) requesting QAT resources", func(ctx context.Context) {
|
||||
ginkgo.It("deploys a crypto pod (dpdk crypto-perf) requesting QAT resources [App:crypto-perf]", func(ctx context.Context) {
|
||||
ginkgo.By("submitting a crypto pod requesting QAT resources")
|
||||
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-k", filepath.Dir(cryptoTestGen4YamlPath))
|
||||
|
||||
@ -140,9 +140,13 @@ func describeQatDpdkPlugin() {
|
||||
err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, "qat-dpdk-test-crypto-perf-tc1-gen4", f.Namespace.Name, 300*time.Second)
|
||||
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, "qat-dpdk-test-crypto-perf-tc1-gen4", "crypto-perf"))
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
|
||||
ginkgo.Context("When QAT Gen4 resources are available with compress (dc) services enabled", func() {
|
||||
ginkgo.Context("When QAT Gen4 resources are available with compress (dc) services enabled [Resource:dc]", func() {
|
||||
ginkgo.BeforeEach(func() {
|
||||
ginkgo.By("creating a configMap before plugin gets deployed")
|
||||
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "create", "configmap", "--from-literal", "qat.conf=ServicesEnabled=dc", "qat-config")
|
||||
@ -151,18 +155,22 @@ func describeQatDpdkPlugin() {
|
||||
resourceName = "qat.intel.com/dc"
|
||||
})
|
||||
|
||||
ginkgo.It("deploys a compress pod (openssl) requesting QAT resources", func(ctx context.Context) {
|
||||
ginkgo.It("deploys a compress pod (openssl) requesting QAT resources [App:openssl]", func(ctx context.Context) {
|
||||
runCpaSampleCode(ctx, f, compression, resourceName)
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
|
||||
ginkgo.Context("When QAT Gen2 resources are available", func() {
|
||||
ginkgo.Context("When QAT Gen2 resources are available [Resource:generic]", func() {
|
||||
ginkgo.BeforeEach(func() {
|
||||
ginkgo.By("setting resourceName for Gen2 resources")
|
||||
resourceName = "qat.intel.com/generic"
|
||||
})
|
||||
|
||||
ginkgo.It("deploys a crypto pod requesting QAT resources", func(ctx context.Context) {
|
||||
ginkgo.It("deploys a crypto pod requesting QAT resources [App:crypto-perf]", func(ctx context.Context) {
|
||||
ginkgo.By("submitting a crypto pod requesting QAT resources")
|
||||
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-k", filepath.Dir(cryptoTestYamlPath))
|
||||
|
||||
@ -172,7 +180,7 @@ func describeQatDpdkPlugin() {
|
||||
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, demoPodName, demoPodContainerName))
|
||||
})
|
||||
|
||||
ginkgo.It("deploys a compress pod requesting QAT resources", func(ctx context.Context) {
|
||||
ginkgo.It("deploys a compress pod requesting QAT resources [App:compress-perf]", func(ctx context.Context) {
|
||||
ginkgo.By("submitting a compress pod requesting QAT resources")
|
||||
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-k", filepath.Dir(compressTestYamlPath))
|
||||
|
||||
@ -181,6 +189,10 @@ func describeQatDpdkPlugin() {
|
||||
err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, demoPodName, f.Namespace.Name, 60*time.Second)
|
||||
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, demoPodName, demoPodContainerName))
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ const (
|
||||
)
|
||||
|
||||
func init() {
|
||||
ginkgo.Describe("QAT plugin in kernel mode", describeQatKernelPlugin)
|
||||
ginkgo.Describe("QAT plugin in kernel mode [Device:qat] [Mode:kernel]", describeQatKernelPlugin)
|
||||
}
|
||||
|
||||
func describeQatKernelPlugin() {
|
||||
@ -79,7 +79,7 @@ func describeQatKernelPlugin() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.Context("When QAT resources are available", func() {
|
||||
ginkgo.Context("When QAT resources are available [Resource:cy1_dc0]", func() {
|
||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||
ginkgo.By("checking if the resource is allocatable")
|
||||
if err := utils.WaitForNodesWithResource(ctx, f.ClientSet, "qat.intel.com/cy1_dc0", 30*time.Second); err != nil {
|
||||
@ -87,7 +87,7 @@ func describeQatKernelPlugin() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.It("deploys a pod requesting QAT resources", func(ctx context.Context) {
|
||||
ginkgo.It("deploys a pod requesting QAT resources [App:busybox]", func(ctx context.Context) {
|
||||
ginkgo.By("submitting a pod requesting QAT resources")
|
||||
podSpec := &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "qatplugin-tester"},
|
||||
@ -114,5 +114,9 @@ func describeQatKernelPlugin() {
|
||||
ginkgo.By("waiting the pod to finish successfully")
|
||||
e2epod.NewPodClient(f).WaitForFinish(ctx, pod.ObjectMeta.Name, 60*time.Second)
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ const (
|
||||
)
|
||||
|
||||
func init() {
|
||||
ginkgo.Describe("SGX plugin", describe)
|
||||
ginkgo.Describe("SGX plugin [Device:sgx]", describe)
|
||||
}
|
||||
|
||||
func describe() {
|
||||
@ -93,7 +93,7 @@ func describe() {
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.It("deploys a sgx-sdk-demo pod requesting SGX enclave resources", func(ctx context.Context) {
|
||||
ginkgo.It("deploys a sgx-sdk-demo pod requesting SGX enclave resources [App:sgx-sdk-demo]", func(ctx context.Context) {
|
||||
podSpec := &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "sgxplugin-tester"},
|
||||
Spec: v1.PodSpec{
|
||||
@ -119,6 +119,10 @@ func describe() {
|
||||
err = e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, pod.ObjectMeta.Name, f.Namespace.Name, 60*time.Second)
|
||||
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, pod.ObjectMeta.Name, "testcontainer"))
|
||||
})
|
||||
|
||||
ginkgo.When("there is no app to run [App:noapp]", func() {
|
||||
ginkgo.It("does nothing", func() {})
|
||||
})
|
||||
})
|
||||
|
||||
ginkgo.AfterEach(func() {
|
||||
|
Loading…
Reference in New Issue
Block a user