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 16, 2024
1 parent 004ebf5 commit 8677af0
Showing 1 changed file with 34 additions and 35 deletions.
69 changes: 34 additions & 35 deletions contrib/jenkins_tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,42 +108,41 @@ 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

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} &"

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 " --debug " \
-t ${test}:tc[1-9]$ -s ${test_ip} -l ${test_dir}/${test_name}.log \
-e " LD_PRELOAD=$test_lib " \
--progress=0
fi
if [ ! -z "${test_remote_ip}" ] ; then

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
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
done
${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 ; }

${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

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 Down Expand Up @@ -171,4 +170,4 @@ done
rc=$(($rc+$nerrors))

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

0 comments on commit 8677af0

Please sign in to comment.