]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
report: encode the kernel log as a separate xml element
authorDarrick J. Wong <djwong@kernel.org>
Wed, 15 Mar 2023 00:53:10 +0000 (17:53 -0700)
committerZorro Lang <zlang@kernel.org>
Sun, 26 Mar 2023 14:04:51 +0000 (22:04 +0800)
Record the .dmesg file in a new <kernel-log> element instead of
multiplexing it with <system-err>.  This means that the xml report can
now capture kernel log and bad golden output.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/report
doc/xunit.xsd

index eb169175bc0e65ada6d4281140547a9e6e12ce04..2e5959312a6674ed64073e7bd5d4d92a12972bb5 100644 (file)
@@ -137,15 +137,14 @@ _xunit_make_testcase_report()
                        printf ']]>\n'  >>$report
                        echo -e "\t\t</system-out>" >> $report
                fi
-               if [ -n "$quiet" ]; then
-                  :
-               elif [ -f "$dmesg_file" ]; then
-                       echo -e "\t\t<system-err>" >> $report
+               if [ -z "$quiet" -a -f "$dmesg_file" ]; then
+                       echo -e "\t\t<kernel-log>" >> $report
                        printf  '<![CDATA[\n' >>$report
                        cat "$dmesg_file" | tr -dc '[:print:][:space:]' | encode_cdata >>$report
                        printf ']]>\n'  >>$report
-                       echo -e "\t\t</system-err>" >> $report
-               elif [ -s "$outbad_file" ]; then
+                       echo -e "\t\t</kernel-log>" >> $report
+               fi
+               if [ -z "$quiet" -a -s "$outbad_file" ]; then
                        echo -e "\t\t<system-err>" >> $report
                        printf  '<![CDATA[\n' >>$report
                        $diff "$out_src" "$outbad_file" | encode_cdata >>$report
index 3ed72f2f8660b07753bbb5d30f09c0ba12709f20..d287eaf5a25fb604913de898a639b9ebb2955329 100644 (file)
                                 </xs:complexType>
                             </xs:element>
                         </xs:choice>
-                        <xs:choice minOccurs="0" maxOccurs="2">
+                        <xs:choice minOccurs="0" maxOccurs="3">
                             <xs:element name="system-out" minOccurs="0" maxOccurs="1">
                                 <xs:annotation>
                                     <xs:documentation xml:lang="en">Data that was written to the .full log file while the test was executed.</xs:documentation>
                             </xs:element>
                             <xs:element name="system-err" minOccurs="0" maxOccurs="1">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en">Kernel log or data that was compared to the golden output file after the test was executed.</xs:documentation>
+                                    <xs:documentation xml:lang="en">Data that was compared to the golden output file after the test was executed.</xs:documentation>
+                                </xs:annotation>
+                                <xs:simpleType>
+                                    <xs:restriction base="pre-string">
+                                        <xs:whiteSpace value="preserve"/>
+                                    </xs:restriction>
+                                </xs:simpleType>
+                            </xs:element>
+                            <xs:element name="kernel-log" minOccurs="0" maxOccurs="1">
+                                <xs:annotation>
+                                    <xs:documentation xml:lang="en">Kernel log recorded while the test was executed.</xs:documentation>
                                 </xs:annotation>
                                 <xs:simpleType>
                                     <xs:restriction base="pre-string">