@@ -17,6 +17,7 @@ package qat
1717import (
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+
4254func 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