Merge pull request #1411 from hj-johannes-lee/PR-2023-012

qat,e2e: fix e2e test for cy
This commit is contained in:
Mikko Ylinen 2023-05-16 13:39:39 +03:00 committed by GitHub
commit c37ac008b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,7 @@ package qat
import ( import (
"context" "context"
"path/filepath" "path/filepath"
"strconv"
"time" "time"
"github.com/intel/intel-device-plugins-for-kubernetes/test/e2e/utils" "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" 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() { func init() {
ginkgo.Describe("QAT plugin in DPDK mode", describeQatDpdkPlugin) 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) { 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) { 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) { 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") ginkgo.By("submitting a pod requesting QAT" + resourceName.String() + "resources")
podSpec := &v1.Pod{ podSpec := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{Name: "openssl-qat-engine"}, 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", Name: "openssl-qat-engine",
Image: "intel/openssl-qat-engine:devel", Image: "intel/openssl-qat-engine:devel",
ImagePullPolicy: "IfNotPresent", 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{ SecurityContext: &v1.SecurityContext{
Capabilities: &v1.Capabilities{ Capabilities: &v1.Capabilities{
Add: []v1.Capability{"IPC_LOCK"}}, Add: []v1.Capability{"IPC_LOCK"}},