Skip to content

Commit 5119cc5

Browse files
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 <hyeongju.lee@intel.com>
1 parent d60419e commit 5119cc5

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

test/e2e/qat/qatplugin_dpdk.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package qat
1717
import (
1818
"context"
1919
"path/filepath"
20+
"strconv"
2021
"time"
2122

2223
"github.com/intel/intel-device-plugins-for-kubernetes/test/e2e/utils"
@@ -39,6 +40,17 @@ const (
3940
cryptoTestGen4Yaml = "deployments/qat_dpdk_app/test-crypto1-gen4/kustomization.yaml"
4041
)
4142

43+
const (
44+
// The numbers for test below are from the document "Intel QuckAssist Technology Software for Linux*".
45+
// It is possible to add them for multiple test runs.
46+
symmetric = 1 << iota
47+
rsa
48+
dsa
49+
ecdsa
50+
dh
51+
compression
52+
)
53+
4254
func init() {
4355
ginkgo.Describe("QAT plugin in DPDK mode", describeQatDpdkPlugin)
4456
}
@@ -115,7 +127,7 @@ func describeQatDpdkPlugin() {
115127
})
116128

117129
ginkgo.It("deploys a crypto pod (openssl) requesting QAT resources", func(ctx context.Context) {
118-
runCpaSampleCode(ctx, f, "4", resourceName)
130+
runCpaSampleCode(ctx, f, symmetric, resourceName)
119131
})
120132

121133
ginkgo.It("deploys a crypto pod (dpdk crypto-perf) requesting QAT resources", func(ctx context.Context) {
@@ -142,7 +154,7 @@ func describeQatDpdkPlugin() {
142154
})
143155

144156
ginkgo.It("deploys a compress pod (openssl) requesting QAT resources", func(ctx context.Context) {
145-
runCpaSampleCode(ctx, f, "32", resourceName)
157+
runCpaSampleCode(ctx, f, compression, resourceName)
146158
})
147159
})
148160

@@ -170,7 +182,7 @@ func describeQatDpdkPlugin() {
170182
})
171183
}
172184

173-
func runCpaSampleCode(ctx context.Context, f *framework.Framework, runTests string, resourceName v1.ResourceName) {
185+
func runCpaSampleCode(ctx context.Context, f *framework.Framework, runTests int, resourceName v1.ResourceName) {
174186
ginkgo.By("submitting a pod requesting QAT" + resourceName.String() + "resources")
175187
podSpec := &v1.Pod{
176188
ObjectMeta: metav1.ObjectMeta{Name: "openssl-qat-engine"},
@@ -180,7 +192,7 @@ func runCpaSampleCode(ctx context.Context, f *framework.Framework, runTests stri
180192
Name: "openssl-qat-engine",
181193
Image: "intel/openssl-qat-engine:devel",
182194
ImagePullPolicy: "IfNotPresent",
183-
Command: []string{"cpa_sample_code", "runTests=" + runTests, "signOfLife=1"},
195+
Command: []string{"cpa_sample_code", "runTests=" + strconv.Itoa(runTests), "signOfLife=1"},
184196
SecurityContext: &v1.SecurityContext{
185197
Capabilities: &v1.Capabilities{
186198
Add: []v1.Capability{"IPC_LOCK"}},

0 commit comments

Comments
 (0)