Skip to content
Open
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
29 changes: 26 additions & 3 deletions test/sanity_test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

set -x
sudo chmod 666 /dev/hisi_*

TEST_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Expand All @@ -12,11 +11,30 @@ echo $version
major_version=$(echo $version | awk -F'[ .]' '{print $2}')
echo "OpenSSL major version is "$major_version

test_provider() {
UACCE_DIR="/sys/class/uacce"
api_version=""

for device_dir in "$UACCE_DIR"/*; do
if [ -d "$device_dir" ]; then
device_name=$(basename "$device_dir")

api_file="$device_dir/api"
if [ -f "$api_file" ]; then
api_version=$(cat "$api_file")
break
fi
fi
done

test_provider_v2() {
$TEST_SCRIPT_DIR/sanity_test_provider.sh
exit
}

test_provider_v3() {
exit
}

test_engine() {
$TEST_SCRIPT_DIR/sanity_test_engine.sh
exit
Expand All @@ -25,7 +43,12 @@ test_engine() {
if [ $# -eq 0 ]; then
# if no para, check openssl version only
if ((major_version >= 3)); then
test_provider
if [ "$api_version" == "hisi_qm_v2" ]; then
echo "Testing hisi_qm_v2 provider"
test_provider_v2
elif [ "$api_version" == "hisi_qm_v3" ]; then
echo "Testing hisi_qm_v3 provider"
fi
fi

if [[ $version =~ "1.1.1" ]]; then
Expand Down