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_capable_nodes=$(kubectl get nodes -o json | jq -r '.items[] | select((.status.capacity."qat.intel.com/cy2_dc2"|tonumber)>=1) | .metadata.name')
14 if [ -z "$qat_capable_nodes" ]; then
15 echo "This test case cannot run. QAT device unavailable."
19 echo "Can run QAT on this cluster."
24 rm -f $HOME/$pod_name.yaml
25 kubectl delete pod $pod_name --ignore-not-found=true --now --wait
26 allocated_node_resource=$(kubectl describe node | grep "qat.intel.com" | tail -n1 |awk '{print $(NF)}')
27 echo "The allocated resource of the node is: " $allocated_node_resource
28 cat << POD > $HOME/$pod_name.yaml
36 image: integratedcloudnative/openssl-qat-engine:devel
37 imagePullPolicy: IfNotPresent
41 - mountPath: /etc/c6xxvf_dev0.conf
43 command: [ "/bin/bash", "-c", "--" ]
44 args: [ "while true; do sleep 300000; done;" ]
47 qat.intel.com/cy2_dc2: '1'
49 qat.intel.com/cy2_dc2: '1'
56 path: /etc/c6xxvf_dev0.conf
58 kubectl create -f $HOME/$pod_name.yaml --validate=false
59 for pod in $pod_name; do
61 while [[ $status_phase != "Running" ]]; do
62 new_phase=$(kubectl get pods $pod | awk 'NR==2{print $3}')
63 if [[ $new_phase != $status_phase ]]; then
64 echo "$(date +%H:%M:%S) - $pod : $new_phase"
65 status_phase=$new_phase
67 if [[ $new_phase == "Running" ]]; then
68 echo "Pod is up and running.."
70 if [[ $new_phase == "Err"* ]]; then
76 allocated_node_resource=$(kubectl describe node | grep "qat.intel.com" | tail -n1 |awk '{print $(NF)}')
77 echo "The allocated resource of the node is: " $allocated_node_resource
78 kubectl exec pod-case-01 -- openssl engine -c -t qat
80 kubectl delete pod $pod_name --now