Skip to content

Commit

Permalink
[CI] DOCA compilation: fix test.sh shortcomings
Browse files Browse the repository at this point in the history
- Remove 3 attempts loop
- Make sure the do_archive call takes place and not being skipped

Issue: HPCINFRA-1968

Signed-off-by: Viacheslav Login <vlogin@nvidia.com>
  • Loading branch information
vialogi committed Jul 15, 2024
1 parent 4b41961 commit 43508ee
Showing 1 changed file with 38 additions and 48 deletions.
86 changes: 38 additions & 48 deletions contrib/jenkins_tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ if [ $(test -d ${install_dir} >/dev/null 2>&1 || echo $?) ]; then
exit 1
fi

if [ $(command -v ibdev2netdev >/dev/null 2>&1 || echo $?) ]; then
echo "[SKIP] ibdev2netdev tool does not exist"
exit 0
fi

cd $WORKSPACE

rm -rf $test_dir
Expand Down Expand Up @@ -55,7 +50,7 @@ if [ ! -z "${test_remote_ip}" ] ; then
[ -z "${NODE_NAME}" ] && NODE_NAME=${HOSTNAME}
sperf_exec_dir="/tmp/sockperf_exec_${NODE_NAME}"
rmt_user=root

rmt_os=$(${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} ". /etc/os-release ; echo \${NAME,,} | awk '{print \$1}'")
[ ! -z "${test_remote_rebuild}" ] && rmt_os="rebuld"
local_os=$(. /etc/os-release ; echo ${NAME,,} | awk '{print $1}')
Expand All @@ -68,7 +63,7 @@ if [ ! -z "${test_remote_ip}" ] ; then
${sudo_cmd} scp -q ${test_app} ${rmt_user}@${test_remote_ip}:${sperf_exec_dir}
${sudo_cmd} scp -q ${test_lib} ${rmt_user}@${test_remote_ip}:${sperf_exec_dir}
eval "pid=$(${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} pidof ${prj_service})"
if [ ! -z "${pid}" ] ; then
if [ ! -z "${pid}" ] ; then
echo "${prj_service} pid=${pid}"
eval "${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} kill -9 ${pid}"
fi
Expand All @@ -93,15 +88,16 @@ if [ ! -z "${test_remote_ip}" ] ; then
fi
fi
else
if [ ! -z $(do_get_ip 'ib') ]; then
test_ip_list="${test_ip_list} ib:$(do_get_ip 'ib')"
fi
if [ ! -z $(do_get_ip 'eth') ]; then
test_ip_list="${test_ip_list} eth_ip4:$(do_get_ip 'eth')"
fi
if [ ! -z $(do_get_ip 'inet6') ]; then
test_ip_list="${test_ip_list} eth_ip6:$(do_get_ip 'inet6')"
# Get IPv4/6 addresses for net1 interface which is a VF of MLNX NIC
test_ip_list="eth_ip4:$(ip -f inet addr show net1 | awk '/inet / {print $2}' | cut -d/ -f1)"
# test_ip_list="${test_ip_list} eth_ip6:$(ip -f inet6 addr show net1 | awk '/inet6 / {print $2}' | cut -d/ -f1)"
if [ -z "$test_ip_list" ]; then
echo "ERROR: Cannot get IPv4/6 address of net1 interface!"
exit 1
fi

# start the ssh server as verifyer.pl requiers
/etc/init.d/ssh start
fi

nerrors=0
Expand All @@ -112,43 +108,37 @@ for test_link in $test_ip_list; do
test_name=${test_in}-${test}
test_tap=${WORKSPACE}/${prefix}/test-${test_name}.tap

for i in $(seq 3); do
if [ ! -z "${test_remote_ip}" ] ; then
if [ ! -z "${test_remote_ip}" ] ; then

eval "pid=$(${sudo_cmd} pidof ${prj_service})"
[ ! -z "${pid}" ] && eval "${sudo_cmd} kill -9 ${pid}"
eval "${sudo_cmd} ${install_dir}/sbin/${prj_service} --console -v5 & "
eval "pid=$(${sudo_cmd} pidof ${prj_service})"
[ ! -z "${pid}" ] && eval "${sudo_cmd} kill -9 ${pid}"
eval "${sudo_cmd} ${install_dir}/sbin/${prj_service} --console -v5 & "

echo "BUILD_NUMBER=${BUILD_NUMBER}"
eval "pid=$(${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} pidof ${prj_service})"
if [ ! -z "${pid}" ] ; then
echo "${prj_service} pid=${pid}"
eval "${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} kill -9 ${pid}"
fi
${sudo_cmd} scp -q ${install_dir}/sbin/${prj_service} ${rmt_user}@${test_remote_ip}:${sperf_exec_dir}
eval "${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} ${sudo_cmd} ${sperf_exec_dir}/${prj_service} &"
echo "BUILD_NUMBER=${BUILD_NUMBER}"
eval "pid=$(${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} pidof ${prj_service})"
if [ ! -z "${pid}" ] ; then
echo "${prj_service} pid=${pid}"
eval "${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} kill -9 ${pid}"
fi
${sudo_cmd} scp -q ${install_dir}/sbin/${prj_service} ${rmt_user}@${test_remote_ip}:${sperf_exec_dir}
eval "${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} ${sudo_cmd} ${sperf_exec_dir}/${prj_service} &"

vutil="$(dirname $0)/vutil.sh"
[ ! -e "${vutil}" ] && { echo "error vutil not found" ; exit 1 ; }
vutil="$(dirname $0)/vutil.sh"
[ ! -e "${vutil}" ] && { echo "error vutil not found" ; exit 1 ; }

${sudo_cmd} $timeout_exe ${vutil} -a "${test_app}" -x "--load-vma=${test_lib} " -t "${test}:tc[1-9]$" \
-s "${test_remote_ip}" -p "${test_remote_port}" -l "${test_dir}/${test_name}.log" \
-e "XLIO_TX_BUFS=20000"
else
${sudo_cmd} $timeout_exe $PWD/tests/verifier/verifier.pl -a ${test_app} -x " --load-vma=$test_lib " \
-t ${test}:tc[1-9]$ -s ${test_ip} -l ${test_dir}/${test_name}.log \
-e " XLIO_TX_BUFS=20000 " \
--progress=0
fi
${sudo_cmd} $timeout_exe ${vutil} -a "${test_app}" -x "--load-vma=${test_lib} " -t "${test}:tc[1-9]$" \
-s "${test_remote_ip}" -p "${test_remote_port}" -l "${test_dir}/${test_name}.log" \
-e "XLIO_TX_BUFS=20000"
else
${sudo_cmd} $timeout_exe $PWD/tests/verifier/verifier.pl -a ${test_app} -x " --debug " \
-t ${test}:tc[1-9]$ -s ${test_ip} -l ${test_dir}/${test_name}.log \
-e " LD_PRELOAD=$test_lib " \
--progress=0
fi

cp $PWD/${test_name}.dump ${test_dir}/${test_name}.dump
if grep -q 'FAIL' ${test_dir}/${test_name}.dump; then
rm -fv ${test_dir}/${test_name}.log ${test_dir}/${test_name}.dump
else
break
fi
done
grep -e 'PASS' -e 'FAIL' ${test_dir}/${test_name}.dump > ${test_dir}/${test_name}.tmp
cp $PWD/${test_name}.dump ${test_dir}/${test_name}.dump

grep -e 'PASS' -e 'FAIL' ${test_dir}/${test_name}.dump > ${test_dir}/${test_name}.tmp

do_archive "${test_dir}/${test_name}.dump" "${test_dir}/${test_name}.log"

Expand All @@ -175,4 +165,4 @@ done
rc=$(($rc+$nerrors))

echo "[${0##*/}]..................exit code = $rc"
exit $rc
exit $rc

0 comments on commit 43508ee

Please sign in to comment.