@@ -125,7 +125,16 @@ func describeQatDpdkPlugin() {
125125 })
126126
127127 ginkgo .It ("deploys a crypto pod (openssl) requesting QAT resources [App:openssl]" , func (ctx context.Context ) {
128- runCpaSampleCode (ctx , f , symmetric , resourceName )
128+ command := []string {
129+ "cpa_sample_code" ,
130+ "runTests=" + strconv .Itoa (symmetric ),
131+ "signOfLife=1" ,
132+ }
133+ pod := createPod (ctx , f , "cpa-sample-code" , resourceName , "intel/openssl-qat-engine:devel" , command )
134+
135+ ginkgo .By ("waiting the cpa-sample-code pod for the resource " + resourceName .String () + " to finish successfully" )
136+ err := e2epod .WaitForPodSuccessInNamespaceTimeout (ctx , f .ClientSet , pod .ObjectMeta .Name , f .Namespace .Name , 300 * time .Second )
137+ gomega .Expect (err ).To (gomega .BeNil (), utils .GetPodLogs (ctx , f , pod .ObjectMeta .Name , pod .Spec .Containers [0 ].Name ))
129138 })
130139
131140 ginkgo .It ("deploys a crypto pod (dpdk crypto-perf) requesting QAT resources [App:crypto-perf]" , func (ctx context.Context ) {
@@ -137,6 +146,24 @@ func describeQatDpdkPlugin() {
137146 gomega .Expect (err ).To (gomega .BeNil (), utils .GetPodLogs (ctx , f , "qat-dpdk-test-crypto-perf" , "crypto-perf" ))
138147 })
139148
149+ ginkgo .It ("deploys a crypto pod (qat-engine testapp) [App:qat-engine]" , func (ctx context.Context ) {
150+ command := []string {
151+ "testapp" ,
152+ "-engine" , "qathwtest" ,
153+ "-async_jobs" , "1" ,
154+ "-c" , "1" ,
155+ "-n" , "1" ,
156+ "-nc" , "1" ,
157+ "-v" ,
158+ "-hw_algo" , "0x0029" ,
159+ }
160+ pod := createPod (ctx , f , "qat-engine-testapp" , resourceName , "intel/openssl-qat-engine:devel" , command )
161+
162+ ginkgo .By ("waiting the qat-engine-testapp pod for the resource " + resourceName .String () + " to finish successfully" )
163+ err := e2epod .WaitForPodSuccessInNamespaceTimeout (ctx , f .ClientSet , pod .ObjectMeta .Name , f .Namespace .Name , 300 * time .Second )
164+ gomega .Expect (err ).To (gomega .BeNil (), utils .GetPodLogs (ctx , f , pod .ObjectMeta .Name , pod .Spec .Containers [0 ].Name ))
165+ })
166+
140167 ginkgo .When ("there is no app to run [App:noapp]" , func () {
141168 ginkgo .It ("does nothing" , func () {})
142169 })
@@ -152,7 +179,16 @@ func describeQatDpdkPlugin() {
152179 })
153180
154181 ginkgo .It ("deploys a compress pod (openssl) requesting QAT resources [App:openssl]" , func (ctx context.Context ) {
155- runCpaSampleCode (ctx , f , compression , resourceName )
182+ command := []string {
183+ "cpa_sample_code" ,
184+ "runTests=" + strconv .Itoa (compression ),
185+ "signOfLife=1" ,
186+ }
187+ pod := createPod (ctx , f , "cpa-sample-code" , resourceName , "intel/openssl-qat-engine:devel" , command )
188+
189+ ginkgo .By ("waiting the cpa-sample-code pod for the resource " + resourceName .String () + " to finish successfully" )
190+ err := e2epod .WaitForPodSuccessInNamespaceTimeout (ctx , f .ClientSet , pod .ObjectMeta .Name , f .Namespace .Name , 300 * time .Second )
191+ gomega .Expect (err ).To (gomega .BeNil (), utils .GetPodLogs (ctx , f , pod .ObjectMeta .Name , pod .Spec .Containers [0 ].Name ))
156192 })
157193
158194 ginkgo .It ("deploys a compress pod (dpdk compress-perf) requesting QAT resources [App:compress-perf]" , func (ctx context.Context ) {
@@ -212,23 +248,31 @@ func describeQatDpdkPlugin() {
212248 }
213249
214250 ginkgo .By ("checking if openssl pod runs successfully" )
215- runCpaSampleCode (ctx , f , compression , resourceName )
251+ command := []string {
252+ "cpa_sample_code" ,
253+ "runTests=" + strconv .Itoa (compression ),
254+ "signOfLife=1" ,
255+ }
256+ pod := createPod (ctx , f , "cpa-sample-code" , resourceName , "intel/openssl-qat-engine:devel" , command )
257+
258+ ginkgo .By ("waiting the cpa-sample-code pod for the resource " + resourceName .String () + " to finish successfully" )
259+ err := e2epod .WaitForPodSuccessInNamespaceTimeout (ctx , f .ClientSet , pod .ObjectMeta .Name , f .Namespace .Name , 300 * time .Second )
260+ gomega .Expect (err ).To (gomega .BeNil (), utils .GetPodLogs (ctx , f , pod .ObjectMeta .Name , pod .Spec .Containers [0 ].Name ))
216261 })
217262 })
218263 })
219264}
220265
221- func runCpaSampleCode (ctx context.Context , f * framework.Framework , runTests int , resourceName v1.ResourceName ) {
222- ginkgo .By ("submitting a pod requesting QAT" + resourceName .String () + "resources" )
266+ func createPod (ctx context.Context , f * framework.Framework , name string , resourceName v1.ResourceName , image string , command []string ) * v1.Pod {
223267 podSpec := & v1.Pod {
224- ObjectMeta : metav1.ObjectMeta {Name : "openssl-qat-engine" },
268+ ObjectMeta : metav1.ObjectMeta {Name : name },
225269 Spec : v1.PodSpec {
226270 Containers : []v1.Container {
227271 {
228- Name : "openssl-qat-engine" ,
229- Image : "intel/openssl-qat-engine:devel" ,
272+ Name : name ,
273+ Image : image ,
230274 ImagePullPolicy : "IfNotPresent" ,
231- Command : [] string { "cpa_sample_code" , "runTests=" + strconv . Itoa ( runTests ), "signOfLife=1" } ,
275+ Command : command ,
232276 SecurityContext : & v1.SecurityContext {
233277 Capabilities : & v1.Capabilities {
234278 Add : []v1.Capability {"IPC_LOCK" }},
@@ -242,13 +286,11 @@ func runCpaSampleCode(ctx context.Context, f *framework.Framework, runTests int,
242286 RestartPolicy : v1 .RestartPolicyNever ,
243287 },
244288 }
289+
245290 pod , err := f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Create (ctx , podSpec , metav1.CreateOptions {})
246291 framework .ExpectNoError (err , "pod Create API error" )
247292
248- ginkgo .By ("waiting the cpa_sample_code pod for the resource" + resourceName .String () + "to finish successfully" )
249-
250- err = e2epod .WaitForPodSuccessInNamespaceTimeout (ctx , f .ClientSet , pod .ObjectMeta .Name , f .Namespace .Name , 300 * time .Second )
251- gomega .Expect (err ).To (gomega .BeNil (), utils .GetPodLogs (ctx , f , pod .ObjectMeta .Name , pod .Spec .Containers [0 ].Name ))
293+ return pod
252294}
253295
254296func injectError (ctx context.Context , f * framework.Framework , resourceName v1.ResourceName ) {
0 commit comments