Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lib-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- accel-config-demo
- intel-deviceplugin-operator
- name: e2e-qat-gnrd
targetjob: e2e-qat FOCUS="Mode:dpdk" SKIP="(App:(crypto-perf|compress-perf)|Functionality)"
targetjob: e2e-qat FOCUS="Mode:dpdk" SKIP="(App:(crypto-perf|compress-perf|qat-engine)|Functionality)"
runner: simics-gnrd
images:
- intel-qat-plugin
Expand Down
34 changes: 32 additions & 2 deletions demo/openssl-qat-engine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
FROM ubuntu:24.04
FROM ubuntu:24.04 AS builder

ARG QAT_ENGINE_VERSION="v1.6.2"

RUN apt update && \
apt install --no-install-recommends -y qatengine qatlib-examples qatzip openssl
env DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y \
git \
ca-certificates \
autoconf \
automake \
g++ \
pkg-config \
libssl-dev \
libtool \
libqat-dev \
make \
libusdm-dev

RUN git clone --depth 1 -b $QAT_ENGINE_VERSION https://github.com/intel/QAT_Engine

RUN cd /QAT_Engine && \
sed -i '/fprintf(stderr, "QAT_HW device not available & QAT_SW not enabled. Using OpenSSL_SW!\\n");/ s/$/ return ret;/' e_qat.c && \
./autogen.sh && \
./configure \
--disable-qat_sw \
--with-qat_engine_id=qathwtest && \
make && make test && make install

FROM ubuntu:24.04

COPY --from=builder /QAT_Engine/testapp /usr/bin/
COPY --from=builder /usr/lib/x86_64-linux-gnu/engines-3/qatengine.so /usr/lib/x86_64-linux-gnu/engines-3/qathwtest.so
COPY --from=builder /QAT_Engine/LICENSE /usr/share/package-licenses/QAT_Engine/LICENSE
RUN apt update && env DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y qatengine qatlib-examples
68 changes: 55 additions & 13 deletions test/e2e/qat/qatplugin_dpdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,16 @@ func describeQatDpdkPlugin() {
})

ginkgo.It("deploys a crypto pod (openssl) requesting QAT resources [App:openssl]", func(ctx context.Context) {
runCpaSampleCode(ctx, f, symmetric, resourceName)
command := []string{
"cpa_sample_code",
"runTests=" + strconv.Itoa(symmetric),
"signOfLife=1",
}
pod := createPod(ctx, f, "cpa-sample-code", resourceName, "intel/openssl-qat-engine:devel", command)

ginkgo.By("waiting the cpa-sample-code pod for the resource " + resourceName.String() + " to finish successfully")
err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, pod.ObjectMeta.Name, f.Namespace.Name, 300*time.Second)
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, pod.ObjectMeta.Name, pod.Spec.Containers[0].Name))
})

ginkgo.It("deploys a crypto pod (dpdk crypto-perf) requesting QAT resources [App:crypto-perf]", func(ctx context.Context) {
Expand All @@ -137,6 +146,24 @@ func describeQatDpdkPlugin() {
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, "qat-dpdk-test-crypto-perf", "crypto-perf"))
})

ginkgo.It("deploys a crypto pod (qat-engine testapp) [App:qat-engine]", func(ctx context.Context) {
command := []string{
"testapp",
"-engine", "qathwtest",
"-async_jobs", "1",
"-c", "1",
"-n", "1",
"-nc", "1",
"-v",
"-hw_algo", "0x0029",
}
pod := createPod(ctx, f, "qat-engine-testapp", resourceName, "intel/openssl-qat-engine:devel", command)

ginkgo.By("waiting the qat-engine-testapp pod for the resource " + resourceName.String() + " to finish successfully")
err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, pod.ObjectMeta.Name, f.Namespace.Name, 300*time.Second)
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, pod.ObjectMeta.Name, pod.Spec.Containers[0].Name))
})

ginkgo.When("there is no app to run [App:noapp]", func() {
ginkgo.It("does nothing", func() {})
})
Expand All @@ -152,7 +179,16 @@ func describeQatDpdkPlugin() {
})

ginkgo.It("deploys a compress pod (openssl) requesting QAT resources [App:openssl]", func(ctx context.Context) {
runCpaSampleCode(ctx, f, compression, resourceName)
command := []string{
"cpa_sample_code",
"runTests=" + strconv.Itoa(compression),
"signOfLife=1",
}
pod := createPod(ctx, f, "cpa-sample-code", resourceName, "intel/openssl-qat-engine:devel", command)

ginkgo.By("waiting the cpa-sample-code pod for the resource " + resourceName.String() + " to finish successfully")
err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, pod.ObjectMeta.Name, f.Namespace.Name, 300*time.Second)
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, pod.ObjectMeta.Name, pod.Spec.Containers[0].Name))
})

ginkgo.It("deploys a compress pod (dpdk compress-perf) requesting QAT resources [App:compress-perf]", func(ctx context.Context) {
Expand Down Expand Up @@ -212,23 +248,31 @@ func describeQatDpdkPlugin() {
}

ginkgo.By("checking if openssl pod runs successfully")
runCpaSampleCode(ctx, f, compression, resourceName)
command := []string{
"cpa_sample_code",
"runTests=" + strconv.Itoa(compression),
"signOfLife=1",
}
pod := createPod(ctx, f, "cpa-sample-code", resourceName, "intel/openssl-qat-engine:devel", command)

ginkgo.By("waiting the cpa-sample-code pod for the resource " + resourceName.String() + " to finish successfully")
err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, pod.ObjectMeta.Name, f.Namespace.Name, 300*time.Second)
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, pod.ObjectMeta.Name, pod.Spec.Containers[0].Name))
})
})
})
}

func runCpaSampleCode(ctx context.Context, f *framework.Framework, runTests int, resourceName v1.ResourceName) {
ginkgo.By("submitting a pod requesting QAT" + resourceName.String() + "resources")
func createPod(ctx context.Context, f *framework.Framework, name string, resourceName v1.ResourceName, image string, command []string) *v1.Pod {
podSpec := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{Name: "openssl-qat-engine"},
ObjectMeta: metav1.ObjectMeta{Name: name},
Spec: v1.PodSpec{
Containers: []v1.Container{
{
Name: "openssl-qat-engine",
Image: "intel/openssl-qat-engine:devel",
Name: name,
Image: image,
ImagePullPolicy: "IfNotPresent",
Command: []string{"cpa_sample_code", "runTests=" + strconv.Itoa(runTests), "signOfLife=1"},
Command: command,
SecurityContext: &v1.SecurityContext{
Capabilities: &v1.Capabilities{
Add: []v1.Capability{"IPC_LOCK"}},
Expand All @@ -242,13 +286,11 @@ func runCpaSampleCode(ctx context.Context, f *framework.Framework, runTests int,
RestartPolicy: v1.RestartPolicyNever,
},
}

pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(ctx, podSpec, metav1.CreateOptions{})
framework.ExpectNoError(err, "pod Create API error")

ginkgo.By("waiting the cpa_sample_code pod for the resource" + resourceName.String() + "to finish successfully")

err = e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, pod.ObjectMeta.Name, f.Namespace.Name, 300*time.Second)
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, pod.ObjectMeta.Name, pod.Spec.Containers[0].Name))
return pod
}

func injectError(ctx context.Context, f *framework.Framework, resourceName v1.ResourceName) {
Expand Down
Loading