2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
13 qat_device=$( for i in 0434 0435 37c8 6f54 19e2; \
14 do lspci -d 8086:$i -m; done |\
15 grep -i "Quick*" | head -n 1 | cut -d " " -f 5 )
16 #Checking if the QAT device is on the node
17 if [ -z "$qat_device" ]; then
18 echo "False. This test case cannot run. Qat device unavailable."
22 echo "True. Can run QAT on this device."
27 rm -f $HOME/$pod_name.yaml
28 kubectl delete pod $pod_name --ignore-not-found=true --now --wait
29 allocated_node_resource=$(kubectl describe node | grep "qat.intel.com" | tail -n1 |awk '{print $(NF)}')
30 echo "The allocated resource of the node is: " $allocated_node_resource
31 cat << POD > $HOME/$pod_name.yaml
39 image: integratedcloudnative/openssl-qat-engine:devel
40 imagePullPolicy: IfNotPresent
44 - mountPath: /etc/c6xxvf_dev0.conf
46 command: [ "/bin/bash", "-c", "--" ]
47 args: [ "while true; do sleep 300000; done;" ]
50 qat.intel.com/cy2_dc2: '1'
52 qat.intel.com/cy2_dc2: '1'
59 path: /etc/c6xxvf_dev0.conf
61 kubectl create -f $HOME/$pod_name.yaml --validate=false
62 for pod in $pod_name; do
64 while [[ $status_phase != "Running" ]]; do
65 new_phase=$(kubectl get pods $pod | awk 'NR==2{print $3}')
66 if [[ $new_phase != $status_phase ]]; then
67 echo "$(date +%H:%M:%S) - $pod : $new_phase"
68 status_phase=$new_phase
70 if [[ $new_phase == "Running" ]]; then
71 echo "Pod is up and running.."
73 if [[ $new_phase == "Err"* ]]; then
79 allocated_node_resource=$(kubectl describe node | grep "qat.intel.com" | tail -n1 |awk '{print $(NF)}')
80 echo "The allocated resource of the node is: " $allocated_node_resource
82 systemctl restart qat_service
83 kubectl exec -it pod-case-01 -- openssl engine -c -t qat
85 kubectl delete pod $pod_name --now