echo
echo " This script will create a basic testcase based on frames timeline (11, 13, 15, etc.), from the desired"
echo " end-point list. For example, from the 'gentraf' point of view, outgoing requests will be translated as"
- echo " sendxml operations with corresponding waits for answers and corresponding result codes (normally 2001)."
+ echo " sendxml operations with corresponding waits for answers and corresponding result codes (normally 2001)"
+ echo " if those answers are provided (2001 will be assigned as result-code condition if no answer is found)."
echo " CER/A are detected creating a symbolic link to better reference them, and DPR/A are ignored."
echo
echo " The provided test end point list shall match metadata 'src' field in order to filter the valid testcase"
echo "test|1|sendxml2e|$xml" >> $TESTCASE_BN
if [ -n "$resultcode" ]
then
- local rc=$(getResultCode $xml)
- [ -z "$rc" ] && rc=2001
+ local hbh="$(grep -o "hop-by-hop-id=\"[0-9]*\"" $xml)"
+ local hbh_matchs=( $(grep -l "$hbh" *.xml) )
+ local ans_xml=${hbh_matchs[1]}
+ local rc=2001
+ if [ -n "$ans_xml" ]
+ then
+ _rc=$(getResultCode $ans_xml)
+ [ -n "$_rc" ] && rc=$_rc
+ fi
s_waitfe="${s_waitfe}|${rc}"
fi
echo "$s_waitfe" >> $TESTCASE_BN
then
src_eps=( $(grep "^src=" *.*metadata | cut -d= -f2 | sort -u) )
[ ${#src_eps[@]} -eq 0 ] && _exit "No source end-points detected: metadata must have an 'src=xxx' line."
- echo "Input a space-separated list for desired end-points to be processed as test side: "
- echo " (available source end-points: ${src_eps[*]})"
- read END_POINTS
- [ -z "$END_POINTS" ] && _exit "Invalid empty input !!"
+ if [ ${#src_eps[@]} -eq 1 ]
+ then
+ END_POINTS=$src_eps
+ echo "Detected a unique end-point: $END_POINTS"
+ else
+ echo "Input a space-separated list for desired end-points to be processed as test side: "
+ echo " (available source end-points: ${src_eps[*]})"
+ read END_POINTS
+ [ -z "$END_POINTS" ] && _exit "Invalid empty input !!"
+ fi
fi
# Identify useful frames: those which are created at test-bed side (all except frames coming from tested systems):
count=$((count+1))
done
+echo
exit 0