report: Add xunit format report generator

xunit[1]/junit[2] are well known report formats for tests frameworks
which supported by most of test CI frameworks(such as Jenkins [3],
Bamboo [4], Avocado [5]) Basically this is just xml document which
can be easily parsed later by external tools.

EXAMPLE:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="xfstests" errors="0" skipped="1" tests="2" time="7"  hostname="alice" timestamp="2017-02-21T15:15:06"  >
	<properties>
		<property name="SECTION" value="ext4"/>
		<property name="FSTYP" value="ext4"/>
		<property name="MOUNT_OPTIONS" value="-o acl,user_xattr "/>
		<property name="HOST_OPTIONS" value="/devel/xfstests-dev.git/configs/alice.config"/>
		<property name="XFS_MKFS_OPTIONS" value="-bsize=4096"/>
		<property name="TIME_FACTOR" value="1"/>
		<property name="LOAD_FACTOR" value="1"/>
		<property name="TEST_DIR" value="/mnt/test"/>
		<property name="TEST_DEV" value="/dev/ram0"/>
		<property name="SCRATCH_DEV" value="/dev/ram1"/>
		<property name="SCRATCH_MNT" value="/mnt/scratch"/>
		<property name="OVERLAY_UPPER_DIR" value="upper"/>
		<property name="OVERLAY_LOWER_DIR" value="lower"/>
		<property name="OVERLAY_WORK_DIR" value="work"/>
	</properties>
	<testcase classname="xfstests.ext4" name="generic/001" time="5">
	</testcase>
	<testcase classname="xfstests.ext4" name="generic/010" time="1">
		<skipped message="src/dbtest not built" />
	</testcase>
</testsuite>

Footnotes:
[1] https://xunit.github.io/docs/format-xml-v2.html
[2] http://help.catchsoftware.com/display/ET/JUnit+Format
[3] https://jenkins.io
[4] https://www.atlassian.com/software/bamboo
[5] https://github.com/avocado-framework/avocado

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Dmitry Monakhov
2017-03-03 12:26:16 +04:00
committed by Eryu Guan
parent e11c519918
commit f9fde7db2f
3 changed files with 208 additions and 9 deletions
+5 -1
View File
@@ -174,6 +174,11 @@ case "$FSTYP" in
;;
esac
if [ ! -z "$REPORT_LIST" ]; then
. ./common/report
_assert_report_list
fi
_mount()
{
$MOUNT_PROG `_mount_ops_filter $*`
@@ -3431,7 +3436,6 @@ _get_fs_sysfs_attr()
}
init_rc
################################################################################