Skip to content

Commit

Permalink
scripts: copy branch specific headers set last
Browse files Browse the repository at this point in the history
Copy the set of headers, specific for currently used branch, or create
symlinks for them in the script run last.

Run other sockapi configurations before the scripts fixing ool
consistency as further executed scripts need exports from sockapi
configurations.

Fixes: d74da29 ("scripts: run sockapi configuration scripts last")
OL-Redmine-Id: 13098
Signed-off-by: Alexander Kuzminov <alexander.kuzminov@oktetlabs.ru>
Reviewed-by: Damir Mansurov <damir.mansurov@oktetlabs.ru>
  • Loading branch information
ol-aukuzminov authored and okt-yurijp committed Oct 5, 2023
1 parent 8bb89a5 commit 04c3e6c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
30 changes: 30 additions & 0 deletions conf/scripts/copy-onload-headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-License-Identifier: Apache-2.0
# (c) Copyright 2023 OKTET Labs Ltd., 2004 - 2022 Xilinx, Inc. All rights reserved.

# Copy/create symlinks for the set of Onload headers, specific for currently
# used branch
for header in extensions.h extensions_zc.h extensions_timestamping.h\
extensions_zc_hlrx.h test_intf.h; do
dst_name="${SOCKAPI_TS_LIBDIR}/talib_sockapi_ts/${header}"
if [[ "$SFC_ONLOAD_LOCAL" == "yes" ]]; then
local_file="${SFC_ONLOAD_EXT_HEADERS}/${header}"
target="${SOCKAPI_TS_LIBDIR}/talib_sockapi_ts/copied_headers/${header}"
for ignored_header in "${IGNORED_ONLOAD_HEADERS[@]}"; do
if [[ "${header}" == "${ignored_header}" ]]; then
HEADER_IS_IGNORED="yes"
break
fi
done
if [[ "${HEADER_IS_IGNORED}" == "yes" ]]; then
echo "INFO: file $header does not exist"
else
rsync_from "$TE_IUT" "$local_file" "$target"
fi
HEADER_IS_IGNORED=
else
target="${SFC_ONLOAD_EXT_HEADERS}/${header}"
fi
if test -f "$target"; then
ln_sf_safe "$target" "$dst_name"
fi
done
27 changes: 1 addition & 26 deletions conf/scripts/sockapi-ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# (c) Copyright 2004 - 2022 Xilinx, Inc. All rights reserved.
# (c) Copyright 2023 OKTET Labs Ltd., 2004 - 2022 Xilinx, Inc. All rights reserved.
#
# The file contains sockapi-ts specific environments processing and
# configuration.
Expand Down Expand Up @@ -233,31 +233,6 @@ fi
if test "x$SFC_ONLOAD_LOCAL" == "xyes" ; then
mkdir -p "${SOCKAPI_TS_LIBDIR}/talib_sockapi_ts/copied_headers"
fi
for header in extensions.h extensions_zc.h extensions_timestamping.h extensions_zc_hlrx.h\
test_intf.h ; do
dst_name="${SOCKAPI_TS_LIBDIR}/talib_sockapi_ts/${header}"
if test "x$SFC_ONLOAD_LOCAL" == "xyes" ; then
local_file="${SFC_ONLOAD_EXT_HEADERS}/${header}"
target="${SOCKAPI_TS_LIBDIR}/talib_sockapi_ts/copied_headers/${header}"
for ignored_header in "${IGNORED_ONLOAD_HEADERS[@]}"; do
if [[ "${header}" == "${ignored_header}" ]]; then
HEADER_IS_IGNORED="yes"
break
fi
done
if [[ "${HEADER_IS_IGNORED}" == "yes" ]]; then
echo "INFO: file $header does not exist"
else
rsync_from "$TE_IUT" "$local_file" "$target"
fi
HEADER_IS_IGNORED=
else
target="${SFC_ONLOAD_EXT_HEADERS}/${header}"
fi
if test -f "$target"; then
ln_sf_safe "$target" "$dst_name"
fi
done

if test "x$SFC_ONLOAD_LOCAL" == "xyes" ; then

Expand Down
8 changes: 6 additions & 2 deletions scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ if test "${ZF_SHIM_RUN}" = "true" ; then
check_sf_zetaferno_dir $OOL_SET
fi

if test -n "${TE_TS_SOCKAPI}" ; then
RUN_OPTS="${RUN_OPTS} --opts=opts.ts"
fi

if test "${ST_IP_TRANSPARENT}" = "yes" ; then
RUN_OPTS="${RUN_OPTS} --tester-req=\"ENV-IUT-FAKE-ADDR\""
# Scalable filters are not supported with AF_XDP. ST-2231.
Expand Down Expand Up @@ -297,8 +301,8 @@ if [[ "$TE_TS_BUILD_ONLY" != "yes" ]] ; then
done
fi

if test -n "${TE_TS_SOCKAPI}" ; then
RUN_OPTS="${RUN_OPTS} --opts=opts.ts"
if test -n "${TE_TS_SOCKAPI}"; then
RUN_OPTS="$RUN_OPTS --script=scripts/copy-onload-headers"
fi

eval "${TE_BASE}/dispatcher.sh ${MY_OPTS} ${RUN_OPTS}"
Expand Down

0 comments on commit 04c3e6c

Please sign in to comment.