From 9ccdbf3e05d2f59a0c49464903d52ffc1f47d8a6 Mon Sep 17 00:00:00 2001 From: Hyeongju Johannes Lee Date: Mon, 14 Aug 2023 18:50:11 +0300 Subject: [PATCH 1/4] e2e: add labels for device, resource, mode, app Signed-off-by: Hyeongju Johannes Lee --- test/e2e/dlb/dlb.go | 18 +++++++++++++----- test/e2e/dsa/dsa.go | 10 +++++++--- test/e2e/fpga/fpga.go | 30 +++++++++++++++++++++++++----- test/e2e/gpu/gpu.go | 12 ++++++++---- test/e2e/iaa/iaa.go | 10 +++++++--- test/e2e/qat/qatplugin_dpdk.go | 30 +++++++++++++++++++++--------- test/e2e/qat/qatplugin_kernel.go | 10 +++++++--- test/e2e/sgx/sgx.go | 8 ++++++-- 8 files changed, 94 insertions(+), 34 deletions(-) diff --git a/test/e2e/dlb/dlb.go b/test/e2e/dlb/dlb.go index 811db1738..fa6304909 100644 --- a/test/e2e/dlb/dlb.go +++ b/test/e2e/dlb/dlb.go @@ -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() {}) + }) }) } diff --git a/test/e2e/dsa/dsa.go b/test/e2e/dsa/dsa.go index 7ccee3d01..e2e871251 100644 --- a/test/e2e/dsa/dsa.go +++ b/test/e2e/dsa/dsa.go @@ -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() {}) + }) }) } diff --git a/test/e2e/fpga/fpga.go b/test/e2e/fpga/fpga.go index 5a33b2eb4..1c41d24e4 100644 --- a/test/e2e/fpga/fpga.go +++ b/test/e2e/fpga/fpga.go @@ -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() {}) + }) }) } diff --git a/test/e2e/gpu/gpu.go b/test/e2e/gpu/gpu.go index ff3d3c639..52747673a 100644 --- a/test/e2e/gpu/gpu.go +++ b/test/e2e/gpu/gpu.go @@ -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() {}) + }) }) } diff --git a/test/e2e/iaa/iaa.go b/test/e2e/iaa/iaa.go index 824149c09..50a79fc25 100644 --- a/test/e2e/iaa/iaa.go +++ b/test/e2e/iaa/iaa.go @@ -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() {}) + }) }) } diff --git a/test/e2e/qat/qatplugin_dpdk.go b/test/e2e/qat/qatplugin_dpdk.go index d6c86d96a..8c4783a2e 100644 --- a/test/e2e/qat/qatplugin_dpdk.go +++ b/test/e2e/qat/qatplugin_dpdk.go @@ -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() {}) + }) }) } diff --git a/test/e2e/qat/qatplugin_kernel.go b/test/e2e/qat/qatplugin_kernel.go index 042389d53..39ed28655 100644 --- a/test/e2e/qat/qatplugin_kernel.go +++ b/test/e2e/qat/qatplugin_kernel.go @@ -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() {}) + }) }) } diff --git a/test/e2e/sgx/sgx.go b/test/e2e/sgx/sgx.go index b7245ba59..b8bd2cf3a 100644 --- a/test/e2e/sgx/sgx.go +++ b/test/e2e/sgx/sgx.go @@ -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() { From 016a57af8868e1ca7812f93e10da09cd7913507b Mon Sep 17 00:00:00 2001 From: Hyeongju Johannes Lee Date: Thu, 24 Aug 2023 11:50:12 +0300 Subject: [PATCH 2/4] Makefile,e2e: add variables E2E_LEVEL, FOCUS and SKIP used for running subsets Signed-off-by: Hyeongju Johannes Lee --- Makefile | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 82c70e162..3de205d47 100644 --- a/Makefile +++ b/Makefile @@ -140,29 +140,39 @@ REG?=$(ORG)/ TAG?=devel export TAG +ifeq ($(E2E_LEVEL), $(filter $(E2E_LEVEL), full)) + GENERATED_SKIP_OPT=-ginkgo.skip "App:noapp" +else ifeq ($(E2E_LEVEL),basic) + ADDITIONAL_FOCUS_REGEX=App:noapp +else + $(error Unsupported E2E_LEVEL value: $(E2E_LEVEL). Possible options: full, basic) +endif +GENERATED_SKIP_OPT += $(if $(SKIP),-ginkgo.skip "$(SKIP)") +ADDITIONAL_FOCUS_REGEX := $(if $(FOCUS),$(FOCUS).*$(ADDITIONAL_FOCUS_REGEX),$(ADDITIONAL_FOCUS_REGEX)) + e2e-fpga: - @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "FPGA" -delete-namespace-on-failure=false + @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "Device:fpga.*$(ADDITIONAL_FOCUS_REGEX)" $(GENERATED_SKIP_OPT) -delete-namespace-on-failure=false e2e-qat: - @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "QAT Gen2" -delete-namespace-on-failure=false + @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "Device:qat.*$(ADDITIONAL_FOCUS_REGEX)" $(GENERATED_SKIP_OPT) -delete-namespace-on-failure=false e2e-qat4: - @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "QAT Gen4" -ginkgo.skip "dpdk crypto-perf" -delete-namespace-on-failure=false + @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "Device:qat4.*$(ADDITIONAL_FOCUS_REGEX)" $(GENERATED_SKIP_OPT) -delete-namespace-on-failure=false e2e-sgx: - @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "SGX" -delete-namespace-on-failure=false + @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "Device:sgx.*$(ADDITIONAL_FOCUS_REGEX)" $(GENERATED_SKIP_OPT) -delete-namespace-on-failure=false e2e-gpu: - @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "GPU" -delete-namespace-on-failure=false + @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "Device:gpu.*$(ADDITIONAL_FOCUS_REGEX)" $(GENERATED_SKIP_OPT) -delete-namespace-on-failure=false e2e-dsa: - @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "DSA" -delete-namespace-on-failure=false + @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "Device:dsa.*$(ADDITIONAL_FOCUS_REGEX)" $(GENERATED_SKIP_OPT) -delete-namespace-on-failure=false e2e-iaa: - @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "IAA" -delete-namespace-on-failure=false + @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "Device:iaa.*$(ADDITIONAL_FOCUS_REGEX)" $(GENERATED_SKIP_OPT) -delete-namespace-on-failure=false e2e-dlb: - @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "DLB" -delete-namespace-on-failure=false + @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "Device:dlb.*$(ADDITIONAL_FOCUS_REGEX)" $(GENERATED_SKIP_OPT) -delete-namespace-on-failure=false terrascan: @ls deployments/*/kustomization.yaml | while read f ; \ From 5513302408cee9862e28a5ece37279458ff8eceb Mon Sep 17 00:00:00 2001 From: Hyeongju Johannes Lee Date: Tue, 29 Aug 2023 13:18:21 +0300 Subject: [PATCH 3/4] e2e,qat4: use 'dc' 'cy' and 'generic' Strictly speaking, 'Gen4' and 'Gen2' are wrong expressions in this case, because Gen4 resources are read as 'generic' in VMs. To prevent any confusion, use just the names of the QAT services such as 'dc', 'cy' or 'generic' Signed-off-by: Hyeongju Johannes Lee --- .github/workflows/lib-e2e.yaml | 2 ++ Makefile | 3 --- test/e2e/qat/qatplugin_dpdk.go | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lib-e2e.yaml b/.github/workflows/lib-e2e.yaml index 14fd29b61..52ea848c8 100644 --- a/.github/workflows/lib-e2e.yaml +++ b/.github/workflows/lib-e2e.yaml @@ -34,9 +34,11 @@ jobs: runner: simics-gnr images: intel-iaa-plugin intel-idxd-config-initcontainer accel-config-demo intel-deviceplugin-operator - name: e2e-qat + targetjob: e2e-qat FOCUS=Resource:generic runner: qat images: intel-qat-plugin intel-qat-initcontainer crypto-perf - name: e2e-qat4 + targetjob: e2e-qat FOCUS="Mode:dpdk.*Resource:(cy|dc)" SKIP=App:crypto-perf runner: simics-spr images: intel-qat-plugin intel-qat-initcontainer openssl-qat-engine - name: e2e-sgx diff --git a/Makefile b/Makefile index 3de205d47..27e903dcf 100644 --- a/Makefile +++ b/Makefile @@ -156,9 +156,6 @@ e2e-fpga: e2e-qat: @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "Device:qat.*$(ADDITIONAL_FOCUS_REGEX)" $(GENERATED_SKIP_OPT) -delete-namespace-on-failure=false -e2e-qat4: - @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "Device:qat4.*$(ADDITIONAL_FOCUS_REGEX)" $(GENERATED_SKIP_OPT) -delete-namespace-on-failure=false - e2e-sgx: @$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.show-node-events -ginkgo.focus "Device:sgx.*$(ADDITIONAL_FOCUS_REGEX)" $(GENERATED_SKIP_OPT) -delete-namespace-on-failure=false diff --git a/test/e2e/qat/qatplugin_dpdk.go b/test/e2e/qat/qatplugin_dpdk.go index 8c4783a2e..58fe3dfb1 100644 --- a/test/e2e/qat/qatplugin_dpdk.go +++ b/test/e2e/qat/qatplugin_dpdk.go @@ -118,7 +118,7 @@ func describeQatDpdkPlugin() { } }) - ginkgo.Context("When QAT Gen4 resources are available with crypto (cy) services enabled [Resource:cy]", func() { + ginkgo.Context("When QAT 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") @@ -146,7 +146,7 @@ func describeQatDpdkPlugin() { }) }) - ginkgo.Context("When QAT Gen4 resources are available with compress (dc) services enabled [Resource:dc]", func() { + ginkgo.Context("When QAT 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") @@ -164,9 +164,9 @@ func describeQatDpdkPlugin() { }) }) - ginkgo.Context("When QAT Gen2 resources are available [Resource:generic]", func() { + ginkgo.Context("When QAT resources are available [Resource:generic]", func() { ginkgo.BeforeEach(func() { - ginkgo.By("setting resourceName for Gen2 resources") + ginkgo.By("setting resourceName for generic resources") resourceName = "qat.intel.com/generic" }) From 5347665895e8b304d0e6f2eae1e2141d0fab6181 Mon Sep 17 00:00:00 2001 From: Hyeongju Johannes Lee Date: Sat, 9 Sep 2023 00:49:42 +0300 Subject: [PATCH 4/4] doc: update DEVEL.md for e2e tests Signed-off-by: Hyeongju Johannes Lee --- DEVEL.md | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 9 deletions(-) diff --git a/DEVEL.md b/DEVEL.md index ffc686182..3c21b14f5 100644 --- a/DEVEL.md +++ b/DEVEL.md @@ -183,26 +183,99 @@ container images with the executables under test must be available in the cluster. If these two conditions are satisfied, run the tests with: ```bash -$ go test -v ./test/e2e/... +# Run all e2e tests in this repository +go test -v ./test/e2e/... ``` -In case you want to run only certain tests, e.g., QAT ones, run: +If you need to specify paths to your custom `kubeconfig` containing +embedded authentication info then add the `-kubeconfig` argument: ```bash -$ go test -v ./test/e2e/... -args -ginkgo.focus "QAT" +go test -v ./test/e2e/... -args -kubeconfig /path/to/kubeconfig ``` -If you need to specify paths to your custom `kubeconfig` containing -embedded authentication info then add the `-kubeconfig` argument: +The full list of available options can be obtained with: ```bash -$ go test -v ./test/e2e/... -args -kubeconfig /path/to/kubeconfig +go test ./test/e2e/... -args -help ``` -The full list of available options can be obtained with: +In most cases, it would not be possible to run all E2E tests in one system. +For running a subset of tests, there are labels that you can use to pick out specific parts. +You can run the tests with: +```bash +# Run a subset of tests +go test -v ./test/e2e/... -args -ginkgo.focus -ginkgo.skip +``` + +#### Table of Labels + +| Device | Mode | Resource | App | +|:-------|:-----------------|:------------|:-------------------------------| +| `dlb` |- | `pf`, `vf` | `libdlb` | +| `dsa` |- | `dedicated` | `accel-config` | +| `fpga` | `af`, `region` | | `opae-nlb-demo` | +| `gpu` |- | `i915` | `busybox`, `tensorflow` | +| `iaa` |- | `dedicated` | `accel-config` | +| `qat` | `dpdk` | `dc` | `openssl` | +| `qat` | `dpdk` | `cy` | `openssl`, `crypto-perf` | +| `qat` | `dpdk` | `generic` | `crypto-perf`, `compress-perf` | +| `qat` | `kernel` | `cy1_dc0` | `busybox` | +| `sgx` |- | | `sgx-sdk-demo` | + +#### Examples + +```bash +# DLB for VF resource without any app running +go test -v ./test/e2e/... -args -ginkgo.focus "Device:dlb.*Resource:vf.*App:noapp" + +# FPGA with af mode with opae-nlb-demo app running +go test -v ./test/e2e/... -args -ginkgo.focus "Device:fpga.*Mode:af.*App:opae-nlb-demo" + +# GPU with running only tensorflow app +go test -v ./test/e2e/... -args -ginkgo.focus "Device:gpu.*App:tensorflow" +#or +go test -v ./test/e2e/... -args -ginkgo.focus "Device:gpu" -ginkgo.skip "App:busybox" + +# QAT for qat4 cy resource with openssl app running +go test -v ./test/e2e/... -args -ginkgo.focus "Device:qat.*Resource:cy.*App:openssl" + +# QAT with dpdk mode for qat2 generic resource with all apps running +go test -v ./test/e2e/... -args -ginkgo.focus "Device:qat.*Resource:generic.*App:(crypto-perf|compress-perf)" + +# SGX without running sgx-sdk-demo app +go test -v ./test/e2e/... -args -ginkgo.focus "Device:sgx" -ginkgo.skip "App:sgx-sdk-demo" + +# All of Sapphire Rapids device plugins +go test -v ./test/e2e/... -args -ginkgo.focus "Device:(dlb|dsa|iaa|qat|sgx)" +``` + +## Predefined E2E Tests + +It is possible to run predefined e2e tests with: +``` +make e2e- [E2E_LEVEL={basic|full}] [FOCUS=] [SKIP=] +``` + +| `E2E_LEVEL` | Equivalent `FOCUS` or `SKIP` | Explanation | +:-------------- |:---------------------------- |:------------------------------------------------------------------------------------------------ | +| `basic` | `FOCUS=App:noapp` | `basic` does not run any app pod, but checks if the plugin works and the resources are available | +| `full` | `SKIP=App:noapp` | `full` checks all resources, runs all apps except the spec kept for no app running | + +### Examples ```bash -$ go test ./test/e2e/... -args -help +# DLB for both of pf and vf resources with running libdlb app +make e2e-dlb E2E_LEVEL=full + +# QAT for cy resource with running only openssl app +make e2e-qat FOCUS=Resource:cy.*App:openssl + +# QAT for dc resource without running any app +make e2e-qat E2E_LEVEL=basic FOCUS=Resource:dc + +# GPU without running tensorflow app +make e2e-gpu E2E_LEVEL=full SKIP=tensorflow ``` It is also possible to run the tests which don't depend on hardware @@ -210,7 +283,7 @@ without a pre-configured Kubernetes cluster. Just make sure you have [Kind](https://kind.sigs.k8s.io/) installed on your host and run: ``` -$ make test-with-kind +make test-with-kind ``` ### Run Controller Tests with a Local Control Plane