@@ -125,7 +125,16 @@ func describeQatDpdkPlugin() {
125
125
})
126
126
127
127
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 ))
129
138
})
130
139
131
140
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() {
137
146
gomega .Expect (err ).To (gomega .BeNil (), utils .GetPodLogs (ctx , f , "qat-dpdk-test-crypto-perf" , "crypto-perf" ))
138
147
})
139
148
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
+
140
167
ginkgo .When ("there is no app to run [App:noapp]" , func () {
141
168
ginkgo .It ("does nothing" , func () {})
142
169
})
@@ -152,7 +179,16 @@ func describeQatDpdkPlugin() {
152
179
})
153
180
154
181
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 ))
156
192
})
157
193
158
194
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() {
212
248
}
213
249
214
250
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 ))
216
261
})
217
262
})
218
263
})
219
264
}
220
265
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 {
223
267
podSpec := & v1.Pod {
224
- ObjectMeta : metav1.ObjectMeta {Name : "openssl-qat-engine" },
268
+ ObjectMeta : metav1.ObjectMeta {Name : name },
225
269
Spec : v1.PodSpec {
226
270
Containers : []v1.Container {
227
271
{
228
- Name : "openssl-qat-engine" ,
229
- Image : "intel/openssl-qat-engine:devel" ,
272
+ Name : name ,
273
+ Image : image ,
230
274
ImagePullPolicy : "IfNotPresent" ,
231
- Command : [] string { "cpa_sample_code" , "runTests=" + strconv . Itoa ( runTests ), "signOfLife=1" } ,
275
+ Command : command ,
232
276
SecurityContext : & v1.SecurityContext {
233
277
Capabilities : & v1.Capabilities {
234
278
Add : []v1.Capability {"IPC_LOCK" }},
@@ -242,13 +286,11 @@ func runCpaSampleCode(ctx context.Context, f *framework.Framework, runTests int,
242
286
RestartPolicy : v1 .RestartPolicyNever ,
243
287
},
244
288
}
289
+
245
290
pod , err := f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Create (ctx , podSpec , metav1.CreateOptions {})
246
291
framework .ExpectNoError (err , "pod Create API error" )
247
292
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
252
294
}
253
295
254
296
func injectError (ctx context.Context , f * framework.Framework , resourceName v1.ResourceName ) {
0 commit comments