diff mbox series

[12/15] report: record optional environment variables

Message ID 167884161838.2482843.6219764673500069919.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series fstests: improve junit xml reporting | expand

Commit Message

Darrick J. Wong March 15, 2023, 12:53 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

These environment variables are documented as being significant, but
optional.  If they're set to a non-empty string, record them in the
reports.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/report |   10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/common/report b/common/report
index 90d4f980d1..af3c04db56 100644
--- a/common/report
+++ b/common/report
@@ -9,6 +9,11 @@  REPORT_ENV_LIST=("SECTION" "FSTYP" "PLATFORM" "MKFS_OPTIONS" "MOUNT_OPTIONS" \
 		 "TIME_FACTOR" "LOAD_FACTOR" "TEST_DIR" "TEST_DEV" \
 		 "SCRATCH_DEV" "SCRATCH_MNT" "OVL_UPPER" "OVL_LOWER" "OVL_WORK")
 
+# Variables that are captured in the report /if/ they are set.
+REPORT_ENV_LIST_OPT=("TAPE_DEV" "RMT_TAPE_DEV" "FSSTRES_AVOID" "FSX_AVOID"
+		     "KCONFIG_PATH" "PERF_CONFIGNAME" "MIN_FSSIZE"
+		     "IDMAPPED_MOUNTS")
+
 encode_xml()
 {
 	cat -v | \
@@ -58,6 +63,11 @@  __generate_report_vars() {
 
 	__generate_blockdev_report_vars "TEST_DEV"
 	__generate_blockdev_report_vars "SCRATCH_DEV"
+
+	# Optional environmental variables
+	for varname in "${REPORT_ENV_LIST_OPT[@]}"; do
+		test -n "${!varname}" && REPORT_VARS["${varname}"]="${!varname}"
+	done
 }
 
 #