From: Anders Roxell <anders.roxell@linaro.org>
To: ltp@lists.linux.it, pvorel@suse.cz
Subject: [LTP] [PATCH v3 4/4] openposix: Add runtest files for kirk
Date: Wed, 25 Nov 2026 22:09:33 +0100 [thread overview]
Message-ID: <20261125210933.2913177-5-anders.roxell@linaro.org> (raw)
In-Reply-To: <20261125210933.2913177-1-anders.roxell@linaro.org>
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
prev parent reply other threads:[~2026-11-25 21:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Anders Roxell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261125210933.2913177-5-anders.roxell@linaro.org \
--to=anders.roxell@linaro.org \
--cc=ltp@lists.linux.it \
--cc=pvorel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.