From patchwork Wed Feb 15 01:45:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 352D2C61DA4 for ; Wed, 15 Feb 2023 01:45:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231915AbjBOBpr (ORCPT ); Tue, 14 Feb 2023 20:45:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjBOBpq (ORCPT ); Tue, 14 Feb 2023 20:45:46 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AD1D3402B; Tue, 14 Feb 2023 17:45:46 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A2C7761838; Wed, 15 Feb 2023 01:45:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CCCEC433D2; Wed, 15 Feb 2023 01:45:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425545; bh=JEHKTMcR0JjN3sUcGPkUrzWY3uyycwiiw7GJc93Tths=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=bya+3Jl9jSIzsu6O2i1YYGTFtKkRYg6NpEmvtSC9gTCaUwuNhGt8MDjl+d+/SC/qB 79de5/NohrOk0IQNg+yjeH3Q1zuuORstMnqSTReBkS2WTmLHCXegAnRLP8F9QtRQ+C ro/M+7dbtTfmO2AuzBZM9R3U3auFT51/uokOX8MOBcTszDvjagfqogTakvkMp3GwoW SJh/XO9ShvwKhtuUAtTJRU2GkGJtRifmV50lead57Co6uhIHTgeLsN2n1FIsUn5b/m JrLtCgxnWF1bZorIJuBVblAsreEf9wKV+ViHill45XrD/7x44fMEKmHOn/5+nPTaos /Q5w1/t0ih/7A== Subject: [PATCH 01/14] check: generate section reports between tests From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:45:44 -0800 Message-ID: <167642554451.2118945.4503850138465303711.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Generate the section report between tests so that the summary report always reflects the outcome of the most recent test. Two usecases are envisioned here -- if a cluster-based test runner anticipates that the testrun could crash the VM, they can set REPORT_DIR to (say) an NFS mount to preserve the intermediate results. If the VM does indeed crash, the scheduler can examine the state of the crashed VM and move the tests to another VM. The second usecase is a reporting agent that runs in the VM to upload live results to a test dashboard. Signed-off-by: Darrick J. Wong --- check | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/check b/check index 0bf5b22e06..14b398fd73 100755 --- a/check +++ b/check @@ -844,6 +844,15 @@ function run_section() fi seqres="$REPORT_DIR/$seqnum" + # Generate the entire section report with whatever test results + # we have so far. Leave the $sect_time parameter empty so that + # it's a little more obvious that this test run is incomplete. + if $do_report; then + _make_section_report "$section" "${#try[*]}" \ + "${#bad[*]}" "${#notrun[*]}" \ + "" &> /dev/null + fi + mkdir -p $RESULT_DIR rm -f ${RESULT_DIR}/require_scratch* rm -f ${RESULT_DIR}/require_test* From patchwork Wed Feb 15 01:45:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1AB5C05027 for ; Wed, 15 Feb 2023 01:45:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232704AbjBOBp4 (ORCPT ); Tue, 14 Feb 2023 20:45:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjBOBpz (ORCPT ); Tue, 14 Feb 2023 20:45:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7230734C35; Tue, 14 Feb 2023 17:45:53 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EE739B81F88; Wed, 15 Feb 2023 01:45:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEB50C4339C; Wed, 15 Feb 2023 01:45:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425550; bh=6xuL0iZpbpNe1aGEaEvrrl+l0+uunevUefzRUNb0YhY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=nJNQPZ5aLgGqVHkFSj2ebg7XF+SqTEBMxvOhfgYdDDz6wjKh9GASY7Ns4atxRicvS a2rEoP1q1lUrE8Jx9EGN53QzIe/y9+84FkU55RQJrW1Dqdfqw6+on541qdjLD54c+B TYO0t4KpH8ys1kwWjSEkdiHnqj788NPyG9ZUODyz6c2u8hZlU/68E3cdjT1tmk7QRy JrfQcrPKt+05l+zMs+nfVVD4wROXCfYvLfWPQtygqq/vXRWw86UEc+vgSSmJ3dctnI e0SLaqjm2IpBRS3GwTlUhOnn9/k15zCfP2thUSDd4KSS6NBFtDwjEdmpUx7L9qKBbS 1iI/ob0YDJNhg== Subject: [PATCH 02/14] report: derive an xml schema for the xunit report From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:45:50 -0800 Message-ID: <167642555019.2118945.6370812393585562210.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong The "xunit" report format emits an XML document that more or less follows the junit xml schema. However, there are two major exceptions: 1. fstests does not emit an @errors attribute on the testsuite element because we don't have the concept of unanticipated errors such as "unchecked throwables". 2. The system-out/system-err elements sound like they belong under the testcase element, though the schema itself imprecisely says "while the test was executed". The schema puts them under the top-level testsuite element, but we put them under the testcase element. Define an xml schema for the xunit report format, and update the xml headers to link to the schema file. This enables consumers of the reports to check mechanically that the incoming document follows the format. Signed-off-by: Darrick J. Wong --- common/report | 15 +++- doc/xunit.xsd | 226 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 238 insertions(+), 3 deletions(-) create mode 100644 doc/xunit.xsd diff --git a/common/report b/common/report index 64f9c86648..1d84650270 100644 --- a/common/report +++ b/common/report @@ -48,9 +48,18 @@ _xunit_make_section_report() if [ -z "$date_time" ]; then date_time=$(date +"%F %T") fi - local stats="failures=\"$bad_count\" skipped=\"$notrun_count\" tests=\"$tests_count\" time=\"$sect_time\"" - local hw_info="hostname=\"$HOST\" timestamp=\"${date_time/ /T}\" " - echo "" >> $REPORT_DIR/result.xml + + local fstests_ns="https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git" + cat >> $REPORT_DIR/result.xml << ENDL + +ENDL # Properties echo -e "\t" >> $REPORT_DIR/result.xml diff --git a/doc/xunit.xsd b/doc/xunit.xsd new file mode 100644 index 0000000000..ba97ccd67d --- /dev/null +++ b/doc/xunit.xsd @@ -0,0 +1,226 @@ + + + + fstests xunit test result schema, derived from https://github.com/windyroad/JUnit-Schema + + + + + + + + + + Contains an aggregation of testsuite results + + + + + + + + + + Derived from testsuite/@name in the non-aggregated documents + + + + + Starts at '0' for the first testsuite and is incremented by 1 for each following testsuite + + + + + + + + + + + + Contains the results of executing a testsuite + + + + + Properties (e.g., environment settings) set during test execution + + + + + + + + + + + + + + + + + + + + + + + + + Indicates that the test was skipped. + + + + + + + The message specifying why the test case was skipped + + + + + + + + + Indicates that the test errored. An errored test is one that had an unanticipated problem. e.g., an unchecked throwable; or a problem with the implementation of the test. Contains as a text node relevant data for the error, e.g., a stack trace + + + + + + + The error message. e.g., if a java exception is thrown, the return value of getMessage() + + + + + The type of error that occured. e.g., if a java execption is thrown the full class name of the exception. + + + + + + + + + Indicates that the test failed. A failure is a test which the code has explicitly failed by using the mechanisms for that purpose. e.g., via an assertEquals. Contains as a text node relevant data for the failure, e.g., a stack trace + + + + + + + The message specified in the assert + + + + + The type of the assert. + + + + + + + + + + + Data that was written to the .full log file while the test was executed. + + + + + + + + + + Kernel log or data that was compared to the golden output file after the test was executed. + + + + + + + + + + + + Name of the test method + + + + + Full class name for the class the test method is in. + + + + + Time taken (in seconds) to execute the test + + + + + + + + Full class name of the test for non-aggregated testsuite documents. Class name without the package for aggregated testsuites documents + + + + + + + + + + when the test was executed. Timezone may not be specified. + + + + + Host on which the tests were executed. 'localhost' should be used if the hostname cannot be determined. + + + + + + + + + + The total number of tests in the suite + + + + + The total number of tests in the suite that failed. A failure is a test which the code has explicitly failed by using the mechanisms for that purpose. e.g., via an assertEquals + + + + + The total number of ignored or skipped tests in the suite. + + + + + Time taken (in seconds) to execute the tests in the suite + + + + + + + + + From patchwork Wed Feb 15 01:45:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88B67C64EC7 for ; Wed, 15 Feb 2023 01:45:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232544AbjBOBp6 (ORCPT ); Tue, 14 Feb 2023 20:45:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjBOBp6 (ORCPT ); Tue, 14 Feb 2023 20:45:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CEF133462; Tue, 14 Feb 2023 17:45:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EC21E6199D; Wed, 15 Feb 2023 01:45:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5950CC433D2; Wed, 15 Feb 2023 01:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425556; bh=Qik54vovpc327jWLgD9UI6QzowU+B6J69BoZPVm2b8I=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=GPNKgSDk6eTLhDxlepOXTgKvhwRFiCXWSs9UMkIdxiEW67jKsplhPgAeIuLqnpVWS GT32ya2W9xk8qR+7YqjOjoSrIF0LNKgyqbJ5fX2q7s1WQAgJC0iyQfA78OhyXaz2mU pJLNkfUuFFnoQIBvuhqCQFFGGVvKV4KXL+zplqyky40l78WfMbFZ2OXr1yBIors5Mx bAqszw8LISSpSWUwwcMcI9Lb6LHMRwHMrSJYHV72TWlD+bnw84mKZ4smmA69TsE6qa 6FsDyk7UmqTf56fUJAirjNatcOmPZ6RmeZ7ZOuHXoBG6OodFvtJZ7nDPRSMoOhSlkj 2ava0u6fgWsKA== Subject: [PATCH 03/14] report: capture the time zone in the test report timestamp From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: Qu Wenruo , linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:45:55 -0800 Message-ID: <167642555589.2118945.10596092258523998280.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Make sure we put the time zone of the system running the test in the timestamp that is recorded in the xunit report. `date "+%F %T"' reports the local time zone, not UTC. Signed-off-by: Darrick J. Wong Reviewed-by: Qu Wenruo --- common/report | 9 ++++++--- doc/xunit.xsd | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/common/report b/common/report index 1d84650270..1817132d51 100644 --- a/common/report +++ b/common/report @@ -38,6 +38,7 @@ _xunit_make_section_report() local bad_count="$3" local notrun_count="$4" local sect_time="$5" + local timestamp if [ $sect_name == '-no-sections-' ]; then sect_name='global' @@ -45,8 +46,10 @@ _xunit_make_section_report() local report=$tmp.report.xunit.$sect_name.xml # Header echo "" > $REPORT_DIR/result.xml - if [ -z "$date_time" ]; then - date_time=$(date +"%F %T") + if [ -n "$date_time" ]; then + timestamp="$(date -Iseconds --date="$date_time")" + else + timestamp="$(date -Iseconds)" fi local fstests_ns="https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git" @@ -58,7 +61,7 @@ _xunit_make_section_report() name="xfstests" failures="$bad_count" skipped="$notrun_count" tests="$tests_count" time="$sect_time" - hostname="$HOST" timestamp="${date_time/ /T}"> + hostname="$HOST" timestamp="$timestamp"> ENDL # Properties diff --git a/doc/xunit.xsd b/doc/xunit.xsd index ba97ccd67d..9295c5dc82 100644 --- a/doc/xunit.xsd +++ b/doc/xunit.xsd @@ -12,7 +12,7 @@ - + @@ -184,7 +184,7 @@ - when the test was executed. Timezone may not be specified. + when the test was executed. Timezone must be specified as an offset from UTC. From patchwork Wed Feb 15 01:46:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141188 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 138F8C6379F for ; Wed, 15 Feb 2023 01:46:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232865AbjBOBqH (ORCPT ); Tue, 14 Feb 2023 20:46:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjBOBqG (ORCPT ); Tue, 14 Feb 2023 20:46:06 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5C4934028; Tue, 14 Feb 2023 17:46:04 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4C43CB81F5F; Wed, 15 Feb 2023 01:46:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9B32C433D2; Wed, 15 Feb 2023 01:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425562; bh=2dLtk/dgWRSizQWYnWSkBBdxwheAzIh/VcgGY5g7LpY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=WBB4tYPmxHZ0iL+B/ikqtZHwR5ZRJP1DOJQHMk8U8Sk2+plo4yssumpDcj9yM+Yav Ct5qnE/7V3/fUCNd4FcysvRJYSgaOt6mSHKW8R5OECbIOJu9Dli6RiLz927x5rsTeI 2BuOaOH3+MYtRZPQ4TnBhsPGwT6KynbEv31Umm1U5PnrhWsxtkVHXIlafqFOV1yP42 6yLTDAGh9AGNF63MiautTToEmk6H1a2WaVFEtmSI8Qvk/ITa4Lw9Hb/iDXLlr2vt4y 9OUUmXZdmDMmDozkZAh0nbAkcF7FGOSWc1xCgtoh81Z5HygOHKHJ208ENK723gZNFC yFK2iz+sKVVSw== Subject: [PATCH 04/14] report: clarify the meaning of the timestamp attribute From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:46:01 -0800 Message-ID: <167642556151.2118945.10705623662883054692.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong We've never specified what the timestamp attribute of the testsuite element actually means, and it history is rather murky. Prior to the introduction of the xml report format in commit f9fde7db2f, the "date_time" variable was used only to scrape dmesg via the /dev/kmsg device after each test. If /dev/kmsg was not a writable path, the variable was not set at all. In this case, the report timestamp would be blank. In commit ffdecf7498a1, Ted changed the xunit report code to handle empty date_time values by setting date_time to the time of report generation. This change was done to handle the case where no tests are run at all. However, it did not change the behavior that date_time is not set if /dev/kmsg is not writable. Clear up all this confusion by defining the timestamp attribute to reflect the start time of the most recent test, regardless of the state of /dev/kmsg. If no tests are run, then define the attribute to be the time of report generation. Signed-off-by: Darrick J. Wong --- check | 1 + common/report | 8 +++++--- doc/xunit.xsd | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/check b/check index 14b398fd73..f2be3d7d7d 100755 --- a/check +++ b/check @@ -917,6 +917,7 @@ function run_section() # to be reported for each test (echo 1 > $DEBUGFS_MNT/clear_warn_once) > /dev/null 2>&1 + test_start_time="$(date +"%F %T")" if [ "$DUMP_OUTPUT" = true ]; then _run_seq 2>&1 | tee $tmp.out # Because $? would get tee's return code diff --git a/common/report b/common/report index 1817132d51..8e19e9f557 100644 --- a/common/report +++ b/common/report @@ -46,8 +46,8 @@ _xunit_make_section_report() local report=$tmp.report.xunit.$sect_name.xml # Header echo "" > $REPORT_DIR/result.xml - if [ -n "$date_time" ]; then - timestamp="$(date -Iseconds --date="$date_time")" + if [ -n "$test_start_time" ]; then + timestamp="$(date -Iseconds --date="$test_start_time")" else timestamp="$(date -Iseconds)" fi @@ -61,7 +61,9 @@ _xunit_make_section_report() name="xfstests" failures="$bad_count" skipped="$notrun_count" tests="$tests_count" time="$sect_time" - hostname="$HOST" timestamp="$timestamp"> + hostname="$HOST" + timestamp="$timestamp" +> ENDL # Properties diff --git a/doc/xunit.xsd b/doc/xunit.xsd index 9295c5dc82..653f486871 100644 --- a/doc/xunit.xsd +++ b/doc/xunit.xsd @@ -184,7 +184,7 @@ - when the test was executed. Timezone must be specified as an offset from UTC. + Time that the last testcase was started. If no tests are started, this is the time the report was generated. Timezone must be specified as an offset from UTC. From patchwork Wed Feb 15 01:46:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23C9FC64EC7 for ; Wed, 15 Feb 2023 01:46:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229949AbjBOBqK (ORCPT ); Tue, 14 Feb 2023 20:46:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbjBOBqJ (ORCPT ); Tue, 14 Feb 2023 20:46:09 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A84FC3344E; Tue, 14 Feb 2023 17:46:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 442EE6199D; Wed, 15 Feb 2023 01:46:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A88CFC433EF; Wed, 15 Feb 2023 01:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425567; bh=W2HFy7gevwuyCLmk5A6qMgfDk4GwnyEbZWcPH1HRhGk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Yx5U4x5VUqN1cyW+RqhdE9PRadLTgotk8q3TRNQlbbWGhMX3lYqvJIWEAuAm4aTuT HTxwY35eomp5e/blMD8iTNuxdgJ/PCAwutrnZln4DEuv4/5zmwy81TqgHuZZhkCBs7 k9Po6adCLHL2hLkkizMl485rY0Nb/nmkFDpNnRJlNZ8ucbQCh4oEkJds6E5znEti8N Z4qO6pt0M0CvaZozkOsa2X14TtV3bpXn9KvjxAUHiqhRWBjfk2z7EMooZEE4AWcNJw /4GV6l2752X+9RnyTvAZwsWkwPHDe9OTPdv/MpIgI/JN2c4VJwcrWcbXtflDfWtxpI F0lRU3y2ZUrnQ== Subject: [PATCH 05/14] report: record fstests start and report generation timestamps From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:46:07 -0800 Message-ID: <167642556710.2118945.13688640580029423327.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Report two new timestamps in the xml report: the time that ./check was started, and the time that the report was generated. We introduce new timestamps to minimize breakage with parsing scripts. Signed-off-by: Darrick J. Wong --- check | 1 + common/report | 4 +++- doc/xunit.xsd | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/check b/check index f2be3d7d7d..1a58a2b269 100755 --- a/check +++ b/check @@ -668,6 +668,7 @@ _run_seq() { _detect_kmemleak _prepare_test_list +fstests_start_time="$(date +"%F %T")" if $OPTIONS_HAVE_SECTIONS; then trap "_summary; exit \$status" 0 1 2 3 15 diff --git a/common/report b/common/report index 8e19e9f557..be991b55f5 100644 --- a/common/report +++ b/common/report @@ -62,7 +62,9 @@ _xunit_make_section_report() name="xfstests" failures="$bad_count" skipped="$notrun_count" tests="$tests_count" time="$sect_time" hostname="$HOST" - timestamp="$timestamp" + start_timestamp="$(date -Iseconds --date="$fstests_start_time")" + timestamp="$timestamp" + report_timestamp="$(date -Iseconds)" > ENDL diff --git a/doc/xunit.xsd b/doc/xunit.xsd index 653f486871..3ed72f2f86 100644 --- a/doc/xunit.xsd +++ b/doc/xunit.xsd @@ -187,6 +187,16 @@ Time that the last testcase was started. If no tests are started, this is the time the report was generated. Timezone must be specified as an offset from UTC. + + + Time that the report was generated. + + + + + Time that fstests was started. + + Host on which the tests were executed. 'localhost' should be used if the hostname cannot be determined. From patchwork Wed Feb 15 01:46:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141190 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F80BC61DA4 for ; Wed, 15 Feb 2023 01:46:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229674AbjBOBqR (ORCPT ); Tue, 14 Feb 2023 20:46:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232107AbjBOBqQ (ORCPT ); Tue, 14 Feb 2023 20:46:16 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0184233462; Tue, 14 Feb 2023 17:46:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A569FB81F5F; Wed, 15 Feb 2023 01:46:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51589C433EF; Wed, 15 Feb 2023 01:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425573; bh=5ZjDhw74kNEdDtZQQatDNNzQ8pK7OUwxcc6xRLiOFg4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=ZNhsbal8V0IYRK1bq7pbWqvULYt8Rz4+Zy0PTw7AY7cn3OguBhr2b5tJbLbOkRpPD NtCfT7wwFbANcIwGhjyTAp383vq8Pyx/xfxWEu1R0++bthHToDI7N+d7rp9I17152a 5LDvixU1CCgoEwNQwM/cOaTkJrV+DzHMmelm3je1dqInPflq6GitGG8hA7SI2s55fG bSYwCxxWNy4c8vuwSM9lwyp1lw5OUWyE42ihQqnC0O6zmqjNn1v/732ep015Uamoad X3Nh8Q1cYpV0xAFlosKojLt9MTTR//DvNlKawBkesaqjyzAh5pggw06nwaukkEe/Kk Xb0Eonl6wUzMA== Subject: [PATCH 06/14] report: encode cdata sections correctly From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:46:12 -0800 Message-ID: <167642557283.2118945.17850442578198357959.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong The XML report format captures the contents of .full and .out.bad files in CDATA sections. CDATA sections are supposed to be a stream of verbatim data, terminated with a "]]>". Hence XML entities such as quotation marks and angle brackes should not be escaped, and an actual bracket-bracket-gt sequence in those files /does/ need escaping. Create a separate filtering function so that these files are encoded properly. Signed-off-by: Darrick J. Wong --- common/report | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/common/report b/common/report index be991b55f5..eb169175bc 100644 --- a/common/report +++ b/common/report @@ -19,6 +19,11 @@ encode_xml() -e 's/"/\"/g' } +encode_cdata() +{ + cat -v | sed -e 's/]]>/]]]]>/g' +} + # # Xunit format report functions _xunit_add_property() @@ -128,7 +133,7 @@ _xunit_make_testcase_report() if [ -z "$quiet" -a -s "$full_file" ]; then echo -e "\t\t" >> $report printf '>$report - cat "$full_file" | tr -dc '[:print:][:space:]' | encode_xml >>$report + cat "$full_file" | tr -dc '[:print:][:space:]' | encode_cdata >>$report printf ']]>\n' >>$report echo -e "\t\t" >> $report fi @@ -137,13 +142,13 @@ _xunit_make_testcase_report() elif [ -f "$dmesg_file" ]; then echo -e "\t\t" >> $report printf '>$report - cat "$dmesg_file" | tr -dc '[:print:][:space:]' | encode_xml >>$report + cat "$dmesg_file" | tr -dc '[:print:][:space:]' | encode_cdata >>$report printf ']]>\n' >>$report echo -e "\t\t" >> $report elif [ -s "$outbad_file" ]; then echo -e "\t\t" >> $report printf '>$report - $diff "$out_src" "$outbad_file" | encode_xml >>$report + $diff "$out_src" "$outbad_file" | encode_cdata >>$report printf ']]>\n' >>$report echo -e "\t\t" >> $report fi From patchwork Wed Feb 15 01:46:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141191 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 487F2C61DA4 for ; Wed, 15 Feb 2023 01:46:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232720AbjBOBqY (ORCPT ); Tue, 14 Feb 2023 20:46:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232749AbjBOBqY (ORCPT ); Tue, 14 Feb 2023 20:46:24 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A6EE33462; Tue, 14 Feb 2023 17:46:21 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 46F72B81F88; Wed, 15 Feb 2023 01:46:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDAB4C433EF; Wed, 15 Feb 2023 01:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425578; bh=aDoHPwIX71sr2bOvQRnxSv2gH4rLK/XOdaCIF4+rU80=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=ZRrRWAgQYuX6aMrKU8hjmjBBDlGoAAfOX72LZPz7KyoNDoTbEhd8PzbB4sS0BiFpq Ogm2XLwgoNXWTUxAtmrdf7KmIlWgGvLK3KaseBypU0pbQq7DiV8+t4I73Rtm3eySQv 8Dt0JUd5rOZNECuXmxEEgEN9FPpqYDBqIpb76Rb1tFlN1PMQyliJRyK0T7X73YmjRx l0aVlLcxcBTkLeenC0C0jBDuO8lvI6W6NJiufSLAzrnEuuXQjREoBBF2oWzXH8PUw3 F4tZnUYwO7uLu3k0/udnbCarGeaQL45prFGHTiZIKSJUNthYh/HbRWmKq4LUr4xh+f wGD2aOvYUl5Ug== Subject: [PATCH 07/14] report: encode the kernel log as a separate xml element From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:46:18 -0800 Message-ID: <167642557848.2118945.1727380164070339363.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Record the .dmesg file in a new element instead of multiplexing it with . This means that the xml report can now capture kernel log and bad golden output. Signed-off-by: Darrick J. Wong --- common/report | 11 +++++------ doc/xunit.xsd | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/common/report b/common/report index eb169175bc..2e5959312a 100644 --- a/common/report +++ b/common/report @@ -137,15 +137,14 @@ _xunit_make_testcase_report() printf ']]>\n' >>$report echo -e "\t\t" >> $report fi - if [ -n "$quiet" ]; then - : - elif [ -f "$dmesg_file" ]; then - echo -e "\t\t" >> $report + if [ -z "$quiet" -a -f "$dmesg_file" ]; then + echo -e "\t\t" >> $report printf '>$report cat "$dmesg_file" | tr -dc '[:print:][:space:]' | encode_cdata >>$report printf ']]>\n' >>$report - echo -e "\t\t" >> $report - elif [ -s "$outbad_file" ]; then + echo -e "\t\t" >> $report + fi + if [ -z "$quiet" -a -s "$outbad_file" ]; then echo -e "\t\t" >> $report printf '>$report $diff "$out_src" "$outbad_file" | encode_cdata >>$report diff --git a/doc/xunit.xsd b/doc/xunit.xsd index 3ed72f2f86..d287eaf5a2 100644 --- a/doc/xunit.xsd +++ b/doc/xunit.xsd @@ -131,7 +131,7 @@ - + Data that was written to the .full log file while the test was executed. @@ -144,7 +144,17 @@ - Kernel log or data that was compared to the golden output file after the test was executed. + Data that was compared to the golden output file after the test was executed. + + + + + + + + + + Kernel log recorded while the test was executed. From patchwork Wed Feb 15 01:46:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141192 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5C12C64EC7 for ; Wed, 15 Feb 2023 01:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232850AbjBOBq1 (ORCPT ); Tue, 14 Feb 2023 20:46:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230299AbjBOBq0 (ORCPT ); Tue, 14 Feb 2023 20:46:26 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D3343400F; Tue, 14 Feb 2023 17:46:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 17FE761838; Wed, 15 Feb 2023 01:46:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7910EC433D2; Wed, 15 Feb 2023 01:46:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425584; bh=NklK8j5aIk23WQ11zKifZreUOFsN+M1nMiw6yA+yz64=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=XGX2DCXeWexgXn/fRcFQW5mkbZ2ofZUp+SQmjExDYBTQ3Wm9jQgVV5gQuHQX56xDb yQv1Lccax+hR78Qu6QVJPizSEtfbCWz8FKl6jYgmIzO0kbG9i+pPy0RzJbnwAV5fuf Dyp9bFNKLbgFpCV48WhV68Ue82b/P+nLaezpczpyPm3W/gVIG/BzfYXb6hmgVgjisn vZK97GYhPVnWUvBdRZPhSCDOqO9xdO9jkkpgjj9mWNAPFHHtMpe6UpmyzTqqyLLubU AVma1tZSv8l+fh9SReEh3Xu/jSDl0ypz2PIBbvr7D21yrdkQLX+Z6MXIXqvtQ9mpdl ZDbU7Q4OX/Pzw== Subject: [PATCH 08/14] report: sort properties by name From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:46:24 -0800 Message-ID: <167642558408.2118945.1132135244227280829.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong When we're generating a junit xml report, always sort the properties by name. This makes it easier for humans to find a particular property. Signed-off-by: Darrick J. Wong --- common/report | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/report b/common/report index 2e5959312a..3ec2d88178 100644 --- a/common/report +++ b/common/report @@ -32,7 +32,7 @@ _xunit_add_property() local value="${!name}" if [ ! -z "$value" ]; then - echo -e "\t\t" >> $REPORT_DIR/result.xml + echo -e "\t\t" fi } _xunit_make_section_report() @@ -77,7 +77,7 @@ ENDL echo -e "\t" >> $REPORT_DIR/result.xml for p in "${REPORT_ENV_LIST[@]}"; do _xunit_add_property "$p" - done + done | sort >> $REPORT_DIR/result.xml echo -e "\t" >> $REPORT_DIR/result.xml if [ -f $report ]; then cat $report >> $REPORT_DIR/result.xml From patchwork Wed Feb 15 01:46:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F6DAC05027 for ; Wed, 15 Feb 2023 01:46:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233066AbjBOBqc (ORCPT ); Tue, 14 Feb 2023 20:46:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230299AbjBOBqb (ORCPT ); Tue, 14 Feb 2023 20:46:31 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24EC13344E; Tue, 14 Feb 2023 17:46:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B3C6A6199D; Wed, 15 Feb 2023 01:46:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E77EC433D2; Wed, 15 Feb 2023 01:46:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425590; bh=FA4EEx8gfdDz4k6GWGgK8hBjfnTqt2wh6MFCE1JniaM=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=ONjxZqcr3ZnoTlp5gQuU+lJ1H/Xp7n4IKwWudfcUGqvmRGPtNxvxn6kAfh+v5FE+X q15FovZCxk61zFdwdONMFls3tk0ReDYfK9D0YsWIk46uOxVShxNvmchQWNQcruHgj7 8RtZ5VN2wYt5xrEcoMd0Xb4ZXf2o8M/i8DqMEZleJvTsnqs4X1PDxq1O1n3h8D2dwb HnjkfrebW6dYrgGasAt9h6tSJUJ52r0+1vkGXV22o1bfDadHYLf7OhZy6WI1o8kM40 J+BW5UPEgFSvrSceAd93dyseBJpMJs3QCP/y+kSGYIt78pr4HnDclO+7OANp1zNq27 eyRNzBABDlLCg== Subject: [PATCH 09/14] report: pass property value to _xunit_add_property From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:46:29 -0800 Message-ID: <167642558963.2118945.5072238407025556768.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Change this helper to require the caller to pass the value as the second parameter. This prepares us to start reporting a lot more information about a test run, not all of which are encoded as bash variables. Signed-off-by: Darrick J. Wong --- common/report | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/common/report b/common/report index 3ec2d88178..2ab83928db 100644 --- a/common/report +++ b/common/report @@ -29,12 +29,13 @@ encode_cdata() _xunit_add_property() { local name="$1" - local value="${!name}" + local value="$2" - if [ ! -z "$value" ]; then - echo -e "\t\t" - fi + test -z "$value" && return + + echo -e "\t\t" } + _xunit_make_section_report() { # xfstest:section ==> xunit:testsuite @@ -76,7 +77,7 @@ ENDL # Properties echo -e "\t" >> $REPORT_DIR/result.xml for p in "${REPORT_ENV_LIST[@]}"; do - _xunit_add_property "$p" + _xunit_add_property "$p" "${!p}" done | sort >> $REPORT_DIR/result.xml echo -e "\t" >> $REPORT_DIR/result.xml if [ -f $report ]; then From patchwork Wed Feb 15 01:46:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141194 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFED6C61DA4 for ; Wed, 15 Feb 2023 01:46:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231871AbjBOBqi (ORCPT ); Tue, 14 Feb 2023 20:46:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230299AbjBOBqh (ORCPT ); Tue, 14 Feb 2023 20:46:37 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C724B3344E; Tue, 14 Feb 2023 17:46:36 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 62C7C6196F; Wed, 15 Feb 2023 01:46:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C48C4C433EF; Wed, 15 Feb 2023 01:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425595; bh=RiD9GhkALst5gh+pM8o1R7jQftIUnOhJS1DqyE/m0/Q=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Jpsebc+vDRRrNK/9kUDeD9+5ApOnZeCNACOA3/TBI3W5qXU3aFKoTtorFepziOr9P suorv5PGv3wvJKssdLbGNnaRqrhvaMYAoYy1x/DcUuZmrUVfpIr1OSmZrTEB62Fs9b o2bgScpa57JpabWMKOeSI5sbGIAWypJv5k1v8++14MK/YSEMOCNf+20NTEZGjymTcy A6jQxnoSzfhwtsrkrzyj4QG2vEngykcUMC+6JB+kWuCFrBy7VK9iJ5dgtt9WhYDw1Z +ELSeAelTURFW9dR5Il3Qk5dl3/0x0XemjXVL3yobouWoRYkfV3LaHYCnxMbeudLhd 0DStYWcjTEodw== Subject: [PATCH 10/14] report: encode xml entities in property values From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:46:35 -0800 Message-ID: <167642559529.2118945.3777372837490960741.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Avoid trouble with the properties reported in the xml reports by translating xml-tricky characters in the property values into their xml entity equivalents. IOWs, if someone sets a property "NAME" to the value 'BOBBY"; DROP TABLES;', the xml will be formatted: Thus avoiding XML problems. Signed-off-by: Darrick J. Wong --- common/report | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/report b/common/report index 2ab83928db..946ee4887c 100644 --- a/common/report +++ b/common/report @@ -33,7 +33,10 @@ _xunit_add_property() test -z "$value" && return - echo -e "\t\t" + local xname="$(echo "$name" | encode_xml)" + local xvalue="$(echo "$value" | encode_xml)" + + echo -e "\t\t" } _xunit_make_section_report() From patchwork Wed Feb 15 01:46:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141195 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B1AFC64ED6 for ; Wed, 15 Feb 2023 01:46:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233674AbjBOBqo (ORCPT ); Tue, 14 Feb 2023 20:46:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233553AbjBOBqn (ORCPT ); Tue, 14 Feb 2023 20:46:43 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70B8334C02; Tue, 14 Feb 2023 17:46:42 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0D20D619A0; Wed, 15 Feb 2023 01:46:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E075C433D2; Wed, 15 Feb 2023 01:46:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425601; bh=i7xX0hc8MsLy1WOFx+zcMT7yce6kJuM32RN5aTkt17s=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=bbVitDWbqiJ41lUZ9pbURoRrVLlIgM6iZU0De2b+pVy8asMA9W76Nf45DpQwZZxhN GYPIqLV/4/xiLuycBqLzdPQandaK5jNcRXyYGj/4U+IPFx/FHgx/A6sgwZXM7pFT3s Gc7YpPRH9A/+wnYPlV5JFGuE7/wRAq2YOArAki45RtnkxMNNZY1CZDHNMbAkNdjvc6 YlB85Gec96OL/omKTInTizxasBJFTVetBPBkhvbEC7iK6klQaWM/M5bI6zbEQZM87m AUP6KCNRPmKyGAvNDQ229KsC1maZrXCNzg9GLln8YufnBiVFOeSzHPW9QMMeIcaQz7 mDs+0ezJrMt8A== Subject: [PATCH 11/14] report: collect basic information about a test run From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:46:40 -0800 Message-ID: <167642560096.2118945.2213668079344484441.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Record various generic information about an fstests run when generating a junit xml report. This includes the cpu architecture, the kernel revision, the CPU, memory, and numa node counts, and some information about the block devices passed in. Signed-off-by: Darrick J. Wong --- common/report | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/common/report b/common/report index 946ee4887c..90d4f980d1 100644 --- a/common/report +++ b/common/report @@ -24,6 +24,42 @@ encode_cdata() cat -v | sed -e 's/]]>/]]]]>/g' } +# Fill out REPORT_VARS with information about the block device referred to by +# the passed-in bash variable. +__generate_blockdev_report_vars() { + local bdev_var="$1" + local bdev="${!bdev_var}" + + test -z "$bdev" && return + test -b "$bdev" || return + local sysfs_bdev="$(_sysfs_dev "$bdev")" + + REPORT_VARS["${bdev_var}_SIZE_KB"]="$(( "$(blockdev --getsz "$bdev")" / 2 ))" + REPORT_VARS["${bdev_var}_ROTATIONAL"]="$(cat "$sysfs_bdev/queue/rotational" 2>/dev/null)" + REPORT_VARS["${bdev_var}_DAX"]="$(cat "$sysfs_bdev/queue/dax" 2>/dev/null)" + REPORT_VARS["${bdev_var}_DISCARD"]="$(sed -e 's/[1-9][0-9]*/1/g' "$sysfs_bdev/queue/discard_max_bytes" 2>/dev/null)" + REPORT_VARS["${bdev_var}_WRITE_ZEROES"]="$(sed -e 's/[1-9][0-9]*/1/g' "$sysfs_bdev/queue/write_zeroes_max_bytes" 2>/dev/null)" + REPORT_VARS["${bdev_var}_PHYS_BLOCK_BYTES"]="$(cat "$sysfs_bdev/queue/physical_block_size" 2>/dev/null)" + REPORT_VARS["${bdev_var}_LBA_BYTES"]="$(cat "$sysfs_bdev/queue/logical_block_size" 2>/dev/null)" + REPORT_VARS["${bdev_var}_ZONES"]="$(cat "$sysfs_bdev/queue/nr_zones" 2>/dev/null)" +} + +# Fill out REPORT_VARS with tidbits about our test runner configuration. +# Caller is required to declare REPORT_VARS to be an associative array. +__generate_report_vars() { + REPORT_VARS["ARCH"]="$(uname -m)" + REPORT_VARS["KERNEL"]="$(uname -r)" + REPORT_VARS["CPUS"]="$(getconf _NPROCESSORS_ONLN 2>/dev/null)" + REPORT_VARS["MEM_KB"]="$(grep MemTotal: /proc/meminfo | awk '{print $2}')" + REPORT_VARS["SWAP_KB"]="$(grep SwapTotal: /proc/meminfo | awk '{print $2}')" + + test -e /sys/devices/system/node/possible && \ + REPORT_VARS["NUMA_NODES"]="$(cat /sys/devices/system/node/possible 2>/dev/null)" + + __generate_blockdev_report_vars "TEST_DEV" + __generate_blockdev_report_vars "SCRATCH_DEV" +} + # # Xunit format report functions _xunit_add_property() @@ -77,11 +113,17 @@ _xunit_make_section_report() > ENDL + declare -A REPORT_VARS + __generate_report_vars + # Properties echo -e "\t" >> $REPORT_DIR/result.xml + (for key in "${!REPORT_VARS[@]}"; do + _xunit_add_property "$key" "${REPORT_VARS["$key"]}" + done; for p in "${REPORT_ENV_LIST[@]}"; do _xunit_add_property "$p" "${!p}" - done | sort >> $REPORT_DIR/result.xml + done) | sort >> $REPORT_DIR/result.xml echo -e "\t" >> $REPORT_DIR/result.xml if [ -f $report ]; then cat $report >> $REPORT_DIR/result.xml From patchwork Wed Feb 15 01:46:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141196 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BFBDC05027 for ; Wed, 15 Feb 2023 01:46:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233245AbjBOBqv (ORCPT ); Tue, 14 Feb 2023 20:46:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233681AbjBOBqu (ORCPT ); Tue, 14 Feb 2023 20:46:50 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4958A34F58; Tue, 14 Feb 2023 17:46:48 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AE261619A0; Wed, 15 Feb 2023 01:46:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1283AC433EF; Wed, 15 Feb 2023 01:46:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425607; bh=RFr3g/4qCyyNGldPY3NR4ztey60BtZk5Sq9d54comoI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=QzTu75VvR6I0udTDvPb7c4GNMPv+WT45MQdrP4CX9T86eQB116l8loQRRhX6K5peK Cy7ZJrzMIiCM98dJugPBtg6nRvM1YjfhUllIA6x2AdYtRM2sGKK2UCvXroZLZgqfCG BQM7JD/VIDsuLKG4SGtO7+s7gpIErhAbq0lRLGNjPiismHAXkg2LvcbFCP51EE6mUK /pGteC5nfYldhI4ueMkxuB/19F3VtJHqOIbeUdpWpT8qvxvYfNxM3S16oN7RqhpX6V g11CIpvp3F95fWpdWimtq5YwKcbEZ+huqZrwz4BGkAHklsyEIjbRxtapgWFgdUhGhd x/2cvyryZ988g== Subject: [PATCH 12/14] report: record xfs-specific information about a test run From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:46:46 -0800 Message-ID: <167642560660.2118945.465092435286091827.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Report various XFS-specific information about a test run. Signed-off-by: Darrick J. Wong --- common/report | 2 ++ common/xfs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/common/report b/common/report index 90d4f980d1..d538fc38a9 100644 --- a/common/report +++ b/common/report @@ -58,6 +58,8 @@ __generate_report_vars() { __generate_blockdev_report_vars "TEST_DEV" __generate_blockdev_report_vars "SCRATCH_DEV" + + test "$FSTYP" = "xfs" && __generate_xfs_report_vars } # diff --git a/common/xfs b/common/xfs index 97c049e2ca..ea8f54e03b 100644 --- a/common/xfs +++ b/common/xfs @@ -2,6 +2,16 @@ # XFS specific common functions. # +__generate_xfs_report_vars() { + __generate_blockdev_report_vars TEST_RTDEV + __generate_blockdev_report_vars TEST_LOGDEV + __generate_blockdev_report_vars SCRATCH_RTDEV + __generate_blockdev_report_vars SCRATCH_LOGDEV + + REPORT_VARS["XFS_ALWAYS_COW"]="$(cat /sys/fs/xfs/debug/always_cow 2>/dev/null)" + REPORT_VARS["XFS_LARP"]="$(cat /sys/fs/xfs/debug/larp 2>/dev/null)" +} + _setup_large_xfs_fs() { fs_size=$1 From patchwork Wed Feb 15 01:46:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141197 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DC31C05027 for ; Wed, 15 Feb 2023 01:47:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232926AbjBOBrD (ORCPT ); Tue, 14 Feb 2023 20:47:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230212AbjBOBrB (ORCPT ); Tue, 14 Feb 2023 20:47:01 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72312360A9; Tue, 14 Feb 2023 17:46:55 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0A123B81F5F; Wed, 15 Feb 2023 01:46:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B32E8C433D2; Wed, 15 Feb 2023 01:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425612; bh=IjLD1uAs6SW+6/Dfvt99sAzccmGrcAGEKSAz3MpO6hE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=krKpngcNoytE6Eb5gOL6LhZu/WBJog+1DMwyOzro1ydbcIxKAnAhQBd54DgNIfpfM sLjEYOGEg/5yI1/7LxSz1xrTbvaCezi71f+Nt166A2ZSOwu0XovJ8V4y6YmBP2zTqo c//O5V2Ryp2jRRLHWAnZd/BeXu1JjDqhBY2xOL2tdRA5Lh96HtUFPEfEbak4NyzYJd ovgVw4X19V88L46PbBHCACLaOWt4ebbRjdcuEb+XVJuDtw3HmVr+kDrvaqCy20bLoc NTF/o0tSlE1VdPpLQcj7qp8zzfohVtDKUJvDUYCgLYeNNlCRvUy1HH2MUtfe2VN6OB oUiDpcg6ySC/w== Subject: [PATCH 13/14] report: record ext*-specific information about a test run From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:46:52 -0800 Message-ID: <167642561224.2118945.2761688312094018100.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Report various ext* specific information about a test run. Signed-off-by: Darrick J. Wong --- common/ext4 | 5 +++++ common/report | 1 + 2 files changed, 6 insertions(+) diff --git a/common/ext4 b/common/ext4 index 8fd6dbc682..3dcbfe17c9 100644 --- a/common/ext4 +++ b/common/ext4 @@ -2,6 +2,11 @@ # ext4 specific common functions # +__generate_ext4_report_vars() { + __generate_blockdev_report_vars TEST_LOGDEV + __generate_blockdev_report_vars SCRATCH_LOGDEV +} + _setup_large_ext4_fs() { local fs_size=$1 diff --git a/common/report b/common/report index d538fc38a9..e22e2f8558 100644 --- a/common/report +++ b/common/report @@ -60,6 +60,7 @@ __generate_report_vars() { __generate_blockdev_report_vars "SCRATCH_DEV" test "$FSTYP" = "xfs" && __generate_xfs_report_vars + [[ "$FSTYP" == ext[0-9]* ]] && __generate_ext4_report_vars } # From patchwork Wed Feb 15 01:46:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13141198 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4ADDFC61DA4 for ; Wed, 15 Feb 2023 01:47:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230212AbjBOBrK (ORCPT ); Tue, 14 Feb 2023 20:47:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232979AbjBOBrJ (ORCPT ); Tue, 14 Feb 2023 20:47:09 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79E673526F; Tue, 14 Feb 2023 17:46:59 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0798E6196F; Wed, 15 Feb 2023 01:46:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63FB0C433EF; Wed, 15 Feb 2023 01:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676425618; bh=B3ZvG4KdM4h96XRkeLA3WAYBfYJMmcm31BrKP84ZO78=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=MRqGGpgXOz+i0980wF+1Sm1kWqY7lTgj2r59/KBWG5bwYtYkiB3EuLotdAN87xYzw a7PIefW/qpuZr+vWZwxNHkg8wX0sL+KyShb5N5JcZ2GGq3WDQ1s9x8Z+AYpfM/Zovl MkCCldwYTeg4+flZ2Gu/DpcOuRFP7+nhg73r9lRisB85njt0WHVLDaEDfB8gB8WSJP V/ref2mNhmH5p/k3AasSA7uI5W1PoQNdi1cul5zxfNPN40SX3FBE6y9kTfuAhdN/cc gxkyqCKeHau+4o97mAISVkFpb3/hZoWmOW7KKBq9ZyCc/OWkk5XHFw6rA0QMTsSwJZ 9XH2ArrWPHQWA== Subject: [PATCH 14/14] report: allow test runners to inject arbitrary values From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, leah.rumancik@gmail.com, quwenruo.btrfs@gmx.com, tytso@mit.edu Date: Tue, 14 Feb 2023 17:46:57 -0800 Message-ID: <167642561790.2118945.13068111127264406746.stgit@magnolia> In-Reply-To: <167642553879.2118945.15448815976865210889.stgit@magnolia> References: <167642553879.2118945.15448815976865210889.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Per Ted's request, add to the test section reporting code the ability for test runners to point to a file containing colon-separated key value pairs. These key value pairs will be recorded in the report file as extra properties. Requested-by: Theodore Ts'o Signed-off-by: Darrick J. Wong --- README | 3 +++ common/report | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/README b/README index 4c4f22f853..a8c67cea4d 100644 --- a/README +++ b/README @@ -245,6 +245,9 @@ Misc: this option is supported for all filesystems currently only -overlay is expected to run without issues. For other filesystems additional patches and fixes to the test suite might be needed. + - Set REPORT_VARS_FILE to a file containing colon-separated name-value pairs + that will be recorded in the test section report. Names must be unique. + Whitespace surrounding the colon will be removed. ______________________ USING THE FSQA SUITE diff --git a/common/report b/common/report index e22e2f8558..4b45f7c803 100644 --- a/common/report +++ b/common/report @@ -44,9 +44,19 @@ __generate_blockdev_report_vars() { REPORT_VARS["${bdev_var}_ZONES"]="$(cat "$sysfs_bdev/queue/nr_zones" 2>/dev/null)" } +__import_report_vars() { + local fname="$1" + + while IFS=':' read key value; do + REPORT_VARS["${key%% }"]="${value## }" + done < "$1" +} + # Fill out REPORT_VARS with tidbits about our test runner configuration. # Caller is required to declare REPORT_VARS to be an associative array. __generate_report_vars() { + test "$REPORT_VARS_FILE" && __import_report_vars "$REPORT_VARS_FILE" + REPORT_VARS["ARCH"]="$(uname -m)" REPORT_VARS["KERNEL"]="$(uname -r)" REPORT_VARS["CPUS"]="$(getconf _NPROCESSORS_ONLN 2>/dev/null)"