From 5119cc52631d38320981a6daf96a7cd7fb42b67c Mon Sep 17 00:00:00 2001 From: Hyeongju Johannes Lee Date: Thu, 4 May 2023 02:15:48 -0700 Subject: [PATCH] qat,e2e: fix e2e test for cy runTests=4 is dsa test, and it does not run anything for now. So, use runTests=1, which is symmetric test code. In addition, make CpaSampleCode's params const and add comments for the sample codes' param numbering. Signed-off-by: Hyeongju Johannes Lee --- test/e2e/qat/qatplugin_dpdk.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/e2e/qat/qatplugin_dpdk.go b/test/e2e/qat/qatplugin_dpdk.go index 274517a7..1a23179f 100644 --- a/test/e2e/qat/qatplugin_dpdk.go +++ b/test/e2e/qat/qatplugin_dpdk.go @@ -17,6 +17,7 @@ package qat import ( "context" "path/filepath" + "strconv" "time" "github.com/intel/intel-device-plugins-for-kubernetes/test/e2e/utils" @@ -39,6 +40,17 @@ const ( cryptoTestGen4Yaml = "deployments/qat_dpdk_app/test-crypto1-gen4/kustomization.yaml" ) +const ( + // The numbers for test below are from the document "Intel QuckAssist Technology Software for Linux*". + // It is possible to add them for multiple test runs. + symmetric = 1 << iota + rsa + dsa + ecdsa + dh + compression +) + func init() { ginkgo.Describe("QAT plugin in DPDK mode", describeQatDpdkPlugin) } @@ -115,7 +127,7 @@ func describeQatDpdkPlugin() { }) ginkgo.It("deploys a crypto pod (openssl) requesting QAT resources", func(ctx context.Context) { - runCpaSampleCode(ctx, f, "4", resourceName) + runCpaSampleCode(ctx, f, symmetric, resourceName) }) ginkgo.It("deploys a crypto pod (dpdk crypto-perf) requesting QAT resources", func(ctx context.Context) { @@ -142,7 +154,7 @@ func describeQatDpdkPlugin() { }) ginkgo.It("deploys a compress pod (openssl) requesting QAT resources", func(ctx context.Context) { - runCpaSampleCode(ctx, f, "32", resourceName) + runCpaSampleCode(ctx, f, compression, resourceName) }) }) @@ -170,7 +182,7 @@ func describeQatDpdkPlugin() { }) } -func runCpaSampleCode(ctx context.Context, f *framework.Framework, runTests string, resourceName v1.ResourceName) { +func runCpaSampleCode(ctx context.Context, f *framework.Framework, runTests int, resourceName v1.ResourceName) { ginkgo.By("submitting a pod requesting QAT" + resourceName.String() + "resources") podSpec := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "openssl-qat-engine"}, @@ -180,7 +192,7 @@ func runCpaSampleCode(ctx context.Context, f *framework.Framework, runTests stri Name: "openssl-qat-engine", Image: "intel/openssl-qat-engine:devel", ImagePullPolicy: "IfNotPresent", - Command: []string{"cpa_sample_code", "runTests=" + runTests, "signOfLife=1"}, + Command: []string{"cpa_sample_code", "runTests=" + strconv.Itoa(runTests), "signOfLife=1"}, SecurityContext: &v1.SecurityContext{ Capabilities: &v1.Capabilities{ Add: []v1.Capability{"IPC_LOCK"}},