REPORT_ENV_LIST="$REPORT_ENV_LIST OVL_LOWER"
REPORT_ENV_LIST="$REPORT_ENV_LIST OVL_WORK"
+encode_xml()
+{
+ sed -e 's/&/\&/g' \
+ -e 's/>/\>/g' \
+ -e 's/</\</g' \
+ -e "s/'/\'/g" \
+ -e 's/"/\"/g'
+}
+
#
# Xunit format report functions
_xunit_add_property()
# Header
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $REPORT_DIR/result.xml
local dtime=`echo $date_time| tr " " 'T'`
- local stats="errors=\"$n_bad\" skipped=\"$n_notrun\" tests=\"$n_total\" time=\"$sect_time\""
+ local stats="failures=\"$n_bad\" skipped=\"$n_notrun\" tests=\"$n_total\" time=\"$sect_time\""
local hw_info="hostname=\"$HOST\" timestamp=\"$dtime\" "
echo "<testsuite name=\"xfstests\" $stats $hw_info >" >> $REPORT_DIR/result.xml
;;
"notrun")
if [ -f $seqres.notrun ]; then
- local msg=`cat $seqres.notrun`
+ local msg=`cat $seqres.notrun | encode_xml`
echo -e "\t\t<skipped message=\"$msg\" />" >> $report
else
echo -e "\t\t<skipped/>" >> $report
if [ -s $seqres.full ]; then
echo -e "\t\t<system-out>" >> $report
printf '<![CDATA[\n' >>$report
- cat $seqres.full | tr -dc '[:print:][:space:]' >>$report
+ cat $seqres.full | tr -dc '[:print:][:space:]' | encode_xml >>$report
printf ']]>\n' >>$report
echo -e "\t\t</system-out>" >> $report
fi
if [ -f $seqres.dmesg ]; then
echo -e "\t\t<system-err>" >> $report
printf '<![CDATA[\n' >>$report
- cat $seqres.dmesg | tr -dc '[:print:][:space:]' >>$report
+ cat $seqres.dmesg | tr -dc '[:print:][:space:]' | encode_xml >>$report
printf ']]>\n' >>$report
echo -e "\t\t</system-err>" >> $report
elif [ -s $seqres.out.bad ]; then
echo -e "\t\t<system-err>" >> $report
printf '<![CDATA[\n' >>$report
- $diff $seq.out $seqres.out.bad >>$report
+ $diff $seq.out $seqres.out.bad | encode_xml >>$report
printf ']]>\n' >>$report
echo -e "\t\t</system-err>" >> $report
fi