All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 0/4] openposix: Run the Open POSIX tests with kirk
@ 2026-11-25 21:09 Anders Roxell
  2026-11-25 21:09 ` [LTP] [PATCH v3 1/4] openposix: mqueues: Use one thread by default Anders Roxell
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Anders Roxell @ 2026-11-25 21:09 UTC (permalink / raw)
  To: ltp, pvorel

Hi,

There are no runtest files for the Open POSIX tests, so kirk can not
run them.

Patch 1 and 2 make the two mqueues_multi_send_rev tests use one thread
by default and remove the .args files. Patch 3 rebuilds run.sh when
the Makefile changes. Patch 4 generates runtest/openposix-* at install
time. Each line calls a small wrapper that maps the Open POSIX exit
codes to the LTP ones.

Changes in v3:
- Drop "openposix: Install the .args files". Instead use one thread by
  default in multi_send_rev_1 and multi_send_rev_2, and remove the
  .args files and the code in run-tests.sh that reads them. (Petr)
- The runtest files do not read .args files any more.
- New patch: rebuild run.sh when the Makefile changes.

Changes in v2:
- Take the list of tests from the installed run.sh files. v1 used all
  the files in DESTDIR, so it picked up old tests left from an earlier
  install, like pthread_detach_1-2. (LTP AI Reviewer)

This does not cover a removed test directory: its old run.sh stays in
DESTDIR, so its tests are still listed.

openposix_run.sh does not use t0 like run-tests.sh does. So a hung test
is stopped by the kirk timeout and not after 300 seconds. The kirk
default is 1h for one test and also 1h for the whole suite.

I ran all three runtest files with kirk on qemu-arm64, with a 6.18.54
kernel and a Debian forky rootfs. 1735 tests ran in about 17 minutes:
1694 pass, 40 TCONF and 1 fail (pthread_rwlock_unlock_3-1). The
mqueues_multi_send_rev tests pass with the default of one thread.

v2: https://lore.kernel.org/ltp/20261104225051.402911-1-anders.roxell@linaro.org/
v1: https://lore.kernel.org/ltp/20261023123436.1274448-1-anders.roxell@linaro.org/

Cheers,
Anders

Anders Roxell (4):
  openposix: mqueues: Use one thread by default
  openposix: Remove the .args files
  openposix: Rebuild run.sh when the Makefile changes
  openposix: Add runtest files for kirk

 testcases/open_posix_testsuite/Makefile       | 11 +++++-
 testcases/open_posix_testsuite/bin/Makefile   |  6 +++-
 .../open_posix_testsuite/bin/openposix_run.sh | 29 +++++++++++++++
 .../open_posix_testsuite/bin/run-tests.sh     |  2 +-
 .../include/mk/config.mk.in                   |  3 ++
 .../scripts/generate-makefiles.sh             |  2 +-
 .../scripts/generate-runtest.sh               | 35 +++++++++++++++++++
 .../mqueues/mqueues_multi_send_rev_1.args     |  1 -
 .../mqueues/mqueues_multi_send_rev_2.args     |  1 -
 .../stress/mqueues/multi_send_rev_1.c         |  8 +++--
 .../stress/mqueues/multi_send_rev_2.c         |  8 +++--
 11 files changed, 94 insertions(+), 12 deletions(-)
 create mode 100755 testcases/open_posix_testsuite/bin/openposix_run.sh
 create mode 100755 testcases/open_posix_testsuite/scripts/generate-runtest.sh
 delete mode 100644 testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_1.args
 delete mode 100644 testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_2.args

-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH v3 1/4] openposix: mqueues: Use one thread by default
  2026-11-25 21:09 [LTP] [PATCH v3 0/4] openposix: Run the Open POSIX tests with kirk Anders Roxell
@ 2026-11-25 21:09 ` Anders Roxell
  2026-11-26  3:11   ` [LTP] " linuxtestproject.agent
  2026-11-25 21:09 ` [LTP] [PATCH v3 2/4] openposix: Remove the .args files Anders Roxell
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Anders Roxell @ 2026-11-25 21:09 UTC (permalink / raw)
  To: ltp, pvorel

multi_send_rev_1 and multi_send_rev_2 fail without the number of
threads as an argument. Only run-tests.sh passes it, from a .args file
that make install does not install.

Default to one thread like the .args files, and remove the unused
getopt.h include.

Suggested-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 .../stress/mqueues/multi_send_rev_1.c                     | 8 +++++---
 .../stress/mqueues/multi_send_rev_2.c                     | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c
index 5003681f7bb4..fed92ae755e6 100644
--- a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c
+++ b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c
@@ -18,7 +18,6 @@
 #include <sys/wait.h>
 #include <sys/mman.h>
 #include <string.h>
-#include <getopt.h>
 #include <pthread.h>
 #include <limits.h>
 #include <mqueue.h>
@@ -28,6 +27,7 @@
 #define MSG_SIZE	128
 #define MAX_MSG		3
 #define Max_Threads	10
+#define DEFAULT_THREADS	1
 #define Name_Size	20
 
 typedef struct {
@@ -96,8 +96,10 @@ int test_main(int argc, char **argv)
 	printf("_POSIX_MESSAGE_PASSING is not defined \n");
 	return PTS_UNRESOLVED;
 #endif */
-	if ((2 != argc) || ((num = atoi(argv[1])) <= 0)) {
-		fprintf(stderr, "Usage: %s number_of_threads\n", argv[0]);
+	if (argc < 2) {
+		num = DEFAULT_THREADS;
+	} else if ((num = atoi(argv[1])) <= 0) {
+		fprintf(stderr, "Usage: %s [number_of_threads]\n", argv[0]);
 		return PTS_FAIL;
 	}
 	if (num > Max_Threads) {
diff --git a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c
index 9fe44113f704..989273b2da83 100644
--- a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c
+++ b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c
@@ -18,7 +18,6 @@
 #include <sys/wait.h>
 #include <sys/mman.h>
 #include <string.h>
-#include <getopt.h>
 #include <pthread.h>
 #include <limits.h>
 #include <mqueue.h>
@@ -29,6 +28,7 @@
 #define MSG_SIZE	128
 #define MAX_MSG		5
 #define Max_Threads	100
+#define DEFAULT_THREADS	1
 
 static const char *s_msg_ptr[] =
     { "send_1 1", "send_1 2", "send_1 3", "send_1 4", "send_1 5" };
@@ -85,8 +85,10 @@ int test_main(int argc, char **argv)
 	printf("_POSIX_MESSAGE_PASSING is not defined \n");
 	return PTS_UNRESOLVED;
 #endif */
-	if ((2 != argc) || ((num = atoi(argv[1])) <= 0)) {
-		fprintf(stderr, "Usage: %s number_of_threads\n", argv[0]);
+	if (argc < 2) {
+		num = DEFAULT_THREADS;
+	} else if ((num = atoi(argv[1])) <= 0) {
+		fprintf(stderr, "Usage: %s [number_of_threads]\n", argv[0]);
 		return PTS_FAIL;
 	}
 	if (num > Max_Threads) {
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH v3 2/4] openposix: Remove the .args files
  2026-11-25 21:09 [LTP] [PATCH v3 0/4] openposix: Run the Open POSIX tests with kirk Anders Roxell
  2026-11-25 21:09 ` [LTP] [PATCH v3 1/4] openposix: mqueues: Use one thread by default Anders Roxell
@ 2026-11-25 21:09 ` Anders Roxell
  2026-11-25 21:09 ` [LTP] [PATCH v3 3/4] openposix: Rebuild run.sh when the Makefile changes Anders Roxell
  2026-11-25 21:09 ` [LTP] [PATCH v3 4/4] openposix: Add runtest files for kirk Anders Roxell
  3 siblings, 0 replies; 6+ messages in thread
From: Anders Roxell @ 2026-11-25 21:09 UTC (permalink / raw)
  To: ltp, pvorel

Only the two mqueues_multi_send_rev tests used them, and they now use
one thread by default. Remove the files and the code in run-tests.sh
that reads them.

Suggested-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 testcases/open_posix_testsuite/bin/run-tests.sh                 | 2 +-
 .../stress/mqueues/mqueues_multi_send_rev_1.args                | 1 -
 .../stress/mqueues/mqueues_multi_send_rev_2.args                | 1 -
 3 files changed, 1 insertion(+), 3 deletions(-)
 delete mode 100644 testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_1.args
 delete mode 100644 testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_2.args

diff --git a/testcases/open_posix_testsuite/bin/run-tests.sh b/testcases/open_posix_testsuite/bin/run-tests.sh
index c2fddcf53733..a2b628273120 100755
--- a/testcases/open_posix_testsuite/bin/run-tests.sh
+++ b/testcases/open_posix_testsuite/bin/run-tests.sh
@@ -46,7 +46,7 @@ run_test() {
 
 	complog=$(basename $testname).log.$$
 
-	sh -c "$SCRIPT_DIR/t0 $TIMEOUT_VAL ./$1 $(cat ./$(echo "$1" | sed 's,\.[^\.]*,,').args 2>/dev/null)" > $complog 2>&1
+	sh -c "$SCRIPT_DIR/t0 $TIMEOUT_VAL ./$1" > $complog 2>&1
 
 	ret_code=$?
 
diff --git a/testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_1.args b/testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_1.args
deleted file mode 100644
index d00491fd7e5b..000000000000
--- a/testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_1.args
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_2.args b/testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_2.args
deleted file mode 100644
index d00491fd7e5b..000000000000
--- a/testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_2.args
+++ /dev/null
@@ -1 +0,0 @@
-1
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH v3 3/4] openposix: Rebuild run.sh when the Makefile changes
  2026-11-25 21:09 [LTP] [PATCH v3 0/4] openposix: Run the Open POSIX tests with kirk Anders Roxell
  2026-11-25 21:09 ` [LTP] [PATCH v3 1/4] openposix: mqueues: Use one thread by default Anders Roxell
  2026-11-25 21:09 ` [LTP] [PATCH v3 2/4] openposix: Remove the .args files Anders Roxell
@ 2026-11-25 21:09 ` Anders Roxell
  2026-11-25 21:09 ` [LTP] [PATCH v3 4/4] openposix: Add runtest files for kirk Anders Roxell
  3 siblings, 0 replies; 6+ messages in thread
From: Anders Roxell @ 2026-11-25 21:09 UTC (permalink / raw)
  To: ltp, pvorel

run.sh has no prerequisites, so it keeps an old list of tests after
tests are added or removed. Only make clean fixes it.

Make run.sh depend on the Makefile that lists the tests.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 testcases/open_posix_testsuite/scripts/generate-makefiles.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
index 1c12a456cc41..b9df91e14b62 100755
--- a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
+++ b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
@@ -200,7 +200,7 @@ EOF
 
 	if ! grep -q '^run.sh' "$makefile.3"; then
 		cat >> "$makefile.3" <<EOF
-run.sh:
+run.sh: Makefile
 	@echo '#!/bin/sh' > \$@
 	@echo "\$(top_srcdir)/bin/run-tests.sh \$(subdir) \$(INSTALL_TARGETS)" >> \$@
 	@chmod +x run.sh
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH v3 4/4] openposix: Add runtest files for kirk
  2026-11-25 21:09 [LTP] [PATCH v3 0/4] openposix: Run the Open POSIX tests with kirk Anders Roxell
                   ` (2 preceding siblings ...)
  2026-11-25 21:09 ` [LTP] [PATCH v3 3/4] openposix: Rebuild run.sh when the Makefile changes Anders Roxell
@ 2026-11-25 21:09 ` Anders Roxell
  3 siblings, 0 replies; 6+ messages in thread
From: Anders Roxell @ 2026-11-25 21:09 UTC (permalink / raw)
  To: ltp, pvorel

Kirk can not run the Open POSIX tests, because they have no runtest
files.

Generate one for each suite at install time. The list comes from the
installed run.sh files, so old test binaries left in DESTDIR are not
listed. The speculative tests are left out like in run.sh, and a run.sh
without a run-tests.sh line fails the install.

Each line calls openposix_run.sh. It runs the test from its own
directory and maps PTS_UNSUPPORTED and PTS_UNTESTED to TCONF, so kirk
does not report them as TWARN and TFAIL.

A removed test directory is still listed, because its old run.sh stays
in DESTDIR.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 testcases/open_posix_testsuite/Makefile       | 11 +++++-
 testcases/open_posix_testsuite/bin/Makefile   |  6 +++-
 .../open_posix_testsuite/bin/openposix_run.sh | 29 +++++++++++++++
 .../include/mk/config.mk.in                   |  3 ++
 .../scripts/generate-runtest.sh               | 35 +++++++++++++++++++
 5 files changed, 82 insertions(+), 2 deletions(-)
 create mode 100755 testcases/open_posix_testsuite/bin/openposix_run.sh
 create mode 100755 testcases/open_posix_testsuite/scripts/generate-runtest.sh

diff --git a/testcases/open_posix_testsuite/Makefile b/testcases/open_posix_testsuite/Makefile
index 4bead182170d..ce41643686d5 100644
--- a/testcases/open_posix_testsuite/Makefile
+++ b/testcases/open_posix_testsuite/Makefile
@@ -74,7 +74,7 @@ generate-makefiles: distclean-makefiles
 		$(top_srcdir)/scripts/generate-makefiles.sh
 
 .PHONY: install
-install: bin-install conformance-install functional-install stress-install
+install: bin-install conformance-install functional-install stress-install runtest-install
 
 .PHONY: test
 test: conformance-test functional-test stress-test
@@ -119,6 +119,15 @@ stress-test:
 	@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
 	@$(TEST_MAKE) -C stress test
 
+.PHONY: runtest-install
+runtest-install: $(addsuffix -install,$(SUBDIRS))
+	@mkdir -p $(DESTDIR)/$(runtestdir)
+	@set -e; for suite in $(SUBDIRS); do \
+		$(top_srcdir)/scripts/generate-runtest.sh \
+			$(DESTDIR)/$(testdir) "$(testdir_rel)" $$suite \
+			> $(DESTDIR)/$(runtestdir)/openposix-$$suite; \
+	done
+
 # Tools build and install targets.
 .PHONY: bin-install
 bin-install:
diff --git a/testcases/open_posix_testsuite/bin/Makefile b/testcases/open_posix_testsuite/bin/Makefile
index 262a6567c5b6..5dfff99effcb 100644
--- a/testcases/open_posix_testsuite/bin/Makefile
+++ b/testcases/open_posix_testsuite/bin/Makefile
@@ -16,7 +16,7 @@ clean:
 	@rm -f t0.val
 
 .PHONY: install
-install: clean $(DESTDIR)/$(bindir) $(DESTDIR)/$(testdir_bin)
+install: clean $(DESTDIR)/$(bindir) $(DESTDIR)/$(testdir_bin) $(DESTDIR)/$(ltp_bindir)
 	set -e; for file in $(INSTALL_BIN_TARGETS); do           \
 		install -m 00755 $$file $(DESTDIR)/$(bindir)/$$file; \
 	done
@@ -27,9 +27,13 @@ install: clean $(DESTDIR)/$(bindir) $(DESTDIR)/$(testdir_bin)
 		install -m 00755 $$file $(DESTDIR)/$(testdir_bin)/$$file; \
 	done
 
+	install -m 00755 openposix_run.sh $(DESTDIR)/$(ltp_bindir)/
 
 $(DESTDIR)/$(bindir):
 	mkdir -p $@
 
 $(DESTDIR)/$(testdir_bin):
 	mkdir -p $@
+
+$(DESTDIR)/$(ltp_bindir):
+	mkdir -p $@
diff --git a/testcases/open_posix_testsuite/bin/openposix_run.sh b/testcases/open_posix_testsuite/bin/openposix_run.sh
new file mode 100755
index 000000000000..43c52a38d956
--- /dev/null
+++ b/testcases/open_posix_testsuite/bin/openposix_run.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2026 Linaro Limited
+
+LTPROOT=${LTPROOT:-$(cd "$(dirname "$0")/../.." && pwd)}
+
+if [ $# -lt 1 ]; then
+	echo "Usage: $(basename "$0") <test path relative to LTPROOT> [args]" >&2
+	exit 2
+fi
+
+test_path=$LTPROOT/$1
+test_file=${test_path##*/}
+shift
+
+if [ ! -x "$test_path" ]; then
+	echo "$test_path is missing or not executable" >&2
+	exit 2
+fi
+
+cd "${test_path%/*}" || exit 2
+
+./"$test_file" "$@"
+ret=$?
+
+case $ret in
+4|5) exit 32 ;;
+*) exit $ret ;;
+esac
diff --git a/testcases/open_posix_testsuite/include/mk/config.mk.in b/testcases/open_posix_testsuite/include/mk/config.mk.in
index 20422e0f1047..fae80116bbf7 100644
--- a/testcases/open_posix_testsuite/include/mk/config.mk.in
+++ b/testcases/open_posix_testsuite/include/mk/config.mk.in
@@ -14,4 +14,7 @@ testdir_rel := @testdir@
 testdir     := ${prefix}/${testdir_rel}
 testdir_bin := ${testdir}/bin
 
+ltp_bindir  := ${prefix}/testcases/bin
+runtestdir  := ${prefix}/runtest
+
 CFLAGS  += -std=c99 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -Wall -Wextra
diff --git a/testcases/open_posix_testsuite/scripts/generate-runtest.sh b/testcases/open_posix_testsuite/scripts/generate-runtest.sh
new file mode 100755
index 000000000000..d523fa483bb6
--- /dev/null
+++ b/testcases/open_posix_testsuite/scripts/generate-runtest.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2026 Linaro Limited
+
+if [ $# -ne 3 ]; then
+	echo "Usage: $(basename "$0") <installed testdir> <testdir relative to LTPROOT> <suite>" >&2
+	exit 1
+fi
+
+installed_testdir=$1
+testdir_rel=$2
+suite=$3
+
+cd "$installed_testdir" || exit 1
+
+if [ ! -d "$suite" ]; then
+	echo "$installed_testdir/$suite does not exist" >&2
+	exit 1
+fi
+
+run_tests_line='^[^ ]*/run-tests\.sh [^ ]* '
+
+find "$suite" -name speculative -prune -o -name run.sh -print | sort | \
+while read -r run_sh; do
+	if ! grep -q "$run_tests_line" "$run_sh"; then
+		echo "$run_sh has no run-tests.sh line" >&2
+		exit 1
+	fi
+	dir=${run_sh%/run.sh}
+	tests=$(sed -n "s,$run_tests_line,,p" "$run_sh")
+	for test_name in $tests; do
+		[ -f "$dir/$test_name" ] || continue
+		echo "${test_name%.*} openposix_run.sh ${testdir_rel:+$testdir_rel/}$dir/$test_name"
+	done
+done
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [LTP] openposix: mqueues: Use one thread by default
  2026-11-25 21:09 ` [LTP] [PATCH v3 1/4] openposix: mqueues: Use one thread by default Anders Roxell
@ 2026-11-26  3:11   ` linuxtestproject.agent
  0 siblings, 0 replies; 6+ messages in thread
From: linuxtestproject.agent @ 2026-11-26  3:11 UTC (permalink / raw)
  To: Anders Roxell; +Cc: ltp

Hi Anders,

On Wed Nov 25 22:09:30 2026 +0100, Anders Roxell wrote:
> openposix: mqueues: Use one thread by default

Verdict - Reviewed

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-26  3:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 21:09 [LTP] [PATCH v3 0/4] openposix: Run the Open POSIX tests with kirk Anders Roxell
2026-11-25 21:09 ` [LTP] [PATCH v3 1/4] openposix: mqueues: Use one thread by default Anders Roxell
2026-11-26  3:11   ` [LTP] " linuxtestproject.agent
2026-11-25 21:09 ` [LTP] [PATCH v3 2/4] openposix: Remove the .args files Anders Roxell
2026-11-25 21:09 ` [LTP] [PATCH v3 3/4] openposix: Rebuild run.sh when the Makefile changes Anders Roxell
2026-11-25 21:09 ` [LTP] [PATCH v3 4/4] openposix: Add runtest files for kirk Anders Roxell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.