From: Martin Cermak Date: Wed, 17 Sep 2025 14:27:09 +0000 (+0200) Subject: Run the LTP tests with LTP_QUIET X-Git-Tag: VALGRIND_3_26_0~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccf065e7077459d902f6ad221c21b0771bedbb1a;p=thirdparty%2Fvalgrind.git Run the LTP tests with LTP_QUIET Introduce a new LTP_QUIET env var which suppresses certain types of LTP log messages, specifically TCONF, TWARN, TINFO, and TDEBUG. This helps us keep the test logs briefer, while still keeping the important information in the logs. This update avoids several false positives, specifically with the following testcases: eventfd2_03, shmctl05, mlock03, poll02, prctl09, setsockopt10, and select02. This update also adds a brief summary for the LTP testsuite, something like the following: > ... > [6/7] Testing select02 ... > [7/7] Testing setsockopt10 ... > > Brief LTP test results summary > ----------------------------------------- > PASS: 6 > FAIL: 1 > ----------------------------------------- > > TESTING FINISHED, logs in ... Also fix the way -j param spec in auxprogs/Makefile.am. https://bugs.kde.org/show_bug.cgi?id=509590 --- diff --git a/NEWS b/NEWS index 7940ab4a0..32d8acec9 100644 --- a/NEWS +++ b/NEWS @@ -137,6 +137,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 509139 Update BadSize error messages 509258 FreeBSD: add jail_attach_jd and jail_remove_jd syscall wrappers 509517 s390x: Even/odd lane confusion in various vector insns +509590 Run the LTP tests with LTP_QUIET To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am index 4f9f100c0..e7ff5a5da 100644 --- a/auxprogs/Makefile.am +++ b/auxprogs/Makefile.am @@ -21,7 +21,8 @@ LTP_FILTERS = \ filters/select03 LTP_PATCHES = \ - ltp-patches/0001-Make-sure-32-bit-powerpc-syscall-defs-don-t-leak-to-.patch + ltp-patches/0001-Make-sure-32-bit-powerpc-syscall-defs-don-t-leak-to-.patch \ + ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch EXTRA_DIST = \ docs/valgrind-listener-manpage.xml \ @@ -211,14 +212,15 @@ $(GSL_SRC_DIR)/gsl-patched: $(GSL_TAR) autoreconf -f -i -Wnone) touch $@ -$(LTP_SRC_DIR): $(LTP_TAR) +$(LTP_SRC_DIR): $(LTP_TAR) ltp-apply-patches.sh $(LTP_PATCHES) echo "$(LTP_SHA256_SUM) $(LTP_TAR)" | @SHA256SUM@ --check - (cd $(AUX_CHECK_DIR) && \ tar Jxf $(LTP_TAR_NAME) && \ $(abs_top_srcdir)/auxprogs/ltp-apply-patches.sh $(LTP_SRC_DIR) && \ cd $(LTP_SRC_DIR) && \ ./configure CC="${CC}" CXX="${CXX}" CFLAGS="$(LTP_CFLAGS)" && \ - ${MAKE} -j $(nproc) -C testcases/kernel/syscalls) + ${MAKE} clean && \ + ${MAKE} -C testcases/kernel/syscalls) touch $@ # We need make check -k because @@ -228,7 +230,7 @@ $(GSL_BUILD_DIR)/gsl-build: $(GSL_SRC_DIR)/gsl-patched mkdir -p $(GSL_BUILD_DIR) (cd $(GSL_BUILD_DIR) && \ $(GSL_SRC_DIR)/configure CC="${CC}" CXX="${CXX}" CFLAGS="$(GSL_CFLAGS)" && \ - ${MAKE} -j $(nproc) && \ + ${MAKE} && \ ${MAKE} check -k || true) touch $@ diff --git a/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch b/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch new file mode 100644 index 000000000..a77162bfc --- /dev/null +++ b/auxprogs/ltp-patches/0002-Introduce-LTP_QUIET-env-var.patch @@ -0,0 +1,73 @@ +From 183df3240f8e7ca38fbe2fd472c31c9417ae7eb2 Mon Sep 17 00:00:00 2001 +From: Martin Cermak +Date: Tue, 16 Sep 2025 15:46:40 +0200 +Subject: [PATCH] Introduce LTP_QUIET env var + +Introduce LTP_QUIET env variable. When set to 1 or y, it will +suppress printing TCONF, TWARN, TINFO, and TDEBUG messages. +--- + lib/tst_test.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/lib/tst_test.c b/lib/tst_test.c +index 92872cc89..609a7b075 100644 +--- a/lib/tst_test.c ++++ b/lib/tst_test.c +@@ -68,6 +68,7 @@ static int iterations = 1; + static float duration = -1; + static float timeout_mul = -1; + static int reproducible_output; ++static int quiet_output; + + struct context { + int32_t lib_pid; +@@ -307,15 +308,19 @@ static void print_result(const char *file, const int lineno, int ttype, + res = "TBROK"; + break; + case TCONF: ++ if (quiet_output) return; + res = "TCONF"; + break; + case TWARN: ++ if (quiet_output) return; + res = "TWARN"; + break; + case TINFO: ++ if (quiet_output) return; + res = "TINFO"; + break; + case TDEBUG: ++ if (quiet_output) return; + res = "TDEBUG"; + break; + default: +@@ -670,6 +675,7 @@ static void print_help(void) + fprintf(stderr, "LTP_DEV_FS_TYPE Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE); + fprintf(stderr, "LTP_ENABLE_DEBUG Print debug messages (set 1 or y)\n"); + fprintf(stderr, "LTP_REPRODUCIBLE_OUTPUT Values 1 or y discard the actual content of the messages printed by the test\n"); ++ fprintf(stderr, "LTP_QUIET Values 1 or y will suppress printing TCONF, TWARN, TINFO, and TDEBUG messages\n"); + fprintf(stderr, "LTP_SINGLE_FS_TYPE Specifies filesystem instead all supported (for .all_filesystems)\n"); + fprintf(stderr, "LTP_FORCE_SINGLE_FS_TYPE Testing only. The same as LTP_SINGLE_FS_TYPE but ignores test skiplist.\n"); + fprintf(stderr, "LTP_TIMEOUT_MUL Timeout multiplier (must be a number >=1)\n"); +@@ -1361,6 +1367,7 @@ static void do_setup(int argc, char *argv[]) + { + char *tdebug_env = getenv("LTP_ENABLE_DEBUG"); + char *reproducible_env = getenv("LTP_REPRODUCIBLE_OUTPUT"); ++ char *quiet_env = getenv("LTP_QUIET"); + + if (!tst_test) + tst_brk(TBROK, "No tests to run"); +@@ -1391,6 +1398,10 @@ static void do_setup(int argc, char *argv[]) + (!strcmp(reproducible_env, "1") || !strcmp(reproducible_env, "y"))) + reproducible_output = 1; + ++ if (quiet_env && ++ (!strcmp(quiet_env, "1") || !strcmp(quiet_env, "y"))) ++ quiet_output = 1; ++ + assert_test_fn(); + + TCID = tcid = get_tcid(argv); +-- +2.48.1 + diff --git a/auxprogs/ltp-tester.sh b/auxprogs/ltp-tester.sh index ba8fd8be4..a95c603c5 100755 --- a/auxprogs/ltp-tester.sh +++ b/auxprogs/ltp-tester.sh @@ -21,6 +21,7 @@ PARALLEL_JOBS=${PARALLEL_JOBS:-$(nproc)} # https://lore.kernel.org/ltp/20250505195003.GB137650@pevik/T/#t export LTP_COLORIZE_OUTPUT=0 export LTP_REPRODUCIBLE_OUTPUT=1 +export LTP_QUIET=1 # Initialize LOGDIR for bunsen upload (https://sourceware.org/bunsen/) mkdir -p $LOGDIR; rm -rf ${LOGDIR:?}/* @@ -110,4 +111,10 @@ done wait +echo -e "\nBrief LTP test results summary" +echo "-----------------------------------------" +find $LOGDIR -type f -name '*.trs' -exec grep -F ':test-result:' '{}' ';' |\ + sort -r | uniq -c | awk '{print $NF": "$1}' +echo -e "-----------------------------------------\n" + echo "TESTING FINISHED, logs in $LOGDIR"