Skip to content

Commit

Permalink
idxd: fix iax_user_test.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Sun <[email protected]>
  • Loading branch information
ysun committed May 30, 2024
1 parent 90e00fa commit eb69414
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions BM/dsa/iax_user_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
#
# Description: Call iaa_test to run iax user test

source "common.sh"
source "$PWD/$DIRNAME/../common/common.sh"

set -x

DIRNAME=`dirname $0`
IAX_DIR=$PWD/$DIRNAME
CONFIG_DIR=$IAX_DIR/configs
ACCFG=/usr/bin/accel-config
TEST_DIR=/usr/libexec/accel-config/test
IAXTEST=$TEST_DIR/iaa_test

############################# FUNCTIONS #######################################

Expand All @@ -32,7 +41,6 @@ export EXIT_FAILURE=1
export EXIT_SKIP=77
TESTDIR=/usr/share/accel-config/test
BINDIR=/usr/bin
IAX_PATH="$(pwd)/ddt_intel/iax"

usage() {
cat <<__EOF
Expand Down Expand Up @@ -127,7 +135,7 @@ function checking_test_precondition()
if [ -f "$BINDIR/accel-config" ] && [ -x "$BINDIR/accel-config" ]; then
export ACCFG="$BINDIR"/accel-config
test_print_trc "accfg1:$ACCFG"
elif [ -f "$IAX_PATH/accel-config" ] && [ -x "$IAX_PATH/accel-config" ]; then
elif [ -f "$ACCFG/accel-config" ] && [ -x "$/accel-config" ]; then
cp -a $IAX_PATH/libaccel-config.so.1.0.0 /usr/lib64/
ln -s /usr/lib64/libaccel-config.so.1.0.0 /usr/lib64/libaccel-config.so.1
export ACCFG=$IAX_PATH/accel-config
Expand All @@ -138,11 +146,11 @@ function checking_test_precondition()
fi

# IAXTEST
if [ -f "$IAX_PATH/iaa_test" ] && [ -x "$IAX_PATH/iaa_test" ]; then
export IAXTEST=$IAX_PATH/iaa_test
if [ -f "$IAXTEST" ] && [ -x "$IAXTEST" ]; then
export IAXTEST=$IAXTEST
test_print_trc "iax_test1:$IAXTEST"
elif [ -f "$TESTDIR/iaa_test" ] && [ -x "$TESTDIR/iaa_test" ]; then
export IAXTEST="$TESTDIR"/iaa_test
export IAXTEST="$IAXTEST"
test_print_trc "iax_test2:$IAXTEST"
else
test_print_trc "Couldn't find an iaa_test binary"
Expand Down Expand Up @@ -190,10 +198,10 @@ load_config()
{
iax_disable_wq
# CONFIGS
if [ -f "$IAX_PATH/$CONFIG_NAME.conf" ]; then
export CONFIG1=$IAX_PATH/${CONFIG_NAME}.conf
if [ -f "$CONFIG_DIR/$CONFIG_NAME.conf" ]; then
export CONFIG1=$CONFIG_DIR/${CONFIG_NAME}.conf
else
test_print_trc "Can't find config file $IAX_PATH/$CONFIG_NAME.conf"
test_print_trc "Can't find config file $CONFIG_DIR/$CONFIG_NAME.conf"
exit "$EXIT_FAILURE"
fi
configurable=$(cat /sys/bus/dsa/devices/iax1/configurable)
Expand Down

0 comments on commit eb69414

Please sign in to comment.