* [LTP] [PATCH v2 0/6] Remove runltp
@ 2026-02-05 12:15 Petr Vorel
2026-02-05 12:15 ` [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc Petr Vorel
` (7 more replies)
0 siblings, 8 replies; 29+ messages in thread
From: Petr Vorel @ 2026-02-05 12:15 UTC (permalink / raw)
To: ltp
Cc: Thomas Petazzoni, Vasileios Almpanis, Tim Bird, Julien Olivain,
automated-testing
Changes v1->v2:
* Remove ltp-pan (Cyril
* Remove all tools used by runltp (Cyril, more tools removed)
* Add runltp very simple script which just print info about kirk (Cyril)
Link to v1:
https://lore.kernel.org/ltp/20260204115339.224261-1-pvorel@suse.cz/
https://patchwork.ozlabs.org/project/ltp/list/?series=490958&state=*
Build tested:
https://github.com/pevik/ltp/actions/runs/21710205160
Petr Vorel (6):
doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
testscripts/lvmtest.sh: Replace runltp with kirk
runltp: Remove
pan: Remove
tools: Remove tools used by runltp
kirk: Remove runltp-ng symlink
INSTALL | 4 +-
Makefile | 2 +-
doc/developers/test_case_tutorial.rst | 6 +-
doc/developers/todo.rst | 10 -
metadata/README.md | 2 +-
pan/Makefile | 51 -
pan/cgi/README | 59 -
pan/cgi/browse.cgi | 225 ---
pan/cgi/reconsile.cgi | 250 ---
pan/cgi/results.cgi | 164 --
pan/ltp-bump.c | 115 --
pan/ltp-pan.c | 1485 -----------------
pan/splitstr.c | 192 ---
pan/splitstr.h | 36 -
pan/tag_report.h | 51 -
pan/zoolib.c | 447 -----
pan/zoolib.h | 83 -
runltp | 962 +----------
.../kernel/fs/fs_readonly/test_robind.sh | 2 +-
.../kernel/io/direct_io/dma_thread_diotest.c | 3 +-
testcases/kernel/security/smack/README | 2 +-
testcases/network/can/filter-tests/INSTALL | 2 +-
testcases/network/rpc/rpc-tirpc/README | 2 +-
testscripts/Readme_ROBind | 4 +-
testscripts/lvmtest.sh | 2 +-
tools/Makefile | 2 +-
tools/create_dmesg_entries_for_each_test.awk | 35 -
...kernel_faults_in_loops_and_probability.awk | 40 -
tools/create_valgrind_check.awk | 42 -
tools/genhtml.pl | 249 ---
tools/genload/.gitignore | 2 -
tools/genload/Makefile | 31 -
tools/genload/README | 72 -
tools/genload/genload.c | 898 ----------
tools/genload/stress.c | 898 ----------
tools/html_report_header.txt | 56 -
tools/insert_kernel_faults.sh | 53 -
tools/kirk/Makefile | 2 -
tools/restore_kernel_faults_default.sh | 86 -
39 files changed, 24 insertions(+), 6603 deletions(-)
delete mode 100644 pan/Makefile
delete mode 100644 pan/cgi/README
delete mode 100755 pan/cgi/browse.cgi
delete mode 100755 pan/cgi/reconsile.cgi
delete mode 100755 pan/cgi/results.cgi
delete mode 100644 pan/ltp-bump.c
delete mode 100644 pan/ltp-pan.c
delete mode 100644 pan/splitstr.c
delete mode 100644 pan/splitstr.h
delete mode 100644 pan/tag_report.h
delete mode 100644 pan/zoolib.c
delete mode 100644 pan/zoolib.h
delete mode 100644 tools/create_dmesg_entries_for_each_test.awk
delete mode 100644 tools/create_kernel_faults_in_loops_and_probability.awk
delete mode 100644 tools/create_valgrind_check.awk
delete mode 100644 tools/genhtml.pl
delete mode 100644 tools/genload/.gitignore
delete mode 100644 tools/genload/Makefile
delete mode 100644 tools/genload/README
delete mode 100644 tools/genload/genload.c
delete mode 100644 tools/genload/stress.c
delete mode 100644 tools/html_report_header.txt
delete mode 100755 tools/insert_kernel_faults.sh
delete mode 100755 tools/restore_kernel_faults_default.sh
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-05 12:15 [LTP] [PATCH v2 0/6] Remove runltp Petr Vorel
@ 2026-02-05 12:15 ` Petr Vorel
2026-02-17 9:19 ` Cyril Hrubis
2026-02-05 12:15 ` [LTP] [PATCH v2 2/6] testscripts/lvmtest.sh: Replace runltp with kirk Petr Vorel
` (6 subsequent siblings)
7 siblings, 1 reply; 29+ messages in thread
From: Petr Vorel @ 2026-02-05 12:15 UTC (permalink / raw)
To: ltp; +Cc: automated-testing
Remove runltp from all doc, replace it with kirk.
Also replace the old runltp-ng with kirk.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
INSTALL | 4 +++-
doc/developers/test_case_tutorial.rst | 6 +++---
doc/developers/todo.rst | 10 ----------
metadata/README.md | 2 +-
testcases/kernel/fs/fs_readonly/test_robind.sh | 2 +-
testcases/kernel/io/direct_io/dma_thread_diotest.c | 3 +--
testcases/kernel/security/smack/README | 2 +-
testcases/network/can/filter-tests/INSTALL | 2 +-
testcases/network/rpc/rpc-tirpc/README | 2 +-
testscripts/Readme_ROBind | 4 ++--
10 files changed, 14 insertions(+), 23 deletions(-)
diff --git a/INSTALL b/INSTALL
index c44bb4e660..9ef929a971 100644
--- a/INSTALL
+++ b/INSTALL
@@ -105,9 +105,9 @@ Quick Start
$ ./configure
$ make all
# make install
- $ /opt/ltp/runltp
*NOTE:
+- For running tests use kirk [1], individual test you can run directly.
- LTP assumes the existence of the nobody, bin, and daemon users and their
groups. If these IDs do not exist, certain tests will fail. The respective
user and group IDs should be the same, i.e. if `nobody's' user ID is 99, then
@@ -117,6 +117,8 @@ its group ID should also be 99. The names of the groups are irrelevant.
DESTDIR= is also honored for install and will install into $DESTDIR/$prefix,
if you want to install into a chroot or a rootfs for instance.
+[1] https://github.com/linux-test-project/kirk
+
Detailed Installation
---------------------
diff --git a/doc/developers/test_case_tutorial.rst b/doc/developers/test_case_tutorial.rst
index 08bd1b1519..240897e36b 100644
--- a/doc/developers/test_case_tutorial.rst
+++ b/doc/developers/test_case_tutorial.rst
@@ -205,9 +205,9 @@ please do:
This should build the test and then run it. However, even though the test is
in :master:`testcases/kernel/syscalls` directory it won't be automatically ran
-as part of the syscalls test group (e.g. not run via ``kirk -r math`` or
-``./runltp -f syscalls``). For this we need to add it to the runtest file. So
-open :master:`runtest/syscalls` and add the lines starting with a ``+``.
+as part of the syscalls test group (e.g. not run via ``kirk -r math``. For
+this we need to add it to the runtest file. So open :master:`runtest/syscalls`
+and add the lines starting with a ``+``.
.. code-block::
diff --git a/doc/developers/todo.rst b/doc/developers/todo.rst
index fe248c819b..4ca8612db7 100644
--- a/doc/developers/todo.rst
+++ b/doc/developers/todo.rst
@@ -7,16 +7,6 @@ This is a comprehensive list of tasks where LTP maintainers are currently
working on. Priorities might change over time, but these are the most important
points which are currently being achieved.
-Fade out old tests runner
--------------------------
-
-:master:`runltp` script is old and unmaintaned. We are slowly shifting to
-`kirk <https://github.com/linux-test-project/kirk>`_, that will be our official
-tests runner in the future.
-
-Kirk provides support for remote testing via Qemu, SSH, LTX, parallel
-execution and much more.
-
Test new syscalls
-----------------
diff --git a/metadata/README.md b/metadata/README.md
index c71062759d..2cf978d39e 100644
--- a/metadata/README.md
+++ b/metadata/README.md
@@ -245,4 +245,4 @@ things and how to format them.
So far this proof of concept generates a metadata file. I guess that we need
actual consumers which will help to settle things down, I will try to look into
-making use of this in the runltp-ng at least as a reference implementation.
+making use of this in the kirk at least as a reference implementation.
diff --git a/testcases/kernel/fs/fs_readonly/test_robind.sh b/testcases/kernel/fs/fs_readonly/test_robind.sh
index 2d9a87b7e0..0f5a67db2e 100755
--- a/testcases/kernel/fs/fs_readonly/test_robind.sh
+++ b/testcases/kernel/fs/fs_readonly/test_robind.sh
@@ -25,7 +25,7 @@
# DESCRIPTION: Performs filesystems tests for RO mount.
# For filesystem, like ext2, ext3, reiserfs, jfs & xfs,
# This test needs a big block device(>=500MB is ok), and you can specify
-# it by -z option when running runltp.
+# it by exporting LTP_BIG_DEV environment variable.
# a) mounts on dir1,
# b) mount --bind dir2
# c) mount -o remount,ro
diff --git a/testcases/kernel/io/direct_io/dma_thread_diotest.c b/testcases/kernel/io/direct_io/dma_thread_diotest.c
index b757ba0e2d..82fab12d98 100644
--- a/testcases/kernel/io/direct_io/dma_thread_diotest.c
+++ b/testcases/kernel/io/direct_io/dma_thread_diotest.c
@@ -389,8 +389,7 @@ static void setup(void)
/*
* verify whether the current directory has enough free space,
- * if it is not satisfied, we will use the LTP_BIG_DEV, which
- * will be exported by runltp with "-z" option.
+ * if it is not satisfied, we will use the LTP_BIG_DEV.
*/
if (!directflag || !tst_fs_has_free(NULL, ".", 1300, TST_MB)) {
device = getenv("LTP_BIG_DEV");
diff --git a/testcases/kernel/security/smack/README b/testcases/kernel/security/smack/README
index 1b56ac6335..375a8ff595 100644
--- a/testcases/kernel/security/smack/README
+++ b/testcases/kernel/security/smack/README
@@ -20,7 +20,7 @@ using the default make target.
(cd testcases/kernel/security/smack; make && make install)
5) Running the tests:
- ./runltp -f smack
+ kirk -f smack
Each test exits with 0 on success and an error code on failure.
diff --git a/testcases/network/can/filter-tests/INSTALL b/testcases/network/can/filter-tests/INSTALL
index 7d62d65fe7..f07a0976e8 100644
--- a/testcases/network/can/filter-tests/INSTALL
+++ b/testcases/network/can/filter-tests/INSTALL
@@ -16,7 +16,7 @@ $ ./can_filter
$ ./can_rcv_own_msgs
3) To let LTP run the tests from $LTPROOT, execute:
-$ ./runltp -f can
+$ kirk -f can
4) Clean up using:
$ make clean
diff --git a/testcases/network/rpc/rpc-tirpc/README b/testcases/network/rpc/rpc-tirpc/README
index 139162751c..51c48360c2 100644
--- a/testcases/network/rpc/rpc-tirpc/README
+++ b/testcases/network/rpc/rpc-tirpc/README
@@ -46,6 +46,6 @@ instead of a bunch of scripts from the above web page.
The basic group of test cases can be executed from
* runtest/net.rpc_tests - for TS-RPC testing
* runtest/net.tirpc_tests - for TI-RPC testing
-using the LTP framework (ltp-pan, runltp and etc).
+using kirk.
Additional test cases (like stress, complex and etc) are to be integrated.
diff --git a/testscripts/Readme_ROBind b/testscripts/Readme_ROBind
index 2f961d43f1..02efb0f172 100644
--- a/testscripts/Readme_ROBind
+++ b/testscripts/Readme_ROBind
@@ -3,9 +3,9 @@ the {LTPROOT}/testcases/kernel/fs .
EXECUTING TESTS
==================
-The tests can be executed through runltp like:
+The tests can be executed with kirk:
-./runltp -f fs_readonly
+kirk -f fs_readonly
Following tests are executed when the above is invoked:
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [LTP] [PATCH v2 2/6] testscripts/lvmtest.sh: Replace runltp with kirk
2026-02-05 12:15 [LTP] [PATCH v2 0/6] Remove runltp Petr Vorel
2026-02-05 12:15 ` [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc Petr Vorel
@ 2026-02-05 12:15 ` Petr Vorel
2026-02-17 9:22 ` Cyril Hrubis
2026-02-05 12:15 ` [LTP] [PATCH v2 3/6] runltp: Remove Petr Vorel
` (5 subsequent siblings)
7 siblings, 1 reply; 29+ messages in thread
From: Petr Vorel @ 2026-02-05 12:15 UTC (permalink / raw)
To: ltp; +Cc: automated-testing
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
testscripts/lvmtest.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testscripts/lvmtest.sh b/testscripts/lvmtest.sh
index 8407a22272..198495df2c 100755
--- a/testscripts/lvmtest.sh
+++ b/testscripts/lvmtest.sh
@@ -14,5 +14,5 @@ fi
export PATH="${PATH}:${LTPROOT}:${LTPROOT}/bin:${LTPROOT}/testcases/bin"
-generate_lvm_runfile.sh && prepare_lvm.sh && runltp -f lvm.local
+generate_lvm_runfile.sh && prepare_lvm.sh && kirk -f lvm.local
cleanup_lvm.sh
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [LTP] [PATCH v2 3/6] runltp: Remove
2026-02-05 12:15 [LTP] [PATCH v2 0/6] Remove runltp Petr Vorel
2026-02-05 12:15 ` [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc Petr Vorel
2026-02-05 12:15 ` [LTP] [PATCH v2 2/6] testscripts/lvmtest.sh: Replace runltp with kirk Petr Vorel
@ 2026-02-05 12:15 ` Petr Vorel
2026-02-17 9:29 ` Cyril Hrubis
2026-02-19 8:29 ` Jan Stancek via ltp
2026-02-05 12:15 ` [LTP] [PATCH v2 4/6] pan: Remove Petr Vorel
` (4 subsequent siblings)
7 siblings, 2 replies; 29+ messages in thread
From: Petr Vorel @ 2026-02-05 12:15 UTC (permalink / raw)
To: ltp
Cc: Thomas Petazzoni, Vasileios Almpanis, Tim Bird, Julien Olivain,
automated-testing
runltp was replaced with kirk.
https://github.com/linux-test-project/kirk
Replace it with simple script just posting info about kirk and exit 1
(fail).
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
runltp | 962 +--------------------------------------------------------
1 file changed, 7 insertions(+), 955 deletions(-)
diff --git a/runltp b/runltp
index 0d90625691..62b9367faa 100755
--- a/runltp
+++ b/runltp
@@ -1,959 +1,11 @@
#!/bin/sh
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2001 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-################################################################################
-# File: runltp
-#
-# Description: This script can be used to the tests in the LTP test suite
-#
-# Authors: Manoj Iyer - manjo@mail.utexas.edu
-# Robbe Williamson - robbiew@us.ibm.com
-#
-# History: Oct 07 2003 - Modified - Manoj Iyer
-# - use functions
-# - clean up on script exit
-# - error checking etc.
-#
-# Oct 08 2003 - Modified - Manoj Iyer
-# - fixed bug in creating results directory
-# - all checks should be enlclosed in " " to avoid bash error
-# - exit with error if ltp-pan is not found in pan directory
-#
-# Jul 22 2007 - Modified - Ricardo Salveti de Araujo
-# - added support to put more then one file at CMDLINE (-f)
-# - added a new option, that the user can pass the address of
-# the command file, and it'll use wget to get it (-w)
-# - now -s does the grep at the selected command files (default,
-# -f or -w)
-#
-# Jul 23 2007 - Modified - Ricardo Salveti de Araujo
-# - added flag to get the command file that has all failed tests
-#
-# Sep 11 2007 - Modified - Subrata Modak
-# - added option to create Failed File if it is not an absolute path
-# - added option to create Output File if it is not an absolute path
-# - added option to create Failed File compulsory, even if user has not mentioned it
-#
-# Sep 14 2007 - Modified - Ricardo Salveti de Araujo
-# - cleaning and removing duplicated code
-#
-# Oct 27 2007 - Modified - Ricardo Salveti de Araujo and Subrata Modak
-# - better ways to integrate "ltp/tools/genload/stress" with "ltp/runltp"
-# Nov 24 2007 - Modified - Subrata Modak
-# - Added a new option to generate output in HTML format also. Also retaining
-# the original test format
-# Nov 28 2007 - Modified - Subrata Modak
-# - Added a new option to mail back LTP reports
-# May 19 2008 - Modified - Subrata Modak
-# - Added capability for default Log file generation
-# Aug 17 2009 - Modified - Subrata Modak
-# - Added Fault Injection generation Capability through -F Option
-#
-#################################################################################
-
-
-deprecated()
-{
- echo "-------------------------------------------" >&2
- echo "INFO: runltp script is deprecated, try kirk" >&2
- echo "https://github.com/linux-test-project/kirk" >&2
- echo "-------------------------------------------" >&2
-}
-
-
-setup()
-{
- deprecated
-
- cd `dirname $0` || \
- {
- echo "FATAL: unable to change directory to $(dirname $0)"
- exit 1
- }
- export LTPROOT=${PWD}
- export TMPBASE="/tmp"
- export PATH="${PATH}:${LTPROOT}/testcases/bin:${LTPROOT}/bin"
-
- export LTP_DEV_FS_TYPE="ext2"
-
- [ -d "$LTPROOT/testcases/bin" ] ||
- {
- echo "FATAL: LTP not installed correctly"
- echo "INFO: Follow directions in INSTALL!"
- exit 1
- }
-
- [ -e "$LTPROOT/bin/ltp-pan" ] ||
- {
- echo "FATAL: Test suite driver 'ltp-pan' not found"
- echo "INFO: Follow directions in INSTALL!"
- exit 1
- }
-}
-
-version_of_ltp()
-{
- cat "$LTPROOT/Version"
- exit 0
-}
-
-usage()
-{
- cat <<-EOF >&2
-
- usage: ${0##*/} [ -a EMAIL_TO ] [ -c NUM_PROCS ] [ -C FAILCMDFILE ] [ -T TCONFCMDFILE ]
- [ -d TMPDIR ] [ -D NUM_PROCS,NUM_FILES,NUM_BYTES,CLEAN_FLAG ] -e [ -f CMDFILES(,...) ]
- [ -g HTMLFILE] [ -i NUM_PROCS ] [ -l LOGFILE ] [ -m NUM_PROCS,CHUNKS,BYTES,HANGUP_FLAG ]
- -N -n [ -o OUTPUTFILE ] -p -q -Q [ -r LTPROOT ] [ -s PATTERN ] [ -t DURATION ]
- -v [ -w CMDFILEADDR ] [ -x INSTANCES ] [ -b DEVICE ] [-B LTP_DEV_FS_TYPE]
- [ -F LOOPS,PERCENTAGE ] [ -z BIG_DEVICE ] [-Z LTP_BIG_DEV_FS_TYPE]
-
- -a EMAIL_TO EMAIL all your Reports to this E-mail Address
- -c NUM_PROCS Run LTP under additional background CPU load
- [NUM_PROCS = no. of processes creating the CPU Load by spinning over sqrt()
- (Defaults to 1 when value)]
- -C FAILCMDFILE Command file with all failed test cases.
- -T TCONFCMDFILE Command file with all test cases that are not fully tested.
- -d TMPDIR Directory where temporary files will be created.
- -D NUM_PROCS,NUM_FILES,NUM_BYTES,CLEAN_FLAG
- Run LTP under additional background Load on Secondary Storage (separated by comma)
- [NUM_PROCS = no. of processes creating Storage Load by spinning over write()]
- [NUM_FILES = Write() to these many files (Defaults to 1 when value 0 or undefined)]
- [NUM_BYTES = write these many bytes (defaults to 1GB, when value 0 or undefined)]
- [CLEAN_FLAG = unlink file to which random data written, when value 1]
- -e Prints the date of the current LTP release
- -f CMDFILES Execute user defined list of testcases (separate with ',')
- -F LOOPS,PERCENTAGE Induce PERCENTAGE Fault in the Kernel Subsystems, and, run each test for LOOPS loop
- -g HTMLFILE Create an additional HTML output format
- -h Help. Prints all available options.
- -i NUM_PROCS Run LTP under additional background Load on IO Bus
- [NUM_PROCS = no. of processes creating IO Bus Load by spinning over sync()]
- -K DMESG_LOG_DIR
- Log Kernel messages generated for each test cases inside this directory
- -l LOGFILE Log results of test in a logfile.
- -m NUM_PROCS,CHUNKS,BYTES,HANGUP_FLAG
- Run LTP under additional background Load on Main memory (separated by comma)
- [NUM_PROCS = no. of processes creating main Memory Load by spinning over malloc()]
- [CHUNKS = malloc these many chunks (default is 1 when value 0 or undefined)]
- [BYTES = malloc CHUNKS of BYTES bytes (default is 256MB when value 0 or undefined) ]
- [HANGUP_FLAG = hang in a sleep loop after memory allocated, when value 1]
- -M CHECK_TYPE
- [CHECK_TYPE=1 => Full Memory Leak Check tracing children as well]
- [CHECK_TYPE=2 => Thread Concurrency Check tracing children as well]
- [CHECK_TYPE=3 => Full Memory Leak & Thread Concurrency Check tracing children as well]
- -N Run all the networking tests.
- -o OUTPUTFILE Redirect test output to a file.
- -p Human readable format logfiles.
- -q Print less verbose output to screen. This implies
- not logging start of the test in kernel log.
- -Q Don't log start of test in kernel log.
- -r LTPROOT Fully qualified path where testsuite is installed.
- -R Randomize test order.
- -s PATTERN Only run test cases which match PATTERN.
- -S SKIPFILE Skip tests specified in SKIPFILE
- -t DURATION Execute the testsuite for given duration. Examples:
- -t 60s = 60 seconds
- -t 45m = 45 minutes
- -t 24h = 24 hours
- -t 2d = 2 days
- -I ITERATIONS Execute the testsuite ITERATIONS times.
- -w CMDFILEADDR Uses wget to get the user's list of testcases.
- -x INSTANCES Run multiple instances of this testsuite.
- -b DEVICE Some tests require an unmounted block device
- to run correctly.
- -B LTP_DEV_FS_TYPE The file system of test block devices.
- -z BIG_DEVICE Some tests require a big unmounted block device
- to run correctly.
- -Z LTP_BIG_DEV_FS_TYPE The file system of the big device
- -W ZOOFILE Specify the zoo file used to record current test tags (default PID of this script)
-
-
-
- example: ${0##*/} -c 2 -i 2 -m 2,4,10240,1 -D 2,10,10240,1 -p -q -l /tmp/result-log.$$ -o /tmp/result-output.$$ -C /tmp/result-failed.$$ -d ${PWD}
-
-
- EOF
-exit 0
-}
-
-main()
-{
- local CMDFILES=
- local PRETTY_PRT=
- local ALT_DIR_OUT=0
- local ALT_DIR_RES=0
- local ALT_HTML_OUT=0
- local ALT_EMAIL_OUT=0
- local ALT_DMESG_OUT=0
- local RUN_NETEST=0
- local RUN_REPEATED=0
- local QUIET_MODE=
- local NO_KMSG=
- local NETPIPE=0
- local GENLOAD=0
- local MEMSIZE=0
- local DURATION=
- local CMDFILEADDR=
- local FAILCMDFILE=
- local TCONFCMDFILE=
- local INJECT_KERNEL_FAULT=
- local INJECT_KERNEL_FAULT_PERCENTAGE=
- local INJECT_FAULT_LOOPS_PER_TEST=
- local VALGRIND_CHECK=
- local VALGRIND_CHECK_TYPE=
- local LOGFILE_NAME=
- local LOGFILE=
- local OUTPUTFILE_NAME=
- local OUTPUTFILE=
- local HTMLFILE_NAME=
- local HTMLFILE=
- local DMESG_DIR=
- local EMAIL_TO=
- local TAG_RESTRICT_STRING=
- local PAN_COMMAND=
- local RANDOMRUN=0
- local DEFAULT_FILE_NAME_GENERATION_TIME=`date +"%Y_%m_%d-%Hh_%Mm_%Ss"`
- local scenfile=
- local ZOOFILE=$$
-
- version_date=$(cat "$LTPROOT/Version")
-
- while getopts a:b:B:c:C:T:d:D:ef:F:g:hi:I:K:l:m:M:No:pqQr:Rs:S:t:T:w:x:z:Z:W: arg
- do case $arg in
- a) EMAIL_TO=$OPTARG
- ALT_EMAIL_OUT=1;;
- c)
- NUM_PROCS=$(($OPTARG))
- if [ "$NUM_PROCS" -eq 0 ]; then
- # User Did not Define the Value ,or, User Defined Zero,
- # hence, prevent from creating infinite processes
- NUM_PROCS=1
- fi
- $LTPROOT/testcases/bin/genload --cpu $NUM_PROCS >/dev/null 2>&1 &
- GENLOAD=1 ;;
-
- C)
- case $OPTARG in
- /*)
- FAILCMDFILE="-C $OPTARG" ;;
- *)
- FAILCMDFILE="-C $LTPROOT/output/$OPTARG"
- ALT_DIR_OUT=1 ;;
- esac ;;
-
- T)
- case $OPTARG in
- /*)
- TCONFCMDFILE="-T $OPTARG" ;;
- *)
- TCONFCMDFILE="-T $LTPROOT/output/$OPTARG"
- ALT_DIR_OUT=1 ;;
- esac ;;
-
- d) # convert the user path to absolute path.
- export TMPBASE=$(readlink -f ${OPTARG}) ;;
-
- D) NUM_PROCS=1; NUM_FILES=1; NUM_BYTES=$((1024 * 1024 * 1024)); CLEAN_FLAG=0
- ARGUMENT_LIST=$OPTARG
- TOTAL_ARGUMENTS=1
- for ARGUMENT in `echo "$ARGUMENT_LIST" | tr ',' ' '`
- do
- case $TOTAL_ARGUMENTS in
- 1) NUM_PROCS="$ARGUMENT" ;;
- 2) NUM_FILES="$ARGUMENT" ;;
- 3) NUM_BYTES="$ARGUMENT" ;;
- 4) CLEAN_FLAG="$ARGUMENT" ;;
- esac
- TOTAL_ARGUMENTS=`expr $TOTAL_ARGUMENTS + 1`
- done
- # just to get the default values if the user passed 0
- if [ "$NUM_PROCS" -eq 0 ]; then
- NUM_PROCS=1
- fi
- if [ "$NUM_FILES" -eq 0 ]; then
- NUM_FILES=1
- fi
- if [ "$NUM_BYTES" -eq 0 ]; then
- NUM_BYTES=$((1024 * 1024 * 1024))
- fi
- if [ "$CLEAN_FLAG" -ne 1 ]; then
- CLEAN_FLAG=0
- fi
- if [ "$CLEAN_FLAG" -eq 1 ]; then
- # Do not unlink file in this case
- $LTPROOT/testcases/bin/genload --hdd $NUM_PROCS --hdd-files \
- $NUM_FILES --hdd-bytes $NUM_BYTES >/dev/null 2>&1 &
- else
- # Cleanup otherwise
- $LTPROOT/testcases/bin/genload --hdd $NUM_PROCS --hdd-files \
- $NUM_FILES --hdd-bytes $NUM_BYTES --hdd-noclean >/dev/null 2>&1 &
- fi
- GENLOAD=1;;
-
- e) # Print out the version of LTP
- version_of_ltp
- ;;
- f) # Execute user defined set of testcases.
- # Can be more than one file, just separate it with ',', like:
- # -f nfs,commands,/tmp/testfile
- CMDFILES=$OPTARG;;
- F) INJECT_KERNEL_FAULT=1
- # Separate out the NO_OF_LOOPS & FAULT_PERCENTAGE
- INJECT_FAULT_LOOPS_PER_TEST=`echo $OPTARG |cut -d',' -f1 | tr -d '\n' | tr -d ' '`
- INJECT_KERNEL_FAULT_PERCENTAGE=`echo $OPTARG |cut -d',' -f2 | tr -d '\n' | tr -d ' '`
- if [ ! $INJECT_FAULT_LOOPS_PER_TEST ]; then
- echo "Loops not properly defined. Resorting to default 5..."
- export INJECT_FAULT_LOOPS_PER_TEST=5
- fi
- if [ ! $INJECT_KERNEL_FAULT_PERCENTAGE ]; then
- echo "Fault Persentage not properly defined. Resorting to default 10..."
- export INJECT_KERNEL_FAULT_PERCENTAGE=10
- fi;;
- g) HTMLFILE_NAME="$OPTARG"
- case $OPTARG in
- /*)
- HTMLFILE="$OPTARG";;
- *)
- HTMLFILE="$LTPROOT/output/$OPTARG"
- ALT_DIR_OUT=1;;
- esac
- ALT_HTML_OUT=1;;
- h) usage;;
-
- i)
- NUM_PROCS=$(($OPTARG))
- if [ "$NUM_PROCS" -eq 0 ]; then
- # User Did not Define the Value ,or, User Defined Zero,
- # hence, prevent from creating infinite processes
- NUM_PROCS=1
- fi
- $LTPROOT/testcases/bin/genload --io $NUM_PROCS >/dev/null 2>&1 &
- GENLOAD=1 ;;
-
- K)
- case $OPTARG in
- /*)
- DMESG_DIR="$OPTARG-dmesg-output-`echo $$-``date +%X | tr -d ' '`";;
- *)
- DMESG_DIR="$LTPROOT/output/$OPTARG-dmesg-output-`echo $$-``date +%X | tr -d ' '`";;
- esac
- mkdir -p $DMESG_DIR
- ALT_DMESG_OUT=1;;
- l)
- LOGFILE_NAME="$OPTARG"
- case $OPTARG in
- /*)
- LOGFILE="-l $OPTARG" ;;
- *)
- LOGFILE="-l $LTPROOT/results/$OPTARG"
- ALT_DIR_RES=1 ;;
- esac ;;
-
- m) NUM_PROCS=1; CHUNKS=1; BYTES=$((256 * 1024 * 1024)); HANGUP_FLAG=0
- ARGUMENT_LIST=$OPTARG
- TOTAL_ARGUMENTS=1
- for ARGUMENT in `echo "$ARGUMENT_LIST" | tr ',' ' '`
- do
- case $TOTAL_ARGUMENTS in
- 1) NUM_PROCS="$ARGUMENT" ;;
- 2) CHUNKS="$ARGUMENT" ;;
- 3) BYTES="$ARGUMENT" ;;
- 4) HANGUP_FLAG="$ARGUMENT" ;;
- esac
- TOTAL_ARGUMENTS=`expr $TOTAL_ARGUMENTS + 1`
- done
- # just to get the default values if the user passed 0
- if [ "$NUM_PROCS" -eq 0 ]; then
- NUM_PROCS=1
- fi
- if [ "$CHUNKS" -eq 0 ]; then
- CHUNKS=1
- fi
- if [ "$BYTES" -eq 0 ]; then
- BYTES=$((256 * 1024 * 1024))
- fi
- if [ "$HANGUP_FLAG" -ne 1 ]; then
- HANGUP_FLAG=0
- fi
- if [ "$HANGUP_FLAG" -eq 1 ]; then
- # Hang in a Sleep loop after memory allocated
- $LTPROOT/testcases/bin/genload --vm $NUM_PROCS --vm-chunks \
- $CHUNKS --vm-bytes $BYTES --vm-hang >/dev/null 2>&1 &
- else
- # Otherwise Do not Hangup
- $LTPROOT/testcases/bin/genload --vm $NUM_PROCS --vm-chunks \
- $CHUNKS --vm-bytes $BYTES >/dev/null 2>&1 &
- fi
- GENLOAD=1;;
- M)
- VALGRIND_CHECK=1
- VALGRIND_CHECK_TYPE="$OPTARG";;
-
- N) RUN_NETEST=1;;
-
- o) OUTPUTFILE_NAME="$OPTARG"
- case $OPTARG in
- /*)
- OUTPUTFILE="-o $OPTARG";;
- *)
- OUTPUTFILE="-o $LTPROOT/output/$OPTARG"
- ALT_DIR_OUT=1 ;;
- esac ;;
-
- p) PRETTY_PRT="-p";;
-
- q) QUIET_MODE="-q";;
-
- Q) NO_KMSG="-Q";;
-
- r) LTPROOT=$OPTARG;;
-
- R) RANDOMRUN=1;;
-
- s) TAG_RESTRICT_STRING=$OPTARG;;
-
- S) case $OPTARG in
- /*)
- SKIPFILE=$OPTARG;;
- *)
- SKIPFILE="$LTPROOT/$OPTARG";;
- esac ;;
-
- t) # In case you want to specify the time
- # to run from the command line
- # (2m = two minutes, 2h = two hours, etc)
- DURATION="-t $OPTARG" ;;
-
- I) # In case you want the testcases to runsequentially RUN_REPEATED times
- RUN_REPEATED=$OPTARG;;
-
- w) CMDFILEADDR=$OPTARG;;
-
- x) # number of ltp's to run
- cat <<-EOF >&1
- WARNING: The use of -x can cause unpredictable failures, as a
- result of concurrently running multiple tests designed
- to be ran exclusively.
- Pausing for 10 seconds..."
- EOF
- sleep 10
- INSTANCES="-x $OPTARG";;
- b) DEVICE=$OPTARG;;
- B) LTP_DEV_FS_TYPE=$OPTARG;;
- z) BIG_DEVICE=$OPTARG;;
- Z) BIG_DEVICE_FS_TYPE=$OPTARG;;
- W) ZOOFILE=$OPTARG;;
- \?) usage;;
- esac
- done
-
- ## It would be nice to create a default log file even if the user has not mentioned
- if [ ! "$LOGFILE" ]; then ## User has not mentioned about Log File name
- LOGFILE_NAME="$DEFAULT_FILE_NAME_GENERATION_TIME"
- LOGFILE="-l $LTPROOT/results/LTP_RUN_ON-$LOGFILE_NAME.log"
- ALT_DIR_RES=1
- PRETTY_PRT="-p"
- fi
-
- ## It would be nice if a Failed File is compulsorily created (gives User better Idea of Tests that failed)
-
- if [ ! "$FAILCMDFILE" ]; then ## User has not mentioned about Failed File name
- ALT_DIR_OUT=1
- if [ ! "$OUTPUTFILE" ]; then ## User has not mentioned about Output File name either
- if [ ! "$LOGFILE" ]; then ## User has not mentioned about Log File name either
- FAILED_FILE_NAME="$DEFAULT_FILE_NAME_GENERATION_TIME"
- FAILCMDFILE="-C $LTPROOT/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed"
- else ## User Fortunately wanted a log file,
- FAILED_FILE_NAME=`basename $LOGFILE_NAME` ## Extract log file name and use it to construct Failed file name
- FAILCMDFILE="-C $LTPROOT/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed"
- fi
- else ## User Fortunately wanted a Output file
- FAILED_FILE_NAME=`basename $OUTPUTFILE_NAME` ## Extract output file name and use it to construct Failed file name
- FAILCMDFILE="-C $LTPROOT/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed"
- fi
- fi
-
- if [ ! "$TCONFCMDFILE" ]; then
- ALT_DIR_OUT=1
- if [ ! "$OUTPUTFILE" ]; then
- if [ ! "$LOGFILE" ]; then
- TCONF_FILE_NAME="$DEFAULT_FILE_NAME_GENERATION_TIME"
- TCONFCMDFILE="-T $LTPROOT/output/LTP_RUN_ON-${TCONF_FILE_NAME}.tconf"
- else
- TCONF_FILE_NAME=`basename $LOGFILE_NAME`
- TCONFCMDFILE="-T $LTPROOT/output/LTP_RUN_ON-${TCONF_FILE_NAME}.tconf"
- fi
- else
- TCONF_FILE_NAME=`basename $OUTPUTFILE_NAME`
- TCONFCMDFILE="-T $LTPROOT/output/LTP_RUN_ON-${TCONF_FILE_NAME}.tconf"
- fi
- fi
-
- if [ "$ALT_HTML_OUT" -eq 1 ] ; then ## User wants the HTML version of the output
- QUIET_MODE="" ## Suppressing this guy as it will prevent generation of proper output
- ## which the HTML parser will require
- if [ ! "$OUTPUTFILE" ]; then ## User has not mentioned about the Outputfile name, then we need to definitely generate one
- OUTPUTFILE_NAME="$DEFAULT_FILE_NAME_GENERATION_TIME"
- OUTPUTFILE="-o $LTPROOT/output/LTP_RUN_ON-$OUTPUTFILE_NAME.output"
- ALT_DIR_OUT=1
- fi
- fi
-
- # If we need, create the output directory
- [ "$ALT_DIR_OUT" -eq 1 ] && \
- {
- [ ! -d $LTPROOT/output ] && \
- {
- echo "INFO: creating $LTPROOT/output directory"
- mkdir -p $LTPROOT/output || \
- {
- echo "ERROR: failed to create $LTPROOT/output"
- exit 1
- }
- }
- }
-
- # If we need, create the results directory
- [ "$ALT_DIR_RES" -eq 1 ] && \
- {
- [ ! -d $LTPROOT/results ] && \
- {
- echo "INFO: creating $LTPROOT/results directory"
- mkdir -p $LTPROOT/results || \
- {
- echo "ERROR: failed to create $LTPROOT/results"
- exit 1
- }
- }
- }
-
- # Added -m 777 for tests that call tst_tmpdir() and try to
- # write to it as user nobody
- mkdir -m 777 -p $TMPBASE || \
- {
- echo "FATAL: Unable to make temporary directory $TMPBASE"
- exit 1
- }
- # use mktemp to create "safe" temporary directories
- export TMPTEMPLATE="${TMPBASE}/ltp-XXXXXXXXXX"
- TMP=`mktemp -d $TMPTEMPLATE` || \
- {
- echo "FATAL: Unable to make temporary directory: $TMP"
- exit 1
- }
- export TMP
- # To be invoked by tst_tmpdir()
- # write to it as user nobody
- export TMPDIR=$TMP
-
- trap "cleanup" 0
-
- chmod 777 $TMP || \
- {
- echo "unable to chmod 777 $TMP ... aborting"
- exit 1
- }
-
- cd $TMP || \
- {
- echo "could not cd ${TMP} ... exiting"
- exit 1
- }
-
- [ -n "$INSTANCES" ] && \
- {
- INSTANCES="$INSTANCES -O ${TMP}"
- }
-
- # If user does not provide a command file select a default set of testcases
- # to execute.
- if [ -z "$CMDFILES" ] && [ -z "$CMDFILEADDR" ]; then
-
- SCENARIO_LISTS="$LTPROOT/scenario_groups/default"
- if [ "$RUN_NETEST" -eq 1 ]; then
- SCENARIO_LISTS="$LTPROOT/scenario_groups/network"
- fi
-
- cat <<-EOF >&1
-INFO: no command files were provided. Executing following runtest scenario files:
-`cat $SCENARIO_LISTS | tr '\012' ' '`
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) Linux Test Project, 2026
+cat >&2 << EOF
+runltp was removed from LTP use kirk instead
+https://github.com/linux-test-project/kirk
+https://kirk.readthedocs.io/
EOF
- cat_ok_sentinel=$TMP/cat_ok.$$
- touch "$cat_ok_sentinel"
- cat $SCENARIO_LISTS | while read scenfile; do
- scenfile=${LTPROOT}/runtest/$scenfile
- [ -f "$scenfile" ] || continue
-
- cat $scenfile >> "$TMP/alltests" || {
- echo "FATAL: unable to append to command file"
- rm -Rf "$TMP"
- rm -f "$cat_ok_sentinel"
- exit 1
- }
- done
- rm -f "$cat_ok_sentinel"
- fi
-
- [ -n "$CMDFILES" ] && \
- {
- for scenfile in `echo "$CMDFILES" | tr ',' ' '`
- do
- [ -f "$scenfile" ] || scenfile="$LTPROOT/runtest/$scenfile"
- cat "$scenfile" >> ${TMP}/alltests || \
- {
- echo "FATAL: unable to create command file"
- rm -Rf "$TMP"
- exit 1
- }
- done
- }
-
- [ -n "$CMDFILEADDR" ] && \
- {
- wget -q "${CMDFILEADDR}" -O ${TMP}/wgetcmdfile
- if [ $? -ne 0 ]; then
- echo "FATAL: error while getting the command file with wget (address $CMDFILEADDR)"
- exit 1
- fi
- cat "${TMP}/wgetcmdfile" >> ${TMP}/alltests || \
- {
- echo "FATAL: unable to create command file"
- exit 1
- }
- }
-
- # If enabled, execute only test cases that match the PATTERN
- if [ -n "$TAG_RESTRICT_STRING" ]
- then
- mv -f ${TMP}/alltests ${TMP}/alltests.orig
- grep $TAG_RESTRICT_STRING ${TMP}/alltests.orig > ${TMP}/alltests #Not worth checking return codes for this case
- fi
-
- # Blacklist or skip tests if a SKIPFILE was specified with -S
- if [ -n "${SKIPFILE}" ]; then
- for test_name in $(awk '{print $1}' "${SKIPFILE}"); do
- case "${test_name}" in \#*) continue;; esac
- sed -i "/\<${test_name}\>/c\\${test_name} exit 32;" alltests
- done
- fi
-
- # check for required users and groups
- ${LTPROOT}/IDcheck.sh || \
- {
- echo "WARNING: required users and groups not present"
- echo "WARNING: some test cases may fail"
- }
-
- # display versions of installed software
- [ -z "$QUIET_MODE" ] && \
- {
- ${LTPROOT}/ver_linux || \
- {
- echo "WARNING: unable to display versions of software installed"
- exit 1
- }
- }
-
- set_block_device
-
- # here even if the user don't specify a big block device, we
- # also don't create the big block device.
- if [ -z "$BIG_DEVICE" ]; then
- echo "no big block device was specified on commandline."
- echo "Tests which require a big block device are disabled."
- echo "You can specify it with option -z"
- else
- export LTP_BIG_DEV=$BIG_DEVICE
- if [ -z "$BIG_DEVICE_FS_TYPE" ]; then
- export LTP_BIG_DEV_FS_TYPE="ext2"
- else
- export LTP_BIG_DEV_FS_TYPE=$BIG_DEVICE_FS_TYPE
- fi
- fi
-
- if [ $RUN_REPEATED -gt 1 ]; then # You need to specify at least more than 1 sequential run, else it runs default
- echo "PAN will run these test cases $RUN_REPEATED times....."
- echo "Test Tags will be Prepended with ITERATION NO.s....."
- inc=1
- sed -e '/^$/ d' -e 's/^[ ,\t]*//' -e '/^#/ d' < ${TMP}/alltests > ${TMP}/alltests.temp ##This removes all newlines, leading spaces, tabs, #
- sed 's/^[0-9,a-z,A-Z]*/'"$inc"'_ITERATION_&/' < ${TMP}/alltests.temp > ${TMP}/alltests ## .temp is kept as Base file
- while [ $inc -lt $RUN_REPEATED ] ; do
- inc=`expr $inc + 1`
- sed 's/^[0-9,a-z,A-Z]*/'"$inc"'_ITERATION_&/' < ${TMP}/alltests.temp >> ${TMP}/alltests #Keep appending with Iteration No.s
- done
- fi
-
- if [ "$RANDOMRUN" != "0" ]; then
- sort -R ${TMP}/alltests -o ${TMP}/alltests
- fi
-
- [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test start time: $(date)" ; }
- PAN_COMMAND="${LTPROOT}/bin/ltp-pan $QUIET_MODE $NO_KMSG -e -S $INSTANCES $DURATION -a ${ZOOFILE} \
- -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE $TCONFCMDFILE"
- echo "COMMAND: $PAN_COMMAND"
- if [ ! -z "$TAG_RESTRICT_STRING" ] ; then
- echo "INFO: Restricted to $TAG_RESTRICT_STRING"
- fi
- #$PAN_COMMAND #Duplicated code here, because otherwise if we fail, only "PAN_COMMAND" gets output
-
- ## Display the Output/Log/Failed/HTML file names here
- printf "LOG File: "
- echo $LOGFILE | cut -b4-
-
- if [ "$OUTPUTFILE" ]; then
- printf "OUTPUT File: "
- echo $OUTPUTFILE | cut -b4-
- fi
-
- printf "FAILED COMMAND File: "
- echo $FAILCMDFILE | cut -b4-
-
- printf "TCONF COMMAND File: "
- echo $TCONFCMDFILE | cut -b4-
-
- if [ "$HTMLFILE" ]; then
- echo "HTML File: $HTMLFILE"
- fi
-
- echo "Running tests......."
- test_start_time=$(date)
-
- # User wants testing with Kernel Fault Injection
- if [ $INJECT_KERNEL_FAULT ] ; then
- #See if Debugfs is mounted, and
- #Fault Injection Framework available through Debugfs
- use_faultinjection=true
- for debug_subdir in \
- fail_io_timeout \
- fail_make_request \
- fail_page_alloc \
- failslab \
- ; do
- if [ -d "/sys/kernel/debug/$debug_subdir" ]
- then
- use_faultinjection=true
- break
- fi
- done
- if $use_faultinjection; then
- #If at least one of the Framework is available
- #Go ahead to Inject Fault & Create required
- #Command Files for LTP run
- echo Running tests with Fault Injection Enabled in the Kernel...
- awk -v LOOPS=$INJECT_FAULT_LOOPS_PER_TEST \
- -v PERCENTAGE=$INJECT_KERNEL_FAULT_PERCENTAGE \
- -f ${LTPROOT}/bin/create_kernel_faults_in_loops_and_probability.awk \
- ${TMP}/alltests > ${TMP}/alltests.tmp
- cp ${TMP}/alltests.tmp ${TMP}/alltests
- rm -rf ${TMP}/alltests.tmp
- else
- echo Fault Injection not enabled in the Kernel..
- echo Running tests normally...
- fi
- fi
-
- ## Valgrind Check will work only when Kernel Fault Injection is not expected,
- ## We do not want to test Faults when valgrind is running
- if [ $VALGRIND_CHECK ]; then
- if [ ! $INJECT_KERNEL_FAULT ]; then
- which valgrind || VALGRIND_CHECK_TYPE=XYZ
- case $VALGRIND_CHECK_TYPE in
- [1-3])
- awk -v CHECK_LEVEL=$VALGRIND_CHECK_TYPE \
- -f ${LTPROOT}/bin/create_valgrind_check.awk \
- ${TMP}/alltests $VALGRIND_CHECK_TYPE > \
- ${TMP}/alltests.tmp
- cp ${TMP}/alltests.tmp ${TMP}/alltests
- rm -rf ${TMP}/alltests.tmp
- ;;
- *)
- echo "Invalid Memory Check Type, or, Valgrind is not available"
- ;;
- esac
- fi
- fi
-
- if [ $ALT_DMESG_OUT -eq 1 ] ; then
- #We want to print dmesg output for each test,lets do the trick inside the script
- echo Enabling dmesg output logging for each test...
- awk -v DMESG_DIR=$DMESG_DIR \
- -f ${LTPROOT}/bin/create_dmesg_entries_for_each_test.awk \
- ${TMP}/alltests > ${TMP}/alltests.tmp
- cp ${TMP}/alltests.tmp ${TMP}/alltests
- rm -rf ${TMP}/alltests.tmp
- fi
- # Some tests need to run inside the "bin" directory.
- cd "${LTPROOT}/testcases/bin"
- "${LTPROOT}/bin/ltp-pan" $QUIET_MODE $NO_KMSG -e -S $INSTANCES $DURATION -a ${ZOOFILE} -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE $TCONFCMDFILE
-
- if [ $? -eq 0 ]; then
- echo "INFO: ltp-pan reported all tests PASS"
- VALUE=0
- export LTP_EXIT_VALUE=0;
- else
- echo "INFO: ltp-pan reported some tests FAIL"
- VALUE=1
- export LTP_EXIT_VALUE=1;
- fi
- cd ..
- echo "LTP Version: $version_date"
-
- # $DMESG_DIR is used to cache messages obtained from dmesg after a test run.
- # Proactively reap all of the 0-byte files in $DMESG_DIR as they have zero value
- # and only clutter up the filesystem.
-
- if [ $ALT_DMESG_OUT -eq 1 ] ; then
- if ! find "$DMESG_DIR" -size 0 -exec rm {} + ; then
- echo "cd to $DMESG_DIR failed: $?"
- fi
- if [ -n "$(ls "$DMESG_DIR")" ] ; then
- echo "Kernel messages were generated for LTP tests $version_date"
- else
- echo "No Kernel messages were generated for LTP tests $version_date"
- fi
- fi
-
- if [ "$ALT_HTML_OUT" -eq 1 ] ; then #User wants the HTML output to be created, it then needs to be generated
- export LTP_VERSION=$version_date
- export TEST_START_TIME="$test_start_time"
- export TEST_END_TIME="$(date)"
- OUTPUT_FILE=`echo $OUTPUTFILE | cut -c4-`
- LOGS_DIRECTORY="$LTPROOT/results"
- export TEST_OUTPUT_DIRECTORY="$LTPROOT/output"
- export TEST_LOGS_DIRECTORY=$LOGS_DIRECTORY
- echo "Generating HTML Output.....!!"
- ( perl $LTPROOT/bin/genhtml.pl $LTPROOT/bin/html_report_header.txt test_start test_end test_output execution_status $OUTPUT_FILE > $HTMLFILE; )
- echo "Generated HTML Output.....!!"
- echo "Location: $HTMLFILE";
-
- fi
-
- if [ "$ALT_EMAIL_OUT" -eq 1 ] ; then ## User wants reports to be e-mailed
- TAR_FILE_NAME=LTP_RUN_$version_date$DEFAULT_FILE_NAME_GENERATION_TIME.tar
- if [ "$HTMLFILE_NAME" ] ; then ## HTML file Exists
- if [ "$ALT_HTML_OUT" -ne 1 ] ; then ## The HTML file path is absolute and not $LTPROOT/output
- mkdir -p $LTPROOT/output ## We need to create this Directory
- cp $HTMLFILE_NAME $LTPROOT/output/
- fi
- fi
- if [ "$OUTPUTFILE_NAME" ] ; then ## Output file exists
- if [ "$ALT_DIR_OUT" -ne 1 ] ; then ## The Output file path is absolute and not $LTPROOT/output
- mkdir -p $LTPROOT/output ## We need to create this Directory
- cp $OUTPUTFILE_NAME $LTPROOT/output/
- fi
- fi
- if [ "$LOGFILE_NAME" ] ; then ## Log file exists
- if [ "$ALT_DIR_RES" -ne 1 ] ; then ## The Log file path is absolute and not $LTPROOT/results
- mkdir -p $LTPROOT/results ## We need to create this Directory
- cp $LOGFILE_NAME $LTPROOT/results/
- fi
- fi
- if [ -d $LTPROOT/output ] ; then
- tar -cf ./$TAR_FILE_NAME $LTPROOT/output
- if [ $? -eq 0 ]; then
- echo "Created TAR File: ./$TAR_FILE_NAME successfully, added $LTPROOT/output"
- else
- echo "Cannot Create TAR File: ./$TAR_FILE_NAME for adding $LTPROOT/output"
- fi
- fi
- if [ -d $LTPROOT/results ] ; then
- tar -uf ./$TAR_FILE_NAME $LTPROOT/results
- if [ $? -eq 0 ]; then
- echo "Updated TAR File: ./$TAR_FILE_NAME successfully, added $LTPROOT/results"
- else
- echo "Cannot Update TAR File: ./$TAR_FILE_NAME for adding $LTPROOT/results"
- fi
- fi
- if [ -e $LTPROOT/nohup.out ] ; then ## If User would have Chosen nohup to do ltprun
- tar -uf ./$TAR_FILE_NAME $LTPROOT/nohup.out
- if [ $? -eq 0 ]; then
- echo "Updated TAR File: ./$TAR_FILE_NAME successfully, added $LTPROOT/nohup.out"
- else
- echo "Cannot Update TAR File: ./$TAR_FILE_NAME for adding $LTPROOT/nohup.out"
- fi
- fi
- gzip ./$TAR_FILE_NAME ## gzip this guy
- if [ $? -eq 0 ]; then
- echo "Gunzipped TAR File: ./$TAR_FILE_NAME"
- else
- echo "Cannot Gunzip TAR File: ./$TAR_FILE_NAME"
- fi
- if which mutt >/dev/null 2>&1; then
- echo "Starting mailing reports to: $EMAIL_TO, file: ./$TAR_FILE_NAME.gz"
- mutt -a ./$TAR_FILE_NAME.gz -s "LTP Reports on $test_start_time" -- $EMAIL_TO < /dev/null
- if [ $? -eq 0 ]; then
- echo "Reports Successfully mailed to: $EMAIL_TO"
- else
- echo "Reports cannot be mailed to: $EMAIL_TO"
- fi
- else ## Use our Ageold mail program
- echo "Starting mailing reports to: $EMAIL_TO, file: ./$TAR_FILE_NAME.gz"
- uuencode ./$TAR_FILE_NAME.gz $TAR_FILE_NAME.gz | mail $EMAIL_TO -s "LTP Reports on $test_start_time"
- if [ $? -eq 0 ]; then
- echo "Reports Successfully mailed to: $EMAIL_TO"
- else
- echo "Reports cannot be mailed to: $EMAIL_TO"
- fi
- fi
- fi
-
- [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test end time: $(date)" ; }
-
- [ "$GENLOAD" -eq 1 ] && { killall -9 genload >/dev/null 2>&1; }
- [ "$NETPIPE" -eq 1 ] && { killall -9 NPtcp >/dev/null 2>&1; }
-
- [ "$ALT_DIR_OUT" -eq 1 ] || [ "$ALT_DIR_RES" -eq 1 ] && \
- {
- cat <<-EOF >&1
-
- ###############################################################
-
- Done executing testcases.
- LTP Version: $version_date
- ###############################################################
-
- EOF
- }
-
- deprecated
-
- exit $VALUE
-}
-
-set_block_device()
-{
- if [ -n "$DEVICE" ]; then
- export LTP_DEV=$DEVICE
- fi
-}
-
-cleanup()
-{
- [ "$LOOP_DEV" ] && losetup -d $LOOP_DEV
- rm -rf ${TMP}
-}
-
-
-LTP_SCRIPT="$(basename $0)"
-if [ "$LTP_SCRIPT" = "runltp" ]; then
- setup
- main "$@"
-fi
+exit 1
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [LTP] [PATCH v2 4/6] pan: Remove
2026-02-05 12:15 [LTP] [PATCH v2 0/6] Remove runltp Petr Vorel
` (2 preceding siblings ...)
2026-02-05 12:15 ` [LTP] [PATCH v2 3/6] runltp: Remove Petr Vorel
@ 2026-02-05 12:15 ` Petr Vorel
2026-02-17 9:34 ` Cyril Hrubis
2026-02-05 12:15 ` [LTP] [PATCH v2 5/6] tools: Remove tools used by runltp Petr Vorel
` (3 subsequent siblings)
7 siblings, 1 reply; 29+ messages in thread
From: Petr Vorel @ 2026-02-05 12:15 UTC (permalink / raw)
To: ltp; +Cc: automated-testing
ltp-pan was required for runltp, not needed for anything else.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Makefile | 2 +-
pan/Makefile | 51 --
pan/cgi/README | 59 --
pan/cgi/browse.cgi | 225 -------
pan/cgi/reconsile.cgi | 250 -------
pan/cgi/results.cgi | 164 -----
pan/ltp-bump.c | 115 ----
pan/ltp-pan.c | 1485 -----------------------------------------
pan/splitstr.c | 192 ------
pan/splitstr.h | 36 -
pan/tag_report.h | 51 --
pan/zoolib.c | 447 -------------
pan/zoolib.h | 83 ---
13 files changed, 1 insertion(+), 3159 deletions(-)
delete mode 100644 pan/Makefile
delete mode 100644 pan/cgi/README
delete mode 100755 pan/cgi/browse.cgi
delete mode 100755 pan/cgi/reconsile.cgi
delete mode 100755 pan/cgi/results.cgi
delete mode 100644 pan/ltp-bump.c
delete mode 100644 pan/ltp-pan.c
delete mode 100644 pan/splitstr.c
delete mode 100644 pan/splitstr.h
delete mode 100644 pan/tag_report.h
delete mode 100644 pan/zoolib.c
delete mode 100644 pan/zoolib.h
diff --git a/Makefile b/Makefile
index d47b2528e9..d82366489c 100644
--- a/Makefile
+++ b/Makefile
@@ -31,7 +31,7 @@ vpath %.mk $(top_srcdir)/mk:$(top_srcdir)/mk/include
# BOOTSTRAP_TARGETS: Directories required to bootstrap out-of-build-tree
# support.
-COMMON_TARGETS := pan utils
+COMMON_TARGETS := utils
define target_to_dir_dep_mapping
ifeq ($$(filter %-clean,$(1)),) # not *-clean
diff --git a/pan/Makefile b/pan/Makefile
deleted file mode 100644
index e8596ec26b..0000000000
--- a/pan/Makefile
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# pan Makefile.
-#
-# Copyright (C) 2009, Cisco Systems Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir ?= ..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-include $(top_srcdir)/include/mk/functions.mk
-
-# XXX (garrcoop): some versions of flex/bison generate crap code that doesn't
-# check the return code from fwrite(3).
-CPPFLAGS += -Wno-error
-
-CPPFLAGS += -I$(abs_srcdir)
-
-LDLIBS += -lm
-
-LFLAGS += -l
-
-INSTALL_DIR := bin
-
-MAKE_TARGETS := ltp-bump ltp-pan
-
-ltp-bump: ltp-bump.o zoolib.o
-
-ltp-pan: ltp-pan.o zoolib.o splitstr.o
-
-# flex does some whacky junk when it generates files on the fly, so let's make
-# sure gcc doesn't get lost...
-vpath %.c $(abs_srcdir):$(abs_builddir)))
-vpath %.l $(abs_srcdir)
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/pan/cgi/README b/pan/cgi/README
deleted file mode 100644
index 544c5466b5..0000000000
--- a/pan/cgi/README
+++ /dev/null
@@ -1,59 +0,0 @@
-Here are some CGI scripts I was using to view and compare RTS style output.
-It will probably need a little more tweaking to be useful to LTP.
-
-Expectations:
-
- A directory that contains all output. It expects file names in the format
-
- <host>.<ISO Date>.<suite>.<type>
-
- <host> The hostname the tests were run on
- <ISO Date> ISO standard format date. i.e. YYYYmmDDHHMM
- <suite> The name of the pan file that was used
- <type> One of driver, scanner, or summary
-
- driver - the raw output from pan with <<<test_end>>>
- scanner - the output from scanner
- summary - a very brief table listing how many tests passed,
- failed, didn't run, etc. This wasn't released.
-
-Scripts:
-
- results.cgi
-
- This lists out all of the results that are the results directory. It
- provides links to the driver output, scanned results, and summary for
- each suite. The sort order is host, date, suite. On the results
- page, which looks at the .scanner files, there are links that extract
- the test tag output from the .driver file.
-
- browse.cgi
-
- This is a more complex form that I started working on. It allows you
- to compare as many results as you want, side by side. Also, I started
- working on sorting the results different ways, but didn't get too far.
- The side by side comparison is done with in reconsile.cgi
-
- reconsile.cgi
-
- This script compares multiple scanner files and shows the differences
- side by side in a table. It expects to find .scanner files for the
- results it is comparing.
-
-Notes:
-
- The driver I was using with these scripts collects some system information
- before running the tests. I use this information to display the `uname
- -a` output in browse.cgi and reconsile.cgi. You will be missing this
- information, but the scripts should still run.
-
- I apologize in advance for the use of Perl. I've managed to steer clear
- of Perl for five years until I started writing these scripts. IMHO, the
- people who learn programming with Perl write the ugliest code. Luckily, I
- learned programming mostly with Pascal. Hopefully the code makes sense.
-
-
---
-Nate Straz nstraz@sgi.com
-sgi, inc http://www.sgi.com/
-Linux Test Project http://ltp.sf.net/
diff --git a/pan/cgi/browse.cgi b/pan/cgi/browse.cgi
deleted file mode 100755
index 49fda6fbd2..0000000000
--- a/pan/cgi/browse.cgi
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/usr/bin/perl
-
-use CGI qw(:standard);
-
-# keep a copy of each 'uname -a' string so we don't have to search for it every time.
-%uname_cache = {};
-
-# When something goes wrong before we start output, use this
-# function so there is still output
-sub failure {
- print header("text/html"),start_html;
- print "$_[0]\n";
- print end_html;
- exit;
-}
-# get the UNAME line for a host, date, suite
-sub get_result_uname {
- my($inhost, $indate, $insuite, $filename);
- my(@possible_files, $pf, $line);
- my($host, $datestr, $suite, $type, $gz);
- # build a filename
- $inhost = $_[0];
- $indate = $_[1];
- if ($#_ >= 2) {
- $insuite = $_[2];
- } else {
- $insuite = "*";
- }
- # check to see if we've done this already
- if (exists($uname_cache{"$inhost.$indate"})) {
- return $uname_cache{"$inhost.$indate"};
- }
- $filename = "$inhost.$indate.$insuite.*";
- @possible_files = <${filename}>;
- if ($#possible_files < 1) {
- return "";
- }
- foreach $pf (@possible_files) {
- ($host, $datestr, $suite, $type, $gz) = split(/\./, $pf);
- if ($type eq "summary") {
- next;
- } elsif ($type eq "scanner") {
- open (UF, $pf) || next;
- while ($line = <UF>) {
- if ($line =~ /^UNAME/) {
- close(UF);
- $line =~ s/UNAME *//;
- $line =~ s/$inhost//;
- $uname_cache{"$inhost.$indate"} = $line;
- return $line;
- }
- }
- } elsif ($type eq "driver") {
- if ($gz) {
- open (UF, "gunzip -c $pf|") || next;
- } else {
- open (UF, "$pf") || next;
- }
- while ($line = <UF>) {
- if ($line =~ /^UNAME/) {
- close(UF);
- $line =~ s/UNAME="(.*)"/\1/;
- $line =~ s/$inhost//;
- $uname_cache{"$inhost.$indate"} = $line;
- return $line;
- }
- }
- } else {
- next;
- }
- }
- return "";
-}
-
-# Create the headers row, adding links for sorting options
-sub print_headers {
-
- print "\n<tr>";
-
- for($i = 0; $i <= $#rso; $i++) {
- print "<th><a href=\"browse.cgi?sort=";
- for ($j = 0; $j <= $#rso; $j++) {
- if ($j == $i) { $rsd[$j] = $rsd[$j] * -1; }
- if ($rsd[$j] == -1) { print "-"; }
- if ($j == $i) { $rsd[$j] = $rsd[$j] * -1; }
- print $rso[$j];
- if ($j < $#rso) { print ","; }
- }
- print "\">$rso[$i]</a>\n";
- }
-
- print "</tr>\n";
-}
-
-############
-# main() #
-############
-
-# Most of the work is done in this directory
-unless (chdir("/usr/tests/ltp/results")) {
- failure("Could not get to the results directory\n");
-}
-
-@extra_path = split(/\//, $ENV{PATH_INFO});
-
-# rso = Result Sort Order
-# rsd = Result Sort Direction
-#@rso = (HOST,SUITE, DATE, UNAME);
-@rso = (SUITE, HOST, DATE, UNAME);
-@rsd = (1, 1, -1, 1);
-
-# allow the user to specify the sort order
-if ($sort_order = param("sort")) {
- @so = split(/,/, $sort_order);
- print $so;
- @rso = ();
- for($i = 0; $i <= $#so; $i++) {
- # parse the field
- if ($so[$i] =~ /host/i) { push(@rso, HOST); }
- elsif ($so[$i] =~ /date/i) { push(@rso, DATE); }
- elsif ($so[$i] =~ /suite/i) { push(@rso, SUITE); }
- elsif ($so[$i] =~ /uname/i) { push(@rso, UNAME); }
- # parse the direction
- if ($so[$i] =~ /-/) { $rsd[$i] = -1; }
- else { $rsd[$i] = 1; }
- }
-}
-
-if ($#extra_path > 0) {
-
-} else {
-
- %results = ();
-
- # run through the files in the results directory
- @driver_files = <*driver*>;
- foreach $df (@driver_files) {
-
- ($host, $datestr, $suite, $type, $gz) = split(/\./, $df);
-
- $a_rec = ();
- $a_rec->{HOST} = $host;
- $a_rec->{DATE} = $datestr;
- $a_rec->{SUITE} = $suite;
- $a_rec->{DRIVER_FILE} = $df;
- $a_rec->{UNAME} = get_result_uname($host, $datestr);
-
- $results{ $a_rec->{DRIVER_FILE} } = $a_rec;
- }
-
- # write the HTML file
- print header("text/html"),start_html;
- print "This is a demo page for browsing the Linux LTP results. Select the results you want to compare and click the \"Compare\" button.", p, h2("Warning"), "The results are placed in a large table which may take a long time to render on some browsers", p;
- @ri = values %results;
- @ri = sort { ($a->{$rso[0]} cmp $b->{$rso[0]})*$rsd[0]
- || ($a->{$rso[1]} cmp $b->{$rso[1]})*$rsd[1]
- || ($a->{$rso[2]} cmp $b->{$rso[2]})*$rsd[2]
- || ($a->{$rso[3]} cmp $b->{$rso[3]})*$rsd[3] } @ri;
-
- $last = ();
- $last->{$rso[0]} = "";
- $last->{$rso[1]} = "";
- $last->{$rso[2]} = "";
- $lasthost = "";
- $lastdate = "";
- $lastsuite = "";
- #$lastindent = 0;
- $thisindent = 0;
- print "<form method=get action=\"reconsile.cgi\">";
- print "<table border=1>\n";
- #print "<tr><th>Hostname<th>Date<th>Suite</tr>\n";
- print_headers();
- foreach $rp ( @ri ) {
-
- $this = ();
- $this->{$rso[0]} = $rp->{$rso[0]};
- $this->{$rso[1]} = $rp->{$rso[1]};
- $this->{$rso[2]} = $rp->{$rso[2]};
- $this->{$rso[3]} = $rp->{$rso[3]};
-
- # figure out the first column that is different
- for ($i = 0; $i <= $#rso; $i++) {
- if ($last->{$rso[$i]} ne $this->{$rso[$i]}) {
- $thisindent = $i;
- last;
- }
- }
-
- print "<tr>\n";
- for ($i = 0; $i < $thisindent; $i++) {
- print "<td>";
-
- }
- for ($i = $thisindent; $i <= $#rso; $i++) {
- print "<td>";
- if ($i == $#rso) {
- print "<a href=\"results.cgi?get_df=$this->{HOST}.$this->{DATE}.$this->{SUITE}.scanner\">";
- }
- print "$this->{$rso[$i]}";
- if ($i == $#rso) {
- print "</a>";
- }
- if ($i == $#rso) {
- # last column
- print " <input type=checkbox name=results value=\"$this->{HOST}.$this->{DATE}.$this->{SUITE}\">";
-
- }
-
-
- }
- print "</tr>\n";
-
- # make sure we update the $last... variables
- $last->{$rso[0]} = $this->{$rso[0]};
- $last->{$rso[1]} = $this->{$rso[1]};
- $last->{$rso[2]} = $this->{$rso[2]};
- }
- print "</table>\n";
- print "<input type=submit name=compare value=\"Compare\">\n";
- print "<input type=reset>\n";
- print "</form>";
- print end_html;
-
-}
-
diff --git a/pan/cgi/reconsile.cgi b/pan/cgi/reconsile.cgi
deleted file mode 100755
index da131f4716..0000000000
--- a/pan/cgi/reconsile.cgi
+++ /dev/null
@@ -1,250 +0,0 @@
-#!/usr/bin/perl
-
-#
-# reconsile.cgi - reconsile two or more scanner files
-#
-
-use CGI qw(:standard);
-
-chdir("/usr/tests/ltp/results/");
-
-# Get the list of results to compare.
-@results = param("results");
-
-print header("text/html");
-print start_html, "<pre>\n";
-
-# Give a warning if the suites do not match
-($a, $b, $lastsuite) = split(/\./, $results[0]);
-for ($i = 1; $i <= $#results; $i++) {
- ($a, $b, $thissuite) = split(/\./, $results[$i]);
- if ($lastsuite ne $thissuite) {
- print "Warning: Suites do not match!\n";
- last;
- }
-}
-
-# check that each requested result exists. If one does not exist,
-# print a warning and continue. If the number of available results
-# is less than two, halt with an error
-@result_filenames = ();
-foreach $a_result (@results) {
- if (-f "$a_result.scanner") {
- push(@result_filenames, "$a_result.scanner");
- } else {
- print "Could not find a scanner file for $a_result\n";
- }
-}
-if ($#result_filenames < 1) {
- print "Not enough result files to compare\n";
- die;
-}
-
-# for each result file read in and store the header information in
-# an associative array. Take the rest of the input file and store
-# it as a list.
-@result_details = ();
-@result_testcases = ();
-$i = 0;
-foreach $result_filename (@result_filenames) {
- unless (open(F, $result_filename)) {
- print "failed openning $result_filename\n";
- next;
- }
- # advance past the header then read in the rest
- $result_testcases->[$i] = ();
- $result_details->[$i] = {};
- ($host, $datestr, $suite, $ext) = split(/\./, $result_filename);
- $result_details->[$i]->{HOST} = $host;
- $result_details->[$i]->{DATESTR} = $datestr;
- $result_details->[$i]->{SUITE} = $suite;
- while ($line = <F>) {
- # check for the end of the header
- if ($line =~ /^-+/) {
- # we've reached the top of the scanner output
- # grab the rest and stop the while loop;
- @rest = <F>;
- close(F);
- last;
- }
- # grab information from the header
- if ($line =~ /^UNAME/) {
- $line =~ s/UNAME *//;
- $result_details->[$i]->{UNAME} = $line;
- next;
- }
- }
- # convert the results to records and add them to the list
- foreach $line (@rest) {
- ($tag, $tcid, $tc, $status, $contact) = split(/\s+/, $line);
- # fix some of the fields so they sort properly
- $tcid = '{' if ($tcid eq '*');
- $tcid = '}' if ($tcid eq '-');
- $tc = '{' if ($tc eq '*');
- $tc = '}' if ($tc eq '-');
- $rec = ();
- $rec->{TAG} = $tag;
- $rec->{TCID} = $tcid;
- $rec->{TC} = $tc;
- $rec->{STATUS} = $status;
- $rec->{CONTACT} = $contact;
- push(@{$result_testcases[$i]}, $rec);
- }
- $i++;
-}
-
-# sort each set of results.
-# This is the most important step since walking the data depends on
-# correctly sorting the data. Some substitutions are made to keep
-# the test cases in each test tag in the proper order. i.e.
-# s/\*/{/
-#$i = 0;
-foreach $rtcs (@result_testcases) {
- @$rtcs = sort { $a->{TAG} cmp $b->{TAG}
- || $a->{TCID} cmp $b->{TCID}
- || $a->{TC} <=> $b->{TC}
- || $a->{TC} cmp $b->{TC}
- || $a->{STATUS} cmp $b->{STATUS}} @$rtcs;
- #print "sorted file $i\n";
- #print "=" x 50 . "\n";
- #foreach (@$rtcs) {
- # print "$_->{TAG}:$_->{TCID}:$_->{TC}:$_->{STATUS}\n";
- #}
- #print "=" x 50 . "\n";
- #$i++;
-}
-
-# here is the loop that prints the data into a multi-column table with the test
-# tags grouped together.
-
-print "</pre>";
-print "<table border=1>\n";
-
-print "<tr><td>";
-for($i=0; $i <= $#result_testcases; $i++) {
- print "<th colspan=3>$result_details->[$i]->{HOST}.$result_details->[$i]->{DATESTR}.$result_details->[$i]->{SUITE}";
-}
-print "</tr>\n";
-
-print "<tr><th>Test Tag";
-for($i=0; $i <= $#result_testcases; $i++) {
- print "<th>TCID<th>Test Case<th>Status";
-}
-print "<th>Contact</tr>\n";
-
-# while the result lists still have test cases
-# Find the smallest record from the top of the lists
-# remove matching records from the lists and output them
-$last_tag = "";
-while (1) {
-
- # if there wasn't anything left, leave
- $somethingleft = 0;
- foreach $rtcs (@result_testcases) {
- if ($#$rtcs > -1) {
- $somethingleft = 1;
- last;
- }
- }
- unless ($somethingleft) { last; }
-
- # find the Lowest Common Record
- @tops = ();
- foreach $rtcs (@result_testcases) {
- if (@$rtcs[0]) {
- push(@tops, copy_record(@$rtcs[0]));
- }
- }
- @tops = sort { $a->{TAG} cmp $b->{TAG}
- || $a->{TCID} cmp $b->{TCID}
- || $a->{TC} <=> $b->{TC}
- || $a->{TC} cmp $b->{TC}
- || $a->{STATUS} cmp $b->{STATUS}} @tops;
-
- $LCR = $tops[0];
-
- # check to see if everyone matches
- $matches = 0;
- foreach $rtcs (@result_testcases) {
- if (! @$rtcs[0]) { next; }
- if (@$rtcs[0]->{TAG} eq $LCR->{TAG}
- && @$rtcs[0]->{TCID} eq $LCR->{TCID}
- && @$rtcs[0]->{TC} eq $LCR->{TC}
- && @$rtcs[0]->{STATUS} eq $LCR->{STATUS}) {
-
- $matches++;
- }
- }
- # if everyone does match (status included) shift them
- # and move on.
- if ($matches == ($#result_testcases+1)) {
- foreach $rtcs (@result_testcases) { shift(@$rtcs); }
- next;
- }
-
- # if we've already output stuff related to this test tag,
- # skip that column, otherwise print the tag
- if ($LCR->{TAG} eq $lasttag) {
- print "<tr><td>";
- } else {
- print "<tr><td>$LCR->{TAG}";
- $lasttag = $LCR->{TAG};
- }
-
- # walk through the lists again outputting as we match
- $column = 0;
- foreach $rtcs (@result_testcases) {
- if (! @$rtcs[0]) {
- print "<td><td><td>";
- $column++;
- next;
- } elsif (@$rtcs[0]->{TAG} eq $LCR->{TAG}
- && @$rtcs[0]->{TCID} eq $LCR->{TCID}
- && @$rtcs[0]->{TC} eq $LCR->{TC}) {
-
- $match = shift(@$rtcs);
- $match->{TCID} = '*' if ($match->{TCID} eq '{');
- $match->{TCID} = '-' if ($match->{TCID} eq '}');
- $match->{TC} = '*' if ($match->{TC} eq '{');
- $match->{TC} = '-' if ($match->{TC} eq '}');
- print "<td>";
- $rd = $result_details->[$column];
- print "<a href=\"results.cgi?get_df=$rd->{HOST}.$rd->{DATESTR}.$rd->{SUITE}.driver&zoom_tag=$match->{TAG}\">";
- print "$match->{TCID}</a>";
- print "<td>$match->{TC}";
- print "<td>";
- if ($match->{STATUS} =~ /PASS/) {
- print "<font color=green>";
- } elsif ($match->{STATUS} =~ /FAIL/) {
- print "<font color=red>";
- } elsif ($match->{STATUS} =~ /CONF/) {
- print "<font color=yello>";
- } elsif ($match->{STATUS} =~ /BROK/) {
- print "<font color=blue>";
- } else {
- print "<font color=black>";
- }
- print "$match->{STATUS}</font>";
- } else {
- print "<td><td><td>";
- }
- $column++;
- }
- print "<td>$LCR->{CONTACT}</tr>\n";
-}
-print "</table>";
-
-print end_html;
-
-
-sub copy_record {
- my $copy, $rec = shift;
-
- $copy->{TAG} = $rec->{TAG};
- $copy->{TCID} = $rec->{TCID};
- $copy->{TC} = $rec->{TC};
- $copy->{STATUS} = $rec->{STATUS};
- $copy->{CONTACT} = $rec->{CONTACT};
- return $copy;
-
-}
diff --git a/pan/cgi/results.cgi b/pan/cgi/results.cgi
deleted file mode 100755
index f84a92c7d1..0000000000
--- a/pan/cgi/results.cgi
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/perl
-
-use CGI qw(:standard escapeHTML);
-
-# When something goes wrong before we start output, use this function
-# so there is still output
-sub failure {
- print header("text/html"),start_html;
- print "$_[0]\n";
- print end_html;
- exit;
-}
-
-# Most of the work is done in this directory
-unless (chdir("/usr/tests/ltp/results")) {
- failure("Could not get to the results directory\n");
-}
-
-
-# grab the parameters that determine what's going on then branch
-$get_df = param("get_df");
-if ($get_df) {
- # copy a driver file and output it.
- $get_df = (<$get_df*>)[0];
- ($host, $datestr, $suite, $type, $gz) = split(/\./, $get_df);
- #print start_html, "<pre>\n";
- if ($gz) {
- open (DF, "gunzip -c $get_df|") || print "$get_df not found\n";
- } else {
- open (DF, "$get_df") || print "$get_df not found";
- }
- if ($type eq "driver" || $type eq "summary") {
- print header("text/plain");
- $zoom_tag = param("zoom_tag");
- if ($zoom_tag) {
- while (<DF>) {
- # find the start of a test
- while (<DF>) {
- if (/\<\<\<test_start\>\>\>/) {
- $line = <DF>;
- if ($line =~ /^tag=$zoom_tag /) {
- print "<<<test_start>>>\n";
- print $line;
-
- do {
- $line = <DF>;
- print $line;
- } until ($line =~ /\<\<\<test_end\>\>\>/);
- exit;
- }
- }
- }
- }
- print "Did not find tag $zoom_tag\n";
- } else {
- while (<DF>) {
- print $_;
- }
- }
- } elsif ($type eq "scanner") {
- print header("text/html");
- print start_html, "<pre>\n";
- while (<DF>) {
- print;
- if (/^-+/) { last;}
- }
- @rest = <DF>;
- # this is just to put the * at the end of the test case list
- unless (param("raw")) {
- foreach (@rest) { s/\*/{/; }
- foreach (@rest) { s/(\s)-(\s)/\1}\2/; }
- @rest = sort @rest;
- foreach (@rest) { s/{/*/; }
- foreach (@rest) { s/}/-/; }
- }
-
- foreach (@rest) {
- s/(\S+)/<a href="results.cgi?get_df=$host.$datestr.$suite.driver&zoom_tag=\1">\1<\/a>/;
- # colorize the status column
- s/\bPASS\b/\<font color\=green\>PASS\<\/font\>/i;
- s/\bFAIL\b/\<font color\=\"red\"\>FAIL\<\/font\>/i;
- s/\bCONF\b/\<font color\=\"yellow\"\>CONF\<\/font\>/i;
- s/\bBROK\b/\<font color\=\"blue\"\>BROK\<\/font\>/i;
- print;
- }
- print "\n</pre>",end_html;
- }
- close(DF);
- #print "\n</pre>\n",end_html;
-} else {
- %results = ();
-
- # run through the files in the results directory
- @driver_files = <*driver*>;
- foreach $df (sort(@driver_files)) {
-
- ($host, $datestr, $suite, $type, $gz) = split(/\./, $df);
-
- $a_rec = ();
- $a_rec->{HOST} = $host;
- $a_rec->{DATE} = $datestr;
- $a_rec->{SUITE} = $suite;
- $a_rec->{DRIVER_FILE} = $df;
-
- $results{ $a_rec->{DRIVER_FILE} } = $a_rec;
- }
-
- # write the HTML file
- print header("text/html"),start_html;
-
- @ri = values %results;
- @ri = sort { $a->{HOST} cmp $b->{HOST}
- ||$b->{DATE} <=> $a->{DATE}
- ||$a->{SUITE} cmp $b->{SUITE} } @ri;
- $lasthost = "";
- $lastdate = "";
- $lastsuite = "";
- $indent = 0;
- print "<table>\n";
- print "<tr><th>Hostname<th>Date<th>Suite</tr>\n";
- foreach $rp ( @ri ) {
- $thishost = $rp->{HOST};
- $thisdate = $rp->{DATE};
- $thissuite = $rp->{SUITE};
-
- # figure out where is the table we need to start
- if ($lasthost ne $thishost) {
- $indent = 0;
- } elsif ($lastdate ne $thisdate) {
- $indent = 1;
- } elsif ($lastsuite ne $thissuite) {
- $indent = 2;
- }
-
- # write the rows we need depending on the starting point
- # host level
- if ($indent <= 0) {
- print "<tr><td>$thishost\n";
- }
- # date level
- if ($indent <= 1) {
- ($year, $month, $day, $hour, $min) = ($thisdate =~ /(\d+)(\d{2})(\d{2})(\d{2})(\d{2})/);
- print "<tr><td><td>$year-$month-$day $hour:$min\n";
- }
- # suite level
- if ($indent <= 2) {
- print "<tr><td><td><td>";
- print "$thissuite";
- print " [<a href=\"results.cgi?get_df=$rp->{DRIVER_FILE}\">driver output</a>]";
- print " [<a href=\"results.cgi?get_df=$thishost.$thisdate.$thissuite.scanner\">results</a>]";
- print " [<a href=\"results.cgi?get_df=$thishost.$thisdate.$thissuite.summary\">summary</a>]";
-
- print "\n";
- }
-
- # make sure we update the $last... variables
- $lasthost = $thishost;
- $lastdate = $thisdate;
- $lastsuite = $thissuite;
- }
- print "</table>\n";
- print end_html;
-}
-
diff --git a/pan/ltp-bump.c b/pan/ltp-bump.c
deleted file mode 100644
index b6d676f423..0000000000
--- a/pan/ltp-bump.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like. Any license provided herein, whether implied or
- * otherwise, applies only to this software file. Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA 94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
-/* $Id: ltp-bump.c,v 1.1 2009/05/19 09:39:11 subrata_modak Exp $ */
-#include <stdio.h>
-#include <errno.h>
-#include <sys/signal.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "zoolib.h"
-
-pid_t read_active(FILE * fp, char *name);
-
-int main(int argc, char **argv)
-{
- int c;
- char *active = NULL;
- pid_t nanny;
- zoo_t zoo;
- int sig = SIGINT;
-
- while ((c = getopt(argc, argv, "a:s:12")) != -1) {
- switch (c) {
- case 'a':
- active = malloc(strlen(optarg) + 1);
- strcpy(active, optarg);
- break;
- case 's':
- sig = atoi(optarg);
- break;
- case '1':
- sig = SIGUSR1;
- break;
- case '2':
- sig = SIGUSR2;
- break;
- }
- }
-
- if (active == NULL) {
- active = zoo_getname();
- if (active == NULL) {
- fprintf(stderr,
- "ltp-bump: Must supply -a or set ZOO env variable\n");
- exit(1);
- }
- }
-
- if (optind == argc) {
- fprintf(stderr, "ltp-bump: Must supply names\n");
- exit(1);
- }
-
- /* need r+ here because we're using write-locks */
- if ((zoo = zoo_open(active)) == NULL) {
- fprintf(stderr, "ltp-bump: %s\n", zoo_error);
- exit(1);
- }
-
- while (optind < argc) {
- /*printf("argv[%d] = (%s)\n", optind, argv[optind] ); */
- nanny = zoo_getpid(zoo, argv[optind]);
- if (nanny == -1) {
- fprintf(stderr, "ltp-bump: Did not find tag '%s'\n",
- argv[optind]);
- } else {
- if (kill(nanny, sig) == -1) {
- if (errno == ESRCH) {
- fprintf(stderr,
- "ltp-bump: Tag %s (pid %d) seems to be dead already.\n",
- argv[optind], nanny);
- if (zoo_clear(zoo, nanny))
- fprintf(stderr,
- "ltp-bump: %s\n",
- zoo_error);
- }
- }
- }
- ++optind;
- }
- zoo_close(zoo);
-
- exit(0);
-}
diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c
deleted file mode 100644
index 0bdb514771..0000000000
--- a/pan/ltp-pan.c
+++ /dev/null
@@ -1,1485 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like. Any license provided herein, whether implied or
- * otherwise, applies only to this software file. Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA 94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- * Changelog:
- *
- * Added timer options: William Jay Huie, IBM
- * 01/27/03 - Added: Manoj Iyer, manjo@mail.utexas.edu
- * - option '-p' (pretty printing)i to enabled formatted printing
- * of results.
- *
- * 01/27/03 - Added: Manoj Iyer, manjo@mail.utexas.edu
- * - added code to print system information
- *
- * 01/28/03 - Added: Manoj Iyer, manjo@mail.utexas.edu
- * - added code to print test exit value.
- *
- * 01/29/03 - Added: Manoj Iyer, manjo@mail.utexas.edu
- * - added code supresses test start and test end tags.
- *
- * 07/22/07 - Added: Ricardo Salveti de Araujo, rsalveti@linux.vnet.ibm.com
- * - added option to create a command file with all failed tests.
- *
- */
-/* $Id: ltp-pan.c,v 1.4 2009/10/15 18:45:55 yaberauneya Exp $ */
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <stdarg.h>
-#include <sys/times.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/utsname.h>
-#include <errno.h>
-#include <err.h>
-#include <limits.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-
-#include "splitstr.h"
-#include "zoolib.h"
-#include "tst_res_flags.h"
-
-/* One entry in the command line collection. */
-struct coll_entry {
- char *name; /* tag name */
- char *cmdline; /* command line */
- char *pcnt_f; /* location of %f in the command line args, flag */
- struct coll_entry *next;
-};
-
-struct collection {
- int cnt;
- struct coll_entry **ary;
-};
-
-struct tag_pgrp {
- int pgrp;
- int stopping;
- time_t mystime;
- struct coll_entry *cmd;
- char output[PATH_MAX];
-};
-
-struct orphan_pgrp {
- int pgrp;
- struct orphan_pgrp *next;
-};
-
-static pid_t run_child(struct coll_entry *colle, struct tag_pgrp *active,
- int quiet_mode, int *failcnt, int fmt_print,
- FILE * logfile, int no_kmsg);
-static char *slurp(char *file);
-static struct collection *get_collection(char *file, int optind, int argc,
- char **argv);
-static void pids_running(struct tag_pgrp *running, int keep_active);
-static int check_pids(struct tag_pgrp *running, int *num_active,
- int keep_active, FILE * logfile, FILE * failcmdfile,
- FILE *tconfcmdfile, struct orphan_pgrp *orphans,
- int fmt_print, int *failcnt, int *tconfcnt,
- int quiet_mode, int no_kmsg);
-static void propagate_signal(struct tag_pgrp *running, int keep_active,
- struct orphan_pgrp *orphans);
-static void dump_coll(struct collection *coll);
-static char *subst_pcnt_f(struct coll_entry *colle);
-static void mark_orphan(struct orphan_pgrp *orphans, pid_t cpid);
-static void orphans_running(struct orphan_pgrp *orphans);
-static void check_orphans(struct orphan_pgrp *orphans, int sig);
-
-static void copy_buffered_output(struct tag_pgrp *running);
-static void write_test_start(struct tag_pgrp *running, int no_kmsg);
-static void write_test_end(struct tag_pgrp *running, const char *init_status,
- time_t exit_time, char *term_type, int stat_loc,
- int term_id, struct tms *tms1, struct tms *tms2);
-
-//wjh
-static char PAN_STOP_FILE[] = "PAN_STOP_FILE";
-
-static char *panname = NULL;
-static char *test_out_dir = NULL; /* dir to buffer output to */
-zoo_t zoofile;
-static char *reporttype = NULL;
-
-/* Common format string for ltp-pan results */
-#define ResultFmt "%-50s %-10.10s"
-
-/* zoolib */
-int rec_signal; /* received signal */
-int send_signal; /* signal to send */
-
-/* Debug Bits */
-int Debug = 0;
-#define Dbuffile 0x000400 /* buffer file use */
-#define Dsetup 0x000200 /* one-time set-up */
-#define Dshutdown 0x000100 /* killed by signal */
-#define Dexit 0x000020 /* exit status */
-#define Drunning 0x000010 /* current pids running */
-#define Dstartup 0x000004 /* started command */
-#define Dstart 0x000002 /* started command */
-#define Dwait 0x000001 /* wait interrupted */
-
-int main(int argc, char **argv)
-{
- extern char *optarg;
- extern int optind;
- char *zooname = NULL; /* name of the zoo file to use */
- char *filename = "/dev/null"; /* filename to read test tags from */
- char *logfilename = NULL;
- char *failcmdfilename = NULL;
- char *tconfcmdfilename = NULL;
- char *outputfilename = NULL;
- struct collection *coll = NULL;
- struct tag_pgrp *running;
- struct orphan_pgrp *orphans, *orph;
- struct utsname unamebuf;
- FILE *logfile = NULL;
- FILE *failcmdfile = NULL;
- FILE *tconfcmdfile = NULL;
- int keep_active = 1;
- int num_active = 0;
- int failcnt = 0; /* count of total testcases that failed. */
- int tconfcnt = 0; /* count of total testcases that return TCONF */
- int err, i;
- int starts = -1;
- int timed = 0;
- int run_time = -1;
- char modifier = 'm';
- int ret = 0;
- int stop;
- int go_idle;
- int has_brakes = 0; /* stop everything if a test case fails */
- int sequential = 0; /* run tests sequentially */
- int fork_in_road = 0;
- int exit_stat;
- int track_exit_stats = 0; /* exit non-zero if any test exits non-zero */
- int fmt_print = 0; /* enables formatted printing of logfiles. */
- int quiet_mode = 0; /* supresses test start and test end tags. */
- int no_kmsg = 0; /* don't log into /dev/kmsg */
- int c;
- pid_t cpid;
- struct sigaction sa;
-
- while ((c =
- getopt(argc, argv, "AO:Sa:C:QT:d:ef:hl:n:o:pqr:s:t:x:y"))
- != -1) {
- switch (c) {
- case 'A': /* all-stop flag */
- has_brakes = 1;
- track_exit_stats = 1;
- break;
- case 'O': /* output buffering directory */
- test_out_dir = strdup(optarg);
- break;
- case 'S': /* run tests sequentially */
- sequential = 1;
- break;
- case 'a': /* name of the zoo file to use */
- zooname = strdup(optarg);
- break;
- case 'C': /* name of the file where all failed commands will be */
- failcmdfilename = strdup(optarg);
- break;
- case 'Q':
- no_kmsg = 1;
- break;
- case 'T':
- /*
- * test cases that are not fully tested will be recorded
- * in this file
- */
- tconfcmdfilename = strdup(optarg);
- break;
- case 'd': /* debug options */
- sscanf(optarg, "%i", &Debug);
- break;
- case 'e': /* exit non-zero if any test exists non-zero */
- track_exit_stats = 1;
- break;
- case 'f': /* filename to read test tags from */
- filename = strdup(optarg);
- break;
- case 'h': /* help */
- fprintf(stdout,
- "Usage: pan -n name [ -SyAehpqQ ] [ -s starts ]"
- " [-t time[s|m|h|d] [ -x nactive ] [ -l logfile ]\n\t"
- "[ -a active-file ] [ -f command-file ] "
- "[ -C fail-command-file ] "
- "[ -d debug-level ]\n\t[-o output-file] "
- "[-O output-buffer-directory] [cmd]\n");
- exit(0);
- case 'l': /* log file */
- logfilename = strdup(optarg);
- break;
- case 'n': /* tag given to pan */
- panname = strdup(optarg);
- break;
- case 'o': /* send test output here */
- outputfilename = strdup(optarg);
- break;
- case 'p': /* formatted printing. */
- fmt_print = 1;
- break;
- case 'q': /* supress test start and test end messages */
- quiet_mode = 1;
- break;
- case 'r': /* reporting type: none, rts */
- reporttype = strdup(optarg);
- break;
- case 's': /* number of tags to run */
- starts = atoi(optarg);
- break;
- case 't': /* run_time to run */
- ret = sscanf(optarg, "%d%c", &run_time, &modifier);
- if (ret == 0) {
- fprintf(stderr,
- "Need proper time input: ####x where "
- "x is one of s,m,h,d\n");
- break;
- } else if (ret == 1) {
- fprintf(stderr, "Only got a time value of %d "
- "modifiers need to come immediately after #"
- " assuming %c\n", run_time, modifier);
- } else {
- switch (modifier) {
- case 's':
- run_time = run_time;
- break;
- case 'm':
- run_time = run_time * 60;
- break;
- case 'h':
- run_time = run_time * 60 * 60;
- break;
- case 'd':
- run_time = run_time * 60 * 60 * 24;
- break;
- default:
- fprintf(stderr,
- "Invalid time modifier, try: s|h|m|d\n");
- exit(-1);
- }
- if (!quiet_mode)
- printf("PAN will run for %d seconds\n",
- run_time);
- }
- timed = 1; //-t implies run as many starts as possible, by default
- break;
- case 'x': /* number of tags to keep running */
- keep_active = atoi(optarg);
- break;
- case 'y': /* restart on failure or signal */
- fork_in_road = 1;
- break;
- }
- }
-
- if (panname == NULL) {
- fprintf(stderr, "pan: Must supply -n\n");
- exit(1);
- }
- if (zooname == NULL) {
- zooname = zoo_getname();
- if (zooname == NULL) {
- fprintf(stderr,
- "pan(%s): Must supply -a or set ZOO env variable\n",
- panname);
- exit(1);
- }
- }
- if (reporttype) {
- /* make sure we understand the report type */
- if (strcasecmp(reporttype, "rts")
- && strcasecmp(reporttype, "none")
- /* && strcasecmp(reporttype, "xml") */
- )
- reporttype = "rts";
- } else {
- /* set the default */
- reporttype = "rts";
- }
-
- if (logfilename != NULL) {
- time_t startup;
- char *s;
-
- if (!strcmp(logfilename, "-")) {
- logfile = stdout;
- } else {
- if ((logfile = fopen(logfilename, "a+e")) == NULL) {
- fprintf(stderr,
- "pan(%s): Error %s (%d) opening log file '%s'\n",
- panname, strerror(errno), errno,
- logfilename);
- exit(1);
- }
- }
-
- time(&startup);
- s = ctime(&startup);
- *(s + strlen(s) - 1) = '\0';
- if (!fmt_print)
- fprintf(logfile, "startup='%s'\n", s);
- else {
- fprintf(logfile, "Test Start Time: %s\n", s);
- fprintf(logfile,
- "-----------------------------------------\n");
- fprintf(logfile, ResultFmt" %-10.10s\n",
- "Testcase", "Result", "Exit Value");
- fprintf(logfile, ResultFmt" %-10.10s\n",
- "--------", "------", "------------");
- }
- fflush(logfile);
- }
-
- coll = get_collection(filename, optind, argc, argv);
- if (!coll)
- exit(1);
- if (coll->cnt == 0) {
- fprintf(stderr,
- "pan(%s): Must supply a file collection or a command\n",
- panname);
- exit(1);
- }
-
- if (Debug & Dsetup)
- dump_coll(coll);
-
- /* a place to store the pgrps we're watching */
- running =
- malloc((keep_active + 1) *
- sizeof(struct tag_pgrp));
- if (running == NULL) {
- fprintf(stderr, "pan(%s): Failed to allocate memory: %s\n",
- panname, strerror(errno));
- exit(2);
- }
- memset(running, 0, keep_active * sizeof(struct tag_pgrp));
- running[keep_active].pgrp = -1; /* end sentinel */
-
- /* a head to the orphaned pgrp list */
- orphans = malloc(sizeof(struct orphan_pgrp));
- memset(orphans, 0, sizeof(struct orphan_pgrp));
-
- srand48(time(NULL) ^ (getpid() + (getpid() << 15)));
-
- /* Supply a default for starts. If we are in sequential mode, use
- * the number of commands available; otherwise 1.
- */
- if (timed == 1 && starts == -1) { /* timed, infinite by default */
- starts = -1;
- } else if (starts == -1) {
- if (sequential) {
- starts = coll->cnt;
- } else {
- starts = 1;
- }
- } else if (starts == 0) { /* if the user specified infinite, set it */
- starts = -1;
- } else { /* else, make sure we are starting at least keep_active processes */
- if (starts < keep_active)
- starts = keep_active;
- }
-
- /* if we're buffering output, but we're only running on process at a time,
- * then essentially "turn off buffering"
- */
- if (test_out_dir && (keep_active == 1)) {
- free(test_out_dir);
- test_out_dir = NULL;
- }
-
- if (test_out_dir) {
- struct stat sbuf;
-
- if (stat(test_out_dir, &sbuf) < 0) {
- fprintf(stderr,
- "pan(%s): stat of -O arg '%s' failed. errno: %d %s\n",
- panname, test_out_dir, errno, strerror(errno));
- exit(1);
- }
- if (!S_ISDIR(sbuf.st_mode)) {
- fprintf(stderr,
- "pan(%s): -O arg '%s' must be a directory.\n",
- panname, test_out_dir);
- exit(1);
- }
- if (access(test_out_dir, W_OK | R_OK | X_OK) < 0) {
- fprintf(stderr,
- "pan(%s): permission denied on -O arg '%s'. errno: %d %s\n",
- panname, test_out_dir, errno, strerror(errno));
- exit(1);
- }
- }
-
- if (outputfilename) {
- if (!freopen(outputfilename, "a+", stdout)) {
- fprintf(stderr,
- "pan(%s): Error %s (%d) opening output file '%s'\n",
- panname, strerror(errno), errno,
- outputfilename);
- exit(1);
- }
- }
-
- if (failcmdfilename) {
- if (!(failcmdfile = fopen(failcmdfilename, "a+e"))) {
- fprintf(stderr,
- "pan(%s): Error %s (%d) opening fail cmd file '%s'\n",
- panname, strerror(errno), errno,
- failcmdfilename);
- exit(1);
- }
- }
-
- if (tconfcmdfilename) {
- tconfcmdfile = fopen(tconfcmdfilename, "a+e");
- if (!tconfcmdfile) {
- fprintf(stderr, "pan(%s): Error %s (%d) opening "
- "tconf cmd file '%s'\n", panname,
- strerror(errno), errno, tconfcmdfilename);
- exit(1);
- }
- }
-
- if ((zoofile = zoo_open(zooname)) == NULL) {
- fprintf(stderr, "pan(%s): %s\n", panname, zoo_error);
- exit(1);
- }
- if (zoo_mark_args(zoofile, getpid(), panname, argc, argv)) {
- fprintf(stderr, "pan(%s): %s\n", panname, zoo_error);
- exit(1);
- }
-
- /* Allocate N spaces for max-arg commands.
- * this is an "active file cleanliness" thing
- */
- {
- for (c = 0; c < keep_active; c++) {
- if (zoo_mark_cmdline(zoofile, c, panname, "")) {
- fprintf(stderr, "pan(%s): %s\n", panname,
- zoo_error);
- exit(1);
- }
- }
- for (c = 0; c < keep_active; c++) {
- if (zoo_clear(zoofile, c)) {
- fprintf(stderr, "pan(%s): %s\n", panname,
- zoo_error);
- exit(1);
- }
- }
- }
-
- rec_signal = send_signal = 0;
- if (run_time != -1) {
- alarm(run_time);
- }
-
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = 0;
- sa.sa_handler = wait_handler;
-
- sigaction(SIGALRM, &sa, NULL);
- sigaction(SIGINT, &sa, NULL);
- sigaction(SIGTERM, &sa, NULL);
- sigaction(SIGHUP, &sa, NULL);
- sigaction(SIGUSR1, &sa, NULL); /* ignore fork_in_road */
- sigaction(SIGUSR2, &sa, NULL); /* stop the scheduler */
-
- c = 0; /* in this loop, c is the command index */
- stop = 0;
- exit_stat = 0;
- go_idle = 0;
- while (1) {
-
- while ((num_active < keep_active) && (starts != 0)) {
- if (stop || rec_signal || go_idle)
- break;
-
- if (!sequential)
- c = lrand48() % coll->cnt;
-
- /* find a slot for the child */
- for (i = 0; i < keep_active; ++i) {
- if (running[i].pgrp == 0)
- break;
- }
- if (i == keep_active) {
- fprintf(stderr,
- "pan(%s): Aborting: i == keep_active = %d\n",
- panname, i);
- wait_handler(SIGINT);
- exit_stat++;
- break;
- }
-
- cpid =
- run_child(coll->ary[c], running + i, quiet_mode,
- &failcnt, fmt_print, logfile, no_kmsg);
- if (cpid != -1)
- ++num_active;
- if ((cpid != -1 || sequential) && starts > 0)
- --starts;
-
- if (sequential)
- if (++c >= coll->cnt)
- c = 0;
-
- } /* while ((num_active < keep_active) && (starts != 0)) */
-
- if (starts == 0) {
- if (!quiet_mode)
- printf("incrementing stop\n");
- ++stop;
- } else if (starts == -1) //wjh
- {
- FILE *f = (FILE *) - 1;
- if ((f = fopen(PAN_STOP_FILE, "r")) != 0) {
- printf("Got %s Stopping!\n", PAN_STOP_FILE);
- fclose(f);
- unlink(PAN_STOP_FILE);
- stop++;
- }
- }
-
- if (rec_signal) {
- /* propagate everything except sigusr2 */
-
- if (rec_signal == SIGUSR2) {
- if (fork_in_road)
- ++go_idle;
- else
- ++stop;
- rec_signal = send_signal = 0;
- } else {
- if (rec_signal == SIGUSR1)
- fork_in_road = 0;
- propagate_signal(running, keep_active, orphans);
- if (fork_in_road)
- ++go_idle;
- else
- ++stop;
- }
- }
-
- err = check_pids(running, &num_active, keep_active, logfile,
- failcmdfile, tconfcmdfile, orphans, fmt_print,
- &failcnt, &tconfcnt, quiet_mode, no_kmsg);
- if (Debug & Drunning) {
- pids_running(running, keep_active);
- orphans_running(orphans);
- }
- if (err) {
- if (fork_in_road)
- ++go_idle;
- if (track_exit_stats)
- exit_stat++;
- if (has_brakes) {
- fprintf(stderr, "pan(%s): All stop!%s\n",
- panname, go_idle ? " (idling)" : "");
- wait_handler(SIGINT);
- }
- }
-
- if (stop && (num_active == 0))
- break;
-
- if (go_idle && (num_active == 0)) {
- go_idle = 0; /* It is idle, now resume scheduling. */
- wait_handler(0); /* Reset the signal ratchet. */
- }
- }
-
- /* Wait for orphaned pgrps */
- while (1) {
- for (orph = orphans; orph != NULL; orph = orph->next) {
- if (orph->pgrp == 0)
- continue;
- /* Yes, we have orphaned pgrps */
- sleep(5);
- if (!rec_signal) {
- /* force an artificial signal, move us
- * through the signal ratchet.
- */
- wait_handler(SIGINT);
- }
- propagate_signal(running, keep_active, orphans);
- if (Debug & Drunning)
- orphans_running(orphans);
- break;
- }
- if (orph == NULL)
- break;
- }
-
- if (zoo_clear(zoofile, getpid())) {
- fprintf(stderr, "pan(%s): %s\n", panname, zoo_error);
- ++exit_stat;
- }
- fclose(zoofile);
- if (logfile && fmt_print) {
- if (uname(&unamebuf) == -1)
- fprintf(stderr, "ERROR: uname(): %s\n",
- strerror(errno));
- fprintf(logfile,
- "\n-----------------------------------------------\n");
- fprintf(logfile, "Total Tests: %d\n", coll->cnt);
- fprintf(logfile, "Total Skipped Tests: %d\n", tconfcnt);
- fprintf(logfile, "Total Failures: %d\n", failcnt);
- fprintf(logfile, "Kernel Version: %s\n", unamebuf.release);
- fprintf(logfile, "Machine Architecture: %s\n",
- unamebuf.machine);
- fprintf(logfile, "Hostname: %s\n\n", unamebuf.nodename);
- }
- if (logfile && (logfile != stdout))
- fclose(logfile);
-
- if (failcmdfile)
- fclose(failcmdfile);
-
- if (tconfcmdfile)
- fclose(tconfcmdfile);
- exit(exit_stat);
-}
-
-static void
-propagate_signal(struct tag_pgrp *running, int keep_active,
- struct orphan_pgrp *orphans)
-{
- int i;
-
- if (Debug & Dshutdown)
- fprintf(stderr, "pan was signaled with sig %d...\n",
- rec_signal);
-
- if (rec_signal == SIGALRM) {
- printf("PAN stop Alarm was received\n");
- rec_signal = SIGTERM;
- }
-
- for (i = 0; i < keep_active; ++i) {
- if (running[i].pgrp == 0)
- continue;
-
- if (Debug & Dshutdown)
- fprintf(stderr, " propagating sig %d to %d\n",
- send_signal, -running[i].pgrp);
- if (kill(-running[i].pgrp, send_signal) != 0) {
- fprintf(stderr,
- "pan(%s): kill(%d,%d) failed on tag (%s). errno:%d %s\n",
- panname, -running[i].pgrp, send_signal,
- running[i].cmd->name, errno, strerror(errno));
- }
- running[i].stopping = 1;
- }
-
- check_orphans(orphans, send_signal);
-
- rec_signal = send_signal = 0;
-}
-
-static int
-check_pids(struct tag_pgrp *running, int *num_active, int keep_active,
- FILE *logfile, FILE *failcmdfile, FILE *tconfcmdfile,
- struct orphan_pgrp *orphans, int fmt_print, int *failcnt,
- int *tconfcnt, int quiet_mode, int no_kmsg)
-{
- int w;
- pid_t cpid;
- int stat_loc;
- int ret = 0;
- int i;
- time_t t;
- char *status;
- char *result_str;
- int signaled = 0;
- struct tms tms1, tms2;
- clock_t tck;
-
- check_orphans(orphans, 0);
-
- tck = times(&tms1);
- if (tck == -1) {
- fprintf(stderr, "pan(%s): times(&tms1) failed. errno:%d %s\n",
- panname, errno, strerror(errno));
- }
- cpid = wait(&stat_loc);
- tck = times(&tms2);
- if (tck == -1) {
- fprintf(stderr, "pan(%s): times(&tms2) failed. errno:%d %s\n",
- panname, errno, strerror(errno));
- }
-
- if (cpid < 0) {
- if (errno == EINTR) {
- if (Debug)
- fprintf(stderr, "pan(%s): wait() interrupted\n",
- panname);
- } else if (errno != ECHILD) {
- fprintf(stderr,
- "pan(%s): wait() failed. errno:%d %s\n",
- panname, errno, strerror(errno));
- }
- } else if (cpid > 0) {
-
- if (WIFSIGNALED(stat_loc)) {
- w = WTERMSIG(stat_loc);
- status = "signaled";
- if (Debug & Dexit)
- fprintf(stderr,
- "child %d terminated with signal %d\n",
- cpid, w);
- --*num_active;
- signaled = 1;
- } else if (WIFEXITED(stat_loc)) {
- w = WEXITSTATUS(stat_loc);
- status = "exited";
- if (Debug & Dexit)
- fprintf(stderr,
- "child %d exited with status %d\n",
- cpid, w);
- --*num_active;
- if (w != 0 && w != TCONF)
- ret++;
- } else if (WIFSTOPPED(stat_loc)) { /* should never happen */
- w = WSTOPSIG(stat_loc);
- status = "stopped";
- ret++;
- } else { /* should never happen */
- w = 0;
- status = "unknown";
- ret++;
- }
-
- for (i = 0; i < keep_active; ++i) {
- if (running[i].pgrp == cpid) {
- if ((w == 130) && running[i].stopping &&
- (strcmp(status, "exited") == 0)) {
- /* The child received sigint, but
- * did not trap for it? Compensate
- * for it here.
- */
- w = 0;
- ret--; /* undo */
- if (Debug & Drunning)
- fprintf(stderr,
- "pan(%s): tag=%s exited 130, known to be signaled; will give it an exit 0.\n",
- panname,
- running[i].cmd->name);
- }
- time(&t);
- if (logfile != NULL) {
- if (!fmt_print)
- fprintf(logfile,
- "tag=%s stime=%d dur=%d exit=%s stat=%d core=%s cu=%d cs=%d\n",
- running[i].cmd->name,
- (int)(running[i].
- mystime),
- (int)(t -
- running[i].
- mystime), status,
- w,
- (stat_loc & 0200) ?
- "yes" : "no",
- (int)(tms2.tms_cutime -
- tms1.tms_cutime),
- (int)(tms2.tms_cstime -
- tms1.tms_cstime));
- else {
- if (strcmp(status, "exited") ==
- 0 && w == TCONF) {
- ++*tconfcnt;
- result_str = "CONF";
- } else if (w != 0) {
- ++*failcnt;
- result_str = "FAIL";
- } else {
- result_str = "PASS";
- }
-
- fprintf(logfile,
- ResultFmt" %-5d\n",
- running[i].cmd->name,
- result_str,
- w);
- }
-
- fflush(logfile);
- }
-
- if (w != 0) {
- if (tconfcmdfile != NULL &&
- w == TCONF) {
- fprintf(tconfcmdfile, "%s %s\n",
- running[i].cmd->name,
- running[i].cmd->cmdline);
- } else if (failcmdfile != NULL) {
- fprintf(failcmdfile, "%s %s\n",
- running[i].cmd->name,
- running[i].cmd->cmdline);
- }
- }
-
- if (running[i].stopping)
- status = "driver_interrupt";
-
- if (test_out_dir) {
- if (!quiet_mode)
- write_test_start(running + i, no_kmsg);
- copy_buffered_output(running + i);
- unlink(running[i].output);
- }
- if (!quiet_mode)
- write_test_end(running + i, "ok", t,
- status, stat_loc, w,
- &tms1, &tms2);
-
- /* If signaled and we weren't expecting
- * this to be stopped then the proc
- * had a problem.
- */
- if (signaled && !running[i].stopping)
- ret++;
-
- running[i].pgrp = 0;
- if (zoo_clear(zoofile, cpid)) {
- fprintf(stderr, "pan(%s): %s\n",
- panname, zoo_error);
- exit(1);
- }
-
- /* Check for orphaned pgrps */
- if ((kill(-cpid, 0) == 0) || (errno == EPERM)) {
- if (zoo_mark_cmdline
- (zoofile, cpid, "panorphan",
- running[i].cmd->cmdline)) {
- fprintf(stderr, "pan(%s): %s\n",
- panname, zoo_error);
- exit(1);
- }
- mark_orphan(orphans, cpid);
- /* status of kill doesn't matter */
- kill(-cpid, SIGTERM);
- }
-
- break;
- }
- }
- }
- return ret;
-}
-
-static pid_t
-run_child(struct coll_entry *colle, struct tag_pgrp *active, int quiet_mode,
- int *failcnt, int fmt_print, FILE * logfile, int no_kmsg)
-{
- ssize_t errlen;
- int cpid;
- int c_stdout = -1; /* child's stdout, stderr */
- int capturing = 0; /* output is going to a file instead of stdout */
- char *c_cmdline;
- static long cmdno = 0;
- int errpipe[2]; /* way to communicate to parent that the tag */
- char errbuf[1024]; /* didn't actually start */
-
- /* Try to open the file that will be stdout for the test */
- if (test_out_dir) {
- capturing = 1;
- do {
- sprintf(active->output, "%s/%s.%ld",
- test_out_dir, colle->name, cmdno++);
- c_stdout =
- open(active->output,
- O_CREAT | O_RDWR | O_EXCL | O_SYNC, 0666);
- } while (c_stdout < 0 && errno == EEXIST);
- if (c_stdout < 0) {
- fprintf(stderr,
- "pan(%s): open of stdout file failed (tag %s). errno: %d %s\n file: %s\n",
- panname, colle->name, errno, strerror(errno),
- active->output);
- return -1;
- }
- }
-
- /* get the tag's command line arguments ready. subst_pcnt_f() uses a
- * static counter, that's why we do it here instead of after we fork.
- */
- if (colle->pcnt_f) {
- c_cmdline = subst_pcnt_f(colle);
- } else {
- c_cmdline = colle->cmdline;
- }
-
- if (pipe(errpipe) < 0) {
- fprintf(stderr, "pan(%s): pipe() failed. errno:%d %s\n",
- panname, errno, strerror(errno));
- if (capturing) {
- close(c_stdout);
- unlink(active->output);
- }
- return -1;
- }
-
- time(&active->mystime);
- active->cmd = colle;
-
- if (!test_out_dir && !quiet_mode)
- write_test_start(active, no_kmsg);
-
- fflush(NULL);
-
- if ((cpid = fork()) == -1) {
- fprintf(stderr,
- "pan(%s): fork failed (tag %s). errno:%d %s\n",
- panname, colle->name, errno, strerror(errno));
- if (capturing) {
- unlink(active->output);
- close(c_stdout);
- }
- close(errpipe[0]);
- close(errpipe[1]);
- return -1;
- } else if (cpid == 0) {
- /* child */
-
- fclose(zoofile);
- close(errpipe[0]);
- fcntl(errpipe[1], F_SETFD, 1); /* close the pipe if we succeed */
- setpgrp();
-
- umask(0);
-
-#define WRITE_OR_DIE(fd, buf, buflen) do { \
- if (write((fd), (buf), (buflen)) != (buflen)) { \
- err(1, "failed to write out %zd bytes at line %d", \
- buflen, __LINE__); \
- } \
-} while(0)
-
- /* if we're putting output into a buffer file, we need to do the
- * redirection now. If we fail
- */
- if (capturing) {
- if (dup2(c_stdout, fileno(stdout)) == -1) {
- errlen =
- sprintf(errbuf,
- "pan(%s): couldn't redirect stdout for tag %s. errno:%d %s",
- panname, colle->name, errno,
- strerror(errno));
- WRITE_OR_DIE(errpipe[1], &errlen,
- sizeof(errlen));
- WRITE_OR_DIE(errpipe[1], errbuf, errlen);
- exit(2);
- }
- if (dup2(c_stdout, fileno(stderr)) == -1) {
- errlen =
- sprintf(errbuf,
- "pan(%s): couldn't redirect stderr for tag %s. errno:%d %s",
- panname, colle->name, errno,
- strerror(errno));
- WRITE_OR_DIE(errpipe[1], &errlen,
- sizeof(errlen));
- WRITE_OR_DIE(errpipe[1], errbuf, errlen);
- exit(2);
- }
- } else { /* stderr still needs to be redirected */
- if (dup2(fileno(stdout), fileno(stderr)) == -1) {
- errlen =
- sprintf(errbuf,
- "pan(%s): couldn't redirect stderr for tag %s. errno:%d %s",
- panname, colle->name, errno,
- strerror(errno));
- WRITE_OR_DIE(errpipe[1], &errlen,
- sizeof(errlen));
- WRITE_OR_DIE(errpipe[1], errbuf, errlen);
- exit(2);
- }
- }
- /* If there are any shell-type characters in the cmdline
- * such as '>', '<', '$', '|', etc, then we exec a shell and
- * run the cmd under a shell.
- *
- * Otherwise, break the cmdline at white space and exec the
- * cmd directly.
- */
- if (strpbrk(c_cmdline, "\"';|<>$\\")) {
- execlp("sh", "sh", "-c", c_cmdline, NULL);
- errlen = sprintf(errbuf,
- "pan(%s): execlp of '%s' (tag %s) failed. errno:%d %s",
- panname, c_cmdline, colle->name, errno,
- strerror(errno));
- } else {
- char **arg_v;
-
- arg_v = (char **)splitstr(c_cmdline, NULL, NULL);
-
- execvp(arg_v[0], arg_v);
- errlen = sprintf(errbuf,
- "pan(%s): execvp of '%s' (tag %s) failed. errno:%d %s",
- panname, arg_v[0], colle->name, errno,
- strerror(errno));
- }
- WRITE_OR_DIE(errpipe[1], &errlen, sizeof(errlen));
- WRITE_OR_DIE(errpipe[1], errbuf, errlen);
- exit(errno);
- }
-
- /* parent */
-
- /* subst_pcnt_f() allocates the command line dynamically
- * free the malloc to prevent a memory leak
- */
- if (colle->pcnt_f)
- free(c_cmdline);
-
- close(errpipe[1]);
-
- /* if the child couldn't go through with the exec,
- * clean up the mess, note it, and move on
- */
- if (read(errpipe[0], &errlen, sizeof(errlen))) {
- int status;
- time_t end_time;
- int termid;
- char *termtype;
- struct tms notime = { 0, 0, 0, 0 };
-
- if (read(errpipe[0], errbuf, errlen) < 0)
- fprintf(stderr, "Failed to read from errpipe[0]\n");
- close(errpipe[0]);
- errbuf[errlen] = '\0';
- /* fprintf(stderr, "%s", errbuf); */
- waitpid(cpid, &status, 0);
- if (WIFSIGNALED(status)) {
- termid = WTERMSIG(status);
- termtype = "signaled";
- } else if (WIFEXITED(status)) {
- termid = WEXITSTATUS(status);
- termtype = "exited";
- } else if (WIFSTOPPED(status)) {
- termid = WSTOPSIG(status);
- termtype = "stopped";
- } else {
- termid = 0;
- termtype = "unknown";
- }
- time(&end_time);
- if (logfile != NULL) {
- if (!fmt_print) {
- fprintf(logfile,
- "tag=%s stime=%d dur=%d exit=%s "
- "stat=%d core=%s cu=%d cs=%d\n",
- colle->name, (int)(active->mystime),
- (int)(end_time - active->mystime),
- termtype, termid,
- (status & 0200) ? "yes" : "no", 0, 0);
- } else {
- if (termid != 0)
- ++ * failcnt;
-
- fprintf(logfile, ResultFmt" %-5d\n",
- colle->name,
- ((termid != 0) ? "FAIL" : "PASS"),
- termid);
- }
- fflush(logfile);
- }
-
- if (!quiet_mode) {
- write_test_end(active, errbuf, end_time, termtype,
- status, termid, ¬ime, ¬ime);
- }
- if (capturing) {
- close(c_stdout);
- unlink(active->output);
- }
- return -1;
- }
-
- close(errpipe[0]);
- if (capturing)
- close(c_stdout);
-
- active->pgrp = cpid;
- active->stopping = 0;
-
- if (zoo_mark_cmdline(zoofile, cpid, colle->name, colle->cmdline)) {
- fprintf(stderr, "pan(%s): %s\n", panname, zoo_error);
- exit(1);
- }
-
- if (Debug & Dstartup)
- fprintf(stderr, "started %s cpid=%d at %s",
- colle->name, cpid, ctime(&active->mystime));
-
- if (Debug & Dstart) {
- fprintf(stderr, "Executing test = %s as %s", colle->name,
- colle->cmdline);
- if (capturing)
- fprintf(stderr, "with output file = %s\n",
- active->output);
- else
- fprintf(stderr, "\n");
- }
-
- return cpid;
-}
-
-static char *subst_pcnt_f(struct coll_entry *colle)
-{
- static int counter = 1;
- char pid_and_counter[20];
- char new_cmdline[1024];
-
- /* if we get called falsely, do the right thing anyway */
- if (!colle->pcnt_f)
- return colle->cmdline;
-
- snprintf(pid_and_counter, 20, "%d_%d", getpid(), counter++);
- snprintf(new_cmdline, 1024, colle->cmdline, pid_and_counter);
- return strdup(new_cmdline);
-}
-
-static struct collection *get_collection(char *file, int optind, int argc,
- char **argv)
-{
- char *buf, *a, *b;
- struct coll_entry *head, *p, *n;
- struct collection *coll;
- int i;
-
- buf = slurp(file);
- if (!buf)
- return NULL;
-
- coll = malloc(sizeof(struct collection));
- coll->cnt = 0;
-
- head = p = n = NULL;
- a = b = buf;
- while (a) {
- /* set b to the start of the next line and add a NULL character
- * to separate the two lines */
- if ((b = strchr(a, '\n')) != NULL)
- *b++ = '\0';
-
- /* If this is line isn't a comment */
- if ((*a != '#') && (*a != '\0') && (*a != ' ')) {
- n = malloc(sizeof(struct coll_entry));
- if ((n->pcnt_f = strstr(a, "%f"))) {
- n->pcnt_f[1] = 's';
- }
- n->name = strdup(strsep(&a, " \t"));
- while (a != NULL && isspace(*a))
- a++;
- if (a == NULL || a[0] == 0) {
- fprintf(stderr,
- "pan(%s): Testcase '%s' requires a command to execute.\n",
- panname, n->name);
- return NULL;
- }
- n->cmdline = strdup(a);
- n->next = NULL;
-
- if (p) {
- p->next = n;
- }
- if (head == NULL) {
- head = n;
- }
- p = n;
- coll->cnt++;
- }
- a = b;
- }
- free(buf);
-
- /* is there something on the commandline to be counted? */
- if (optind < argc) {
- char workstr[1024] = "";
- int workstr_left = 1023;
-
- /* fill arg list */
- for (i = 0; optind < argc; ++optind, ++i) {
- strncat(workstr, argv[optind], workstr_left);
- workstr_left = workstr_left - strlen(argv[optind]);
- strncat(workstr, " ", workstr_left);
- workstr_left--;
- }
-
- n = malloc(sizeof(struct coll_entry));
- if ((n->pcnt_f = strstr(workstr, "%f"))) {
- n->pcnt_f[1] = 's';
- }
- n->cmdline = strdup(workstr);
- n->name = "cmdln";
- n->next = NULL;
- if (p) {
- p->next = n;
- }
- if (head == NULL) {
- head = n;
- }
- coll->cnt++;
- }
-
- /* get an array */
- coll->ary = malloc(coll->cnt * sizeof(struct coll_entry *));
-
- /* fill the array */
- i = 0;
- n = head;
- while (n != NULL) {
- coll->ary[i] = n;
- n = n->next;
- ++i;
- }
- if (i != coll->cnt)
- fprintf(stderr, "pan(%s): i doesn't match cnt\n", panname);
-
- return coll;
-}
-
-static char *slurp(char *file)
-{
- char *buf;
- int fd;
- struct stat sbuf;
-
- if ((fd = open(file, O_RDONLY)) < 0) {
- fprintf(stderr,
- "pan(%s): open(%s,O_RDONLY) failed. errno:%d %s\n",
- panname, file, errno, strerror(errno));
- return NULL;
- }
-
- if (fstat(fd, &sbuf) < 0) {
- fprintf(stderr, "pan(%s): fstat(%s) failed. errno:%d %s\n",
- panname, file, errno, strerror(errno));
- return NULL;
- }
-
- buf = malloc(sbuf.st_size + 1);
- if (read(fd, buf, sbuf.st_size) != sbuf.st_size) {
- fprintf(stderr, "pan(%s): slurp failed. errno:%d %s\n",
- panname, errno, strerror(errno));
- free(buf);
- return NULL;
- }
- buf[sbuf.st_size] = '\0';
-
- close(fd);
- return buf;
-}
-
-static void check_orphans(struct orphan_pgrp *orphans, int sig)
-{
- struct orphan_pgrp *orph;
-
- for (orph = orphans; orph != NULL; orph = orph->next) {
- if (orph->pgrp == 0)
- continue;
-
- if (Debug & Dshutdown)
- fprintf(stderr,
- " propagating sig %d to orphaned pgrp %d\n",
- sig, -(orph->pgrp));
- if (kill(-(orph->pgrp), sig) != 0) {
- if (errno == ESRCH) {
- /* This pgrp is now empty */
- if (zoo_clear(zoofile, orph->pgrp)) {
- fprintf(stderr, "pan(%s): %s\n",
- panname, zoo_error);
- }
- orph->pgrp = 0;
- } else {
- fprintf(stderr,
- "pan(%s): kill(%d,%d) on orphaned pgrp failed. errno:%d %s\n",
- panname, -(orph->pgrp), sig, errno,
- strerror(errno));
- }
- }
- }
-}
-
-static void mark_orphan(struct orphan_pgrp *orphans, pid_t cpid)
-{
- struct orphan_pgrp *orph;
-
- for (orph = orphans; orph != NULL; orph = orph->next) {
- if (orph->pgrp == 0)
- break;
- }
- if (orph == NULL) {
- /* make a new struct */
- orph = malloc(sizeof(struct orphan_pgrp));
-
- /* plug in the new struct just after the head */
- orph->next = orphans->next;
- orphans->next = orph;
- }
- orph->pgrp = cpid;
-}
-
-static void copy_buffered_output(struct tag_pgrp *running)
-{
- char *tag_output;
-
- tag_output = slurp(running->output);
- if (tag_output) {
- printf("%s", tag_output);
- /* make sure the output ends with a newline */
- if (tag_output[strlen(tag_output) - 1] != '\n')
- printf("\n");
- fflush(stdout);
- free(tag_output);
- }
-}
-
-static void write_kmsg(const char *fmt, ...)
-{
- FILE *kmsg;
- va_list ap;
-
- if ((kmsg = fopen("/dev/kmsg", "r+")) == NULL) {
- fprintf(stderr, "Error %s: (%d) opening /dev/kmsg\n",
- strerror(errno), errno);
- exit(1);
- }
-
- va_start(ap, fmt);
- vfprintf(kmsg, fmt, ap);
- va_end(ap);
- fclose(kmsg);
-}
-
-static void write_test_start(struct tag_pgrp *running, int no_kmsg)
-{
- if (!strcmp(reporttype, "rts")) {
-
- printf
- ("%s\ntag=%s stime=%lld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\n%s\n",
- "<<<test_start>>>", running->cmd->name, (long long)running->mystime,
- running->cmd->cmdline, "", "exit", "<<<test_output>>>");
- }
- fflush(stdout);
- if (no_kmsg)
- return;
-
- if (strcmp(running->cmd->name, running->cmd->cmdline))
- write_kmsg("LTP: starting %s (%s)\n", running->cmd->name,
- running->cmd->cmdline);
- else
- write_kmsg("LTP: starting %s\n", running->cmd->name);
-}
-
-static void
-write_test_end(struct tag_pgrp *running, const char *init_status,
- time_t exit_time, char *term_type, int stat_loc,
- int term_id, struct tms *tms1, struct tms *tms2)
-{
- if (!strcmp(reporttype, "rts")) {
- printf
- ("%s\ninitiation_status=\"%s\"\nduration=%ld termination_type=%s "
- "termination_id=%d corefile=%s\ncutime=%d cstime=%d\n%s\n",
- "<<<execution_status>>>", init_status,
- (long)(exit_time - running->mystime), term_type, term_id,
- (stat_loc & 0200) ? "yes" : "no",
- (int)(tms2->tms_cutime - tms1->tms_cutime),
- (int)(tms2->tms_cstime - tms1->tms_cstime),
- "<<<test_end>>>");
- }
- fflush(stdout);
-}
-
-/* The functions below are all debugging related */
-
-static void pids_running(struct tag_pgrp *running, int keep_active)
-{
- int i;
-
- fprintf(stderr, "pids still running: ");
- for (i = 0; i < keep_active; ++i) {
- if (running[i].pgrp != 0)
- fprintf(stderr, "%d ", running[i].pgrp);
- }
- fprintf(stderr, "\n");
-}
-
-static void orphans_running(struct orphan_pgrp *orphans)
-{
- struct orphan_pgrp *orph;
-
- fprintf(stderr, "orphans still running: ");
- for (orph = orphans; orph != NULL; orph = orph->next) {
- if (orph->pgrp != 0)
- fprintf(stderr, "%d ", -(orph->pgrp));
- }
- fprintf(stderr, "\n");
-}
-
-static void dump_coll(struct collection *coll)
-{
- int i;
-
- for (i = 0; i < coll->cnt; ++i) {
- fprintf(stderr, "coll %d\n", i);
- fprintf(stderr, " name=%s cmdline=%s\n", coll->ary[i]->name,
- coll->ary[i]->cmdline);
- }
-}
-
-void wait_handler(int sig)
-{
- static int lastsent = 0;
-
- if (sig == 0) {
- lastsent = 0;
- } else {
- rec_signal = sig;
- if (sig == SIGUSR2)
- return;
- if (lastsent == 0)
- send_signal = sig;
- else if (lastsent == SIGUSR1)
- send_signal = SIGINT;
- else if (lastsent == sig)
- send_signal = SIGTERM;
- else if (lastsent == SIGTERM)
- send_signal = SIGHUP;
- else if (lastsent == SIGHUP)
- send_signal = SIGKILL;
- lastsent = send_signal;
- }
-}
diff --git a/pan/splitstr.c b/pan/splitstr.c
deleted file mode 100644
index 39b469856d..0000000000
--- a/pan/splitstr.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like. Any license provided herein, whether implied or
- * otherwise, applies only to this software file. Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA 94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
-/* $Id: splitstr.c,v 1.2 2000/09/21 20:42:31 nstraz Exp $ */
-/*
- * Synopsis
- *
- * const char **splitstr(const char *str, const char *separator, int *argcount)
- *
- * Description
- * This function splits a string (str) into components that are separated by
- * one or more of the characters in the (separator) string. An array of
- * strings is returned, along with argcount being set to the number of strings
- * found. Argcount can be NULL. There will always be a NULL element in the
- * array after the last valid element. If an error occurs, NULL will be
- * returned and argcount will be set to zero.
- *
- * To rid yourself of the memory allocated for splitstr(), pass the return
- * value from splitstr() unmodified to splitstr_free():
- *
- * void splitstr_free( const char ** return_from_splitstr );
- *
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h> /* for string functions */
-#ifdef UNIT_TEST
-#include <assert.h>
-#endif /* UNIT_TEST */
-#include "splitstr.h"
-
-const char **splitstr(const char *str, const char *separator, int *argcount)
-{
- char *arg_string = NULL, **arg_array = NULL, *cur_tok = NULL;
-
- int num_toks = 0, max_toks = 20, i;
-
- /*
- * In most recoverable errors, if argcount is not NULL,
- * set argcount to 0. Then return NULL.
- */
- if (str == NULL) {
- if (argcount != NULL)
- *argcount = 0;
- return (NULL);
- }
-
- /*
- * set aside temporary space to work on the string.
- */
- arg_string = strdup(str);
-
- if (arg_string == NULL) {
- if (argcount != NULL)
- *argcount = 0;
- return (NULL);
- }
-
- /*
- * set aside an initial char ** array for string array.
- */
- arg_array = malloc(sizeof(char *) * max_toks);
-
- if (arg_array == NULL) {
- if (argcount != NULL)
- *argcount = 0;
- free(arg_string);
- return (NULL);
- }
-
- if (separator == NULL)
- separator = " \t";
-
- /*
- * Use strtok() to parse 'arg_string', placing pointers to the
- * individual tokens into the elements of 'arg_array'. Expand
- * 'arg_array' if necessary.
- */
- cur_tok = strtok(arg_string, separator);
- while (cur_tok != NULL) {
- arg_array[num_toks++] = cur_tok;
- cur_tok = strtok(NULL, separator);
- if (num_toks == max_toks) {
- max_toks += 20;
- arg_array =
- (char **)realloc((void *)arg_array,
- sizeof(char *) * max_toks);
- if (arg_array == NULL) {
- fprintf(stderr, "realloc: New memory allocation failed \n");
- free(arg_string);
- exit(1);
- }
- }
- }
- arg_array[num_toks] = NULL;
-
- /*
- * If there are any spaces left in our array, make them NULL
- */
- for (i = num_toks + 1; i < max_toks; i++)
- arg_array[i] = NULL;
-
- /* This seems nice, but since memory is allocated on a page basis, this
- * isn't really helpful:
- * arg_array = (char **)realloc((void *)arg_array, sizeof(char *)*num_toks+1 );*/
-
- if (argcount != NULL)
- *argcount = num_toks;
-
- /*
- * Return the argument array.
- */
- return ((const char **)arg_array);
-}
-
-/*
- * splitster_free( const char ** )
- *
- * This takes the return value from splitster() and free()s memory
- * allocated by splitster. Assuming: ret=splitster(...), this
- * requires that ret and *ret returned from splitster() have not
- * been modified.
- */
-void splitstr_free(const char **p_return)
-{
- if (*p_return != NULL)
- free((char *)*p_return);
- if (p_return != NULL)
- free((char **)p_return);
-}
-
-#ifdef UNIT_TEST
-
-int main()
-{
- int i, y, test_size = 1000, size_ret;
- char test_str[32768];
- char buf[16];
- char *test_str_array[test_size];
- const char **ret;
-
- for (i = 0; i < test_size; i++) {
- snprintf(buf, 16, "arg%d", i);
- test_str_array[i] = strdup(buf);
- }
-
- for (i = 0; i < test_size; i++) {
- test_str[0] = '\0';
- for (y = 0; y < i; y++) {
- snprintf(buf, 16, "arg%d ", y);
- strncat(test_str, buf, 16);
- }
- ret = splitstr(test_str, NULL, &size_ret);
- assert(size_ret == i);
- for (y = 0; y < i; y++)
- assert(strcmp(ret[y], test_str_array[y]) == 0);
-
- splitstr_free(ret);
- }
- return 0;
-}
-
-#endif
diff --git a/pan/splitstr.h b/pan/splitstr.h
deleted file mode 100644
index 2ffa24f432..0000000000
--- a/pan/splitstr.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef _SPLITSTR_H_
-#define _SPLITSTR_H_
-/*
- * Synopsis
- *
- * const char **splitstr(const char *str, const char *separator, int *argcount)
- *
- * Description
- * This function splits a string (str) into components that are separated by
- * one or more of the characters in the (separator) string. An array of
- * strings is returned, along with argcount being set to the number of strings
- * found. Argcount can be NULL. There will always be a NULL element in the
- * array after the last valid element. If an error occurs, NULL will be
- * returned and argcount will be set to zero.
- *
- * To rid yourself of the memory allocated for splitstr(), pass the return
- * value from splitstr() unmodified to splitstr_free():
- *
- * void splitstr_free( const char ** return_from_splitstr );
- *
- */
-const char **
-splitstr(const char *, const char *, int *);
-
-/*
- * splitster_free( const char ** )
- *
- * This takes the return value from splitster() and free()s memory
- * allocated by splitster. Assuming: ret=splitster(...), this
- * requires that ret and *ret returned from splitster() have not
- * been modified.
- */
-void
-splitstr_free( const char ** );
-
-#endif
diff --git a/pan/tag_report.h b/pan/tag_report.h
deleted file mode 100644
index df838e8c9d..0000000000
--- a/pan/tag_report.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like. Any license provided herein, whether implied or
- * otherwise, applies only to this software file. Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA 94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
-/* $Id: tag_report.h,v 1.1 2000/09/21 21:35:06 alaffin Exp $ */
-#ifndef _TAG_REPORT_H_
-#define _TAG_REPORT_H_
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h> /* strftime */
-#include <unistd.h> /* getopt */
-#include "symbol.h"
-#include "splitstr.h"
-
-int test_result( char *, char *, char *, char *, SYM );
-int cuts_report( SYM, SYM, char *, char * );
-int tag_report( SYM, SYM, SYM );
-int print_header( SYM );
-int cuts_testcase( SYM, SYM );
-
-#endif
diff --git a/pan/zoolib.c b/pan/zoolib.c
deleted file mode 100644
index 0ac7852661..0000000000
--- a/pan/zoolib.c
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like. Any license provided herein, whether implied or
- * otherwise, applies only to this software file. Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA 94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
-/* $Id: zoolib.c,v 1.8 2009/06/09 17:59:46 subrata_modak Exp $ */
-/*
- * ZooLib
- *
- * A Zoo is a file used to record what test tags are running at the moment.
- * If the system crashes, we should be able to look at the zoo file to find out
- * what was currently running. This is especially helpful when running multiple
- * tests at the same time.
- *
- * The zoo file is meant to be a text file that fits on a standard console.
- * You should be able to watch it with `cat zoofile`
- *
- * zoo file format:
- * 80 characters per line, ending with a \n
- * available lines start with '#'
- * expected line fromat: pid_t,tag,cmdline
- *
- */
-
-#include <signal.h>
-#include <stdlib.h> /* for getenv */
-#include <string.h>
-#include "zoolib.h"
-
-char zoo_error[ZELEN];
-
-#ifdef __linux__
-/* glibc2.2 definition needs -D_XOPEN_SOURCE, which breaks other things. */
-extern int sighold(int __sig);
-extern int sigrelse(int __sig);
-#endif
-
-/* zoo_mark(): private function to make an entry to the zoo
- * returns 0 on success, -1 on error */
-static int zoo_mark(zoo_t z, char *entry);
-static int zoo_lock(zoo_t z);
-static int zoo_unlock(zoo_t z);
-/* cat_args(): helper function to make cmdline from argc, argv */
-char *cat_args(int argc, char **argv);
-
-/* zoo_getname(): create a filename to use for the zoo */
-char *zoo_getname(void)
-{
- char buf[1024];
- char *zoo;
-
- zoo = getenv("ZOO");
- if (zoo) {
- snprintf(buf, 1024, "%s/%s", zoo, "active");
- return strdup(buf);
- } else {
- /* if there is no environment variable, we don't know where to put it */
- return NULL;
- }
-}
-
-/* zoo_open(): open a zoo for use */
-zoo_t zoo_open(char *zooname)
-{
- zoo_t new_zoo;
-
- new_zoo = (zoo_t) fopen(zooname, "r+");
- if (!new_zoo) {
- if (errno == ENOENT) {
- /* file doesn't exist, try fopen(xxx, "a+") */
- new_zoo = (zoo_t) fopen(zooname, "a+");
- if (!new_zoo) {
- /* total failure */
- snprintf(zoo_error, ZELEN,
- "Could not open zoo as \"%s\", errno:%d %s",
- zooname, errno, strerror(errno));
- return 0;
- }
- fclose(new_zoo);
- new_zoo = fopen(zooname, "r+");
- } else {
- snprintf(zoo_error, ZELEN,
- "Could not open zoo as \"%s\", errno:%d %s",
- zooname, errno, strerror(errno));
- }
- }
- return new_zoo;
-}
-
-int zoo_close(zoo_t z)
-{
- int ret;
-
- ret = fclose(z);
- if (ret) {
- snprintf(zoo_error, ZELEN,
- "closing zoo caused error, errno:%d %s",
- errno, strerror(errno));
- }
- return ret;
-}
-
-static int zoo_mark(zoo_t z, char *entry)
-{
- FILE *fp = (FILE *) z;
- int found = 0;
- long pos;
- char buf[BUFLEN];
-
- if (fp == NULL)
- return -1;
-
- if (zoo_lock(z))
- return -1;
-
- /* first fit */
- rewind(fp);
-
- do {
- pos = ftell(fp);
-
- if (fgets(buf, BUFLEN, fp) == NULL)
- break;
-
- if (buf[0] == '#') {
- rewind(fp);
- if (fseek(fp, pos, SEEK_SET)) {
- /* error */
- snprintf(zoo_error, ZELEN,
- "seek error while writing to zoo file, errno:%d %s",
- errno, strerror(errno));
- return -1;
- }
- /* write the entry, left justified, and padded/truncated to the
- * same size as the previous entry */
- fprintf(fp, "%-*.*s\n", (int)strlen(buf) - 1,
- (int)strlen(buf) - 1, entry);
- found = 1;
- break;
- }
- } while (1);
-
- if (!found) {
- if (fseek(fp, 0, SEEK_END)) {
- snprintf(zoo_error, ZELEN,
- "error seeking to end of zoo file, errno:%d %s",
- errno, strerror(errno));
- return -1;
- }
- fprintf(fp, "%-*.*s\n", 79, 79, entry);
- }
- fflush(fp);
-
- if (zoo_unlock(z))
- return -1;
- return 0;
-}
-
-int zoo_mark_cmdline(zoo_t z, pid_t p, char *tag, char *cmdline)
-{
- char new_entry[BUFLEN];
-
- snprintf(new_entry, 80, "%d,%s,%s", p, tag, cmdline);
- return zoo_mark(z, new_entry);
-}
-
-int zoo_mark_args(zoo_t z, pid_t p, char *tag, int ac, char **av)
-{
- char *cmdline;
- int ret;
-
- cmdline = cat_args(ac, av);
- ret = zoo_mark_cmdline(z, p, tag, cmdline);
-
- free(cmdline);
- return ret;
-}
-
-int zoo_clear(zoo_t z, pid_t p)
-{
- FILE *fp = (FILE *) z;
- long pos;
- char buf[BUFLEN];
- pid_t that_pid;
- int found = 0;
-
- if (fp == NULL)
- return -1;
-
- if (zoo_lock(z))
- return -1;
- rewind(fp);
-
- do {
- pos = ftell(fp);
-
- if (fgets(buf, BUFLEN, fp) == NULL)
- break;
-
- if (buf[0] == '#')
- continue;
-
- that_pid = atoi(buf);
- if (that_pid == p) {
- if (fseek(fp, pos, SEEK_SET)) {
- /* error */
- snprintf(zoo_error, ZELEN,
- "seek error while writing to zoo file, errno:%d %s",
- errno, strerror(errno));
- return -1;
- }
- if (ftell(fp) != pos) {
- printf("fseek failed\n");
- }
- fputs("#", fp);
- found = 1;
- break;
- }
- } while (1);
-
- fflush(fp);
-
- /* FIXME: unlock zoo file */
- if (zoo_unlock(z))
- return -1;
-
- if (!found) {
- snprintf(zoo_error, ZELEN,
- "zoo_clear() did not find pid(%d)", p);
- return 1;
- }
- return 0;
-
-}
-
-pid_t zoo_getpid(zoo_t z, char *tag)
-{
- FILE *fp = (FILE *) z;
- char buf[BUFLEN], *s;
- pid_t this_pid = -1;
-
- if (fp == NULL)
- return -1;
-
- if (zoo_lock(z))
- return -1;
-
- rewind(fp);
- do {
- if (fgets(buf, BUFLEN, fp) == NULL)
- break;
-
- if (buf[0] == '#')
- continue; /* recycled line */
-
- if ((s = strchr(buf, ',')) == NULL)
- continue; /* line was not expected format */
-
- if (strncmp(s + 1, tag, strlen(tag)))
- continue; /* tag does not match */
-
- this_pid = atoi(buf);
- break;
- } while (1);
-
- if (zoo_unlock(z))
- return -1;
- return this_pid;
-}
-
-int zoo_lock(zoo_t z)
-{
- FILE *fp = (FILE *) z;
- struct flock zlock;
- sigset_t block_these;
- int ret;
-
- if (fp == NULL)
- return -1;
-
- zlock.l_whence = zlock.l_start = zlock.l_len = 0;
- zlock.l_type = F_WRLCK;
-
- sigemptyset(&block_these);
- sigaddset(&block_these, SIGINT);
- sigaddset(&block_these, SIGTERM);
- sigaddset(&block_these, SIGHUP);
- sigaddset(&block_these, SIGUSR1);
- sigaddset(&block_these, SIGUSR2);
- sigprocmask(SIG_BLOCK, &block_these, NULL);
-
- do {
- ret = fcntl(fileno(fp), F_SETLKW, &zlock);
- } while (ret == -1 && errno == EINTR);
-
- sigprocmask(SIG_UNBLOCK, &block_these, NULL);
- if (ret == -1) {
- snprintf(zoo_error, ZELEN,
- "failed to unlock zoo file, errno:%d %s",
- errno, strerror(errno));
- return -1;
- }
- return 0;
-
-}
-
-int zoo_unlock(zoo_t z)
-{
- FILE *fp = (FILE *) z;
- struct flock zlock;
- sigset_t block_these;
- int ret;
-
- if (fp == NULL)
- return -1;
-
- zlock.l_whence = zlock.l_start = zlock.l_len = 0;
- zlock.l_type = F_UNLCK;
-
- sigemptyset(&block_these);
- sigaddset(&block_these, SIGINT);
- sigaddset(&block_these, SIGTERM);
- sigaddset(&block_these, SIGHUP);
- sigaddset(&block_these, SIGUSR1);
- sigaddset(&block_these, SIGUSR2);
- sigprocmask(SIG_BLOCK, &block_these, NULL);
-
- do {
- ret = fcntl(fileno(fp), F_SETLKW, &zlock);
- } while (ret == -1 && errno == EINTR);
-
- sigprocmask(SIG_UNBLOCK, &block_these, NULL);
-
- if (ret == -1) {
- snprintf(zoo_error, ZELEN,
- "failed to lock zoo file, errno:%d %s",
- errno, strerror(errno));
- return -1;
- }
- return 0;
-}
-
-char *cat_args(int argc, char **argv)
-{
- int a, size;
- char *cmd;
-
- for (size = a = 0; a < argc; a++) {
- size += strlen(argv[a]);
- size++;
- }
-
- if ((cmd = malloc(size)) == NULL) {
- snprintf(zoo_error, ZELEN,
- "Malloc Error, %s/%d", __FILE__, __LINE__);
- return NULL;
- }
-
- *cmd = '\0';
- for (a = 0; a < argc; a++) {
- if (a != 0)
- strcat(cmd, " ");
- strcat(cmd, argv[a]);
- }
-
- return cmd;
-}
-
-#if defined(UNIT_TEST)
-
-void zt_add(zoo_t z, int n)
-{
- char cmdline[200];
- char tag[10];
-
- snprintf(tag, 10, "%s%d", "test", n);
- snprintf(cmdline, 200, "%s%d %s %s %s", "runtest", n, "one", "two",
- "three");
-
- zoo_mark_cmdline(z, n, tag, cmdline);
-}
-
-int main(int argc, char *argv[])
-{
-
- char *zooname;
- zoo_t test_zoo;
- char *test_tag = "unittest";
- int i, j;
-
- zooname = zoo_getname();
-
- if (!zooname) {
- zooname = strdup("test_zoo");
- }
- printf("Test zoo filename is %s\n", zooname);
-
- if ((test_zoo = zoo_open(zooname)) == NULL) {
- printf("Error opennning zoo\n");
- exit(-1);
- }
-
- zoo_mark_args(test_zoo, getpid(), test_tag, argc, argv);
-
- for (j = 0; j < 5; j++) {
- for (i = 0; i < 20; i++) {
- zt_add(test_zoo, i);
- }
-
- for (; i >= 0; i--) {
- zoo_clear(test_zoo, i);
- }
- }
-
- zoo_clear(test_zoo, getpid());
-
- return 0;
-}
-
-#endif
diff --git a/pan/zoolib.h b/pan/zoolib.h
deleted file mode 100644
index 6fb01fa411..0000000000
--- a/pan/zoolib.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like. Any license provided herein, whether implied or
- * otherwise, applies only to this software file. Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA 94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
-/* $Id: zoolib.h,v 1.5 2006/06/27 09:37:34 vapier Exp $ */
-#ifndef ZOOLIB_H
-#define ZOOLIB_H
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/signal.h>
-
-typedef FILE *zoo_t;
-#define ZELEN 512
-extern char zoo_error[ZELEN];
-#define BUFLEN 81
-
-int lock_file( FILE *fp, short ltype, char **errmsg );
-/* FILE *open_file( char *file, char *mode, char **errmsg ); */
-
-void wait_handler();
-
-/* char *zoo_active( void ); */
-/* zoo_getname(): create a filename to use for the zoo
- * returns NULL on error */
-char *zoo_getname(void);
-
-/* zoo_open(): open a zoo file for use
- * returns NULL on error */
-zoo_t zoo_open(char *zooname);
-
-/* zoo_close(): close an open zoo file */
-int zoo_close(zoo_t z);
-
-/* zoo_mark_cmdline(): make an entry to the zoo
- * returns 0 on success, -1 on error */
-int zoo_mark_cmdline(zoo_t z, pid_t p, char *tag, char *cmdline);
-
-/* zoo_mark_args(): make an entry to the zoo using argc argv
- * returns 0 on success, -1 on error */
-int zoo_mark_args(zoo_t z, pid_t p, char *tag, int ac, char **av);
-
-/* zoo_clear(): mark a pid as completed
- * returns 0 on success, -1 on error, 1 as warning */
-int zoo_clear(zoo_t z, pid_t p);
-
-/* zoo_getpid(): get the pid for a specified tag
- * returns pid_t on success and 0 on error */
-pid_t zoo_getpid(zoo_t z, char *tag);
-
-
-#endif /* ZOOLIB_H */
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [LTP] [PATCH v2 5/6] tools: Remove tools used by runltp
2026-02-05 12:15 [LTP] [PATCH v2 0/6] Remove runltp Petr Vorel
` (3 preceding siblings ...)
2026-02-05 12:15 ` [LTP] [PATCH v2 4/6] pan: Remove Petr Vorel
@ 2026-02-05 12:15 ` Petr Vorel
2026-02-17 9:46 ` Cyril Hrubis
2026-02-05 12:15 ` [LTP] [PATCH v2 6/6] kirk: Remove runltp-ng symlink Petr Vorel
` (2 subsequent siblings)
7 siblings, 1 reply; 29+ messages in thread
From: Petr Vorel @ 2026-02-05 12:15 UTC (permalink / raw)
To: ltp; +Cc: automated-testing
restore_kernel_faults_default.sh and insert_kernel_faults.sh were used
by create_kernel_faults_in_loops_and_probability.awk, other tools
(create_dmesg_entries_for_each_test.awk, create_valgrind_check.awk,
create_kernel_faults_in_loops_and_probability.awk, genhtml.pl, genload,
html_report_header.txt) directly by runltp.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
tools/Makefile | 2 +-
tools/create_dmesg_entries_for_each_test.awk | 35 -
...kernel_faults_in_loops_and_probability.awk | 40 -
tools/create_valgrind_check.awk | 42 -
tools/genhtml.pl | 249 -----
tools/genload/.gitignore | 2 -
tools/genload/Makefile | 31 -
tools/genload/README | 72 --
tools/genload/genload.c | 898 ------------------
tools/genload/stress.c | 898 ------------------
| 56 --
tools/insert_kernel_faults.sh | 53 --
tools/restore_kernel_faults_default.sh | 86 --
13 files changed, 1 insertion(+), 2463 deletions(-)
delete mode 100644 tools/create_dmesg_entries_for_each_test.awk
delete mode 100644 tools/create_kernel_faults_in_loops_and_probability.awk
delete mode 100644 tools/create_valgrind_check.awk
delete mode 100644 tools/genhtml.pl
delete mode 100644 tools/genload/.gitignore
delete mode 100644 tools/genload/Makefile
delete mode 100644 tools/genload/README
delete mode 100644 tools/genload/genload.c
delete mode 100644 tools/genload/stress.c
delete mode 100644 tools/html_report_header.txt
delete mode 100755 tools/insert_kernel_faults.sh
delete mode 100755 tools/restore_kernel_faults_default.sh
diff --git a/tools/Makefile b/tools/Makefile
index adbf4fe70b..e31af5fcdf 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -24,7 +24,7 @@ top_srcdir ?= ..
include $(top_srcdir)/include/mk/testcases.mk
-INSTALL_TARGETS := *.awk *.pl *.sh html_report_header.txt
+INSTALL_TARGETS := *.sh
INSTALL_DIR := bin
diff --git a/tools/create_dmesg_entries_for_each_test.awk b/tools/create_dmesg_entries_for_each_test.awk
deleted file mode 100644
index b21364ae06..0000000000
--- a/tools/create_dmesg_entries_for_each_test.awk
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/awk -f
-#
-# Script for adding necessary dmesg clear/capture calls before executing
-# commands.
-#
-# Copyright (C) 2012, Linux Test Project.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, April 2012
-#
-
-NF && ! /^#/ {
- s = $1 "__with_dmesg_entry dmesg -c 1>/dev/null 2>&1;"
- for (i = 2; i <= NF; i++) {
- s = s " " $i
- }
- sub(/[;]+$/, "", s)
- s = s "; EXIT_CODE=$?"
- s = s "; dmesg > " DMESG_DIR "/" $1 ".dmesg.log"
- s = s "; exit $EXIT_CODE"
- print s
-}
diff --git a/tools/create_kernel_faults_in_loops_and_probability.awk b/tools/create_kernel_faults_in_loops_and_probability.awk
deleted file mode 100644
index e2ec3b515d..0000000000
--- a/tools/create_kernel_faults_in_loops_and_probability.awk
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/awk -f
-#
-# Script for adding necessary dmesg clear/capture calls before executing
-# commands.
-#
-# Copyright (C) 2012, Linux Test Project.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, April 2012
-#
-
-NF && ! /^#/ {
- print
- for (i = 1; i <= LOOPS; i++) {
- s = $1 "_loop_" i "_under_fault_kernel "
- if (i == 1) {
- s = s "$LTPROOT/bin/insert_kernel_faults.sh " PERCENTAGE "; "
- }
- for (j = 2; j <= NF; j++) {
- s = s " " $j
- }
- if (i == LOOPS) {
- s = s "; while ! $LTPROOT/bin/restore_kernel_faults_default.sh; do :; done"
- }
- print s
- }
-}
diff --git a/tools/create_valgrind_check.awk b/tools/create_valgrind_check.awk
deleted file mode 100644
index 05cf6fac4b..0000000000
--- a/tools/create_valgrind_check.awk
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/awk -f
-#
-# Script for adding necessary valgrind calls before commands.
-#
-# Copyright (C) 2012, Linux Test Project.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, April 2012
-#
-
-# XXX: this script doesn't handle items that would be executed via pan with
-# /bin/sh properly.
-NF && ! /^#/ {
- print
- if (CHECK_LEVEL == 1 || CHECK_LEVEL == 3) {
- s=$1 "_valgrind_memory_leak_check valgrind -q --leak-check=full --trace-children=yes"
- for (i = 2; i <= NF; i++) {
- s = s " " $i
- }
- print s
- }
- if (CHECK_LEVEL == 2 || CHECK_LEVEL == 3) {
- s=$1 "_valgrind_thread_concurrency_check valgrind -q --tool=helgrind --trace-children=yes"
- for (i = 2; i <= NF; i++) {
- s = s " " $i
- }
- print s
- }
-}
diff --git a/tools/genhtml.pl b/tools/genhtml.pl
deleted file mode 100644
index 79c178d014..0000000000
--- a/tools/genhtml.pl
+++ /dev/null
@@ -1,249 +0,0 @@
-#!/usr/bin/perl
-#****************************************************************************#
-# Copyright (c) International Business Machines Corp., 2001 #
-# #
-# This program is free software; you can redistribute it an#or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation; either version 2 of the License, or #
-# (at your option) any later version. #
-# #
-# This program is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See #
-# the GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with this program; if not, write to the Free Software #
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #
-# #
-#****************************************************************************#
-
-#****************************************************************************#
-# #
-# File: genhtml.pl #
-# #
-# Description: This is a Parser which can parse the text output generated by #
-# pan and convert the same to am HTML format, with proper high- #
-# lighting of test result backgorund for easy identification of #
-# pass/fail of testcases #
-# #
-# Author: Subrata Modak: subrata@linux.vnet.ibm.com #
-# #
-# #
-#****************************************************************************#
-
-
-my $process_line = 0;
-my $row_line = "";
-my $flag = 0;
-my $flag2 = 0;
-my $flag3 = 0;
-my $flag4 = 0;
-my $test_counter = 1;
-my $failed_test_counter = 0;
-my $failed_test_counter_flag = 0;
-my $brok_test_counter = 0;
-my $brok_test_counter_flag = 0;
-my $warn_test_counter = 0;
-my $warn_test_counter_flag = 0;
-my $retr_test_counter = 0;
-my $retr_test_counter_flag = 0;
-my $conf_test_counter = 0;
-my $conf_test_counter_flag = 0;
-my $test_passed = 0;
-
-my $detected_fail = 0;
-my $detected_pass = 0;
-my $detected_warn = 0;
-my $detected_brok = 0;
-my $detected_retr = 0;
-my $detected_conf = 0;
-my $background_colour =0;
-
-my $header_file = shift (@ARGV) || syntax();
-my $start_tag = shift (@ARGV) || syntax();
-my $end_tag = shift (@ARGV) || syntax();
-my $output_tag = shift (@ARGV) || syntax();
-my $execution_tag = shift (@ARGV) || syntax();
-
-sub syntax() {
- print "syntax: prtag2tag start_tag end_tag output_tag execution_tag file(s)\n";
- exit (1);
-}
-
-sub get_background_colour_column() {
- if ( $detected_fail == 1 ) {
- return "#ff0000";
- } elsif ( $detected_brok == 1 ) {
- return Yellow;
- } elsif ( $detected_warn == 1 ) {
- return Fuchsia;
- } elsif ( $detected_retr == 1 ) {
- return "#8dc997";
- } elsif ( $detected_conf == 1 ) {
- return Aqua;
- } else {
- return "#66ff66";
- }
-}
-
-print STDERR "-------------------------------------------------\n";
-print STDERR "INFO: genhtml.pl script is deprecated, try kirk\n";
-print STDERR "(new LTP runner which also generates JSON output)\n";
-print STDERR "https://github.com/linux-test-project/kirk\n";
-print STDERR "-------------------------------------------------\n";
-
-if ($start_tag eq "" || $end_tag eq "" || $output_tag eq "" || $execution_tag eq "") {
- syntax();
-}
-
-open (FILE, "$header_file") || "Cannot open file: $header_file";
-while ($line_2 = <FILE>) {
- $row_line = $row_line . $line_2;
-}
-$row_line =~ s/LTP\ Output\/Log/LTP\ Output\/Log\ (Report\ Generated\ on\ $ENV{TEST_START_TIME})/;
-print $row_line;
-close (FILE);
-$row_line = "";
-
-
-foreach my $file (@ARGV) {
-
- open (FILE, $file) || die "Cannot open file: $file\n";
-
- LINE: while ($line = <FILE>) {
- chomp $line;
-
- if ($line =~ /$start_tag/) {
- $process_line = 1;
- $flag = 1;
- }
- if ($line =~ /$end_tag/) {
- print "$row_line";
- $process_line = 0;
- $flag = 0; $flag2 = 0; $flag3 = 0; $flag4 = 0; $flag5 = 0;
- $detected_fail = 0; $detected_pass = 0; $detected_warn = 0; $detected_brok = 0; $detected_retr = 0; $detected_conf = 0;
- $background_colour = 0; $failed_test_counter_flag = 0; $brok_test_counter_flag = 0; $warn_test_counter_flag = 0; $retr_test_counter_flag = 0; $conf_test_counter_flag = 0; $row_line= "";
- }
-
- if ($process_line) {
- if ( $flag == 2) { #Assuming we will find "tag" and "stime" values here
- @variable_value_pair = split(/\ /, $line);
- @tag_value = split(/=/,$variable_value_pair[0]);
- @stime_value = split(/=/,$variable_value_pair[1]);
- $row_line = $row_line . "<tr><td><p><strong>$test_counter</strong></p></td>\n" .
- "<td><p><strong>$tag_value[1]</strong></p></td>\n" .
- "<td><p><pre><strong>";
- $get_proper_time = localtime ($stime_value[1]);
- $row_line = $row_line . "$get_proper_time" . "</strong></pre></p></td>\n";
- $test_counter++;
- }
- if ( $flag == 3) { #Assuming we will find "cmdling" value here
- @variable_value_pair = split(/=/, $line);
- $row_line = $row_line . "<td><p><strong> $variable_value_pair[1] </strong></p></td>\n";
- }
- if ( $flag == 4) { #Assuming we will find "contact" value here
- @variable_value_pair = split(/=/, $line);
- $row_line = $row_line . "<td><p><strong>$variable_value_pair[1]</strong></p></td>\n";
- }
- if ( $flag == 5) { #Assuming we will find "analysis" value here
- @variable_value_pair = split(/=/, $line);
- $row_line = $row_line . "<td><p><strong>$variable_value_pair[1]</strong></p></td>\n";
- }
- if ( $flag3 == 1 ) {
- if ( $flag4 == 1 ) {
- @variable_value_pair = split(/=/, $line);
- $row_line = $row_line . "<td><p><strong>$variable_value_pair[1]</strong></p></td>\n";
- }
- if ( $flag4 == 2 ) {
- @variable_value_pair = split(/\ /, $line);
- @duration_value = split(/=/, $variable_value_pair[0]);
- @termination_type_value = split(/=/, $variable_value_pair[1]);
- @termination_id_value = split(/=/, $variable_value_pair[2]);
- @corefile_value = split(/=/, $variable_value_pair[3]);
- $background_colour = get_background_colour_column();
- $row_line = $row_line . "<td><p><strong>$duration_value[1]</strong></p></td>\n" .
- "<td><p><strong>$termination_type_value[1]<strong></p></td>\n" .
- "<td><p><strong>$termination_id_value[1]</strong></p></td>\n" .
- "<td><p><strong>$corefile_value[1]</strong></p></td>\n";
- $row_line =~ s/<tr>/<tr\ bgcolor=$background_colour>/;
- $flag4++;
- }
- if ( $flag4 == 3 ) {
- @variable_value_pair = split(/\ /, $line);
- @cutime_value = split(/=/, $variable_value_pair[0]);
- @cstime_value = split(/=/, $variable_value_pair[1]);
- $row_line = $row_line . "<td><p><strong>$cutime_value[1]</strong></p></td>\n" .
- "<td><p><strong>$cstime_value[1]</strong></p></td></tr>\n";
- }
- }
- if ( $line =~ /$execution_tag/ ) {
- $flag2 = 0;
- $flag3 = 1;
- $flag4 = 1;
- $flag5 = 1;
- $row_line = $row_line . "</strong></pre></td>";
- }
- if ( $flag2 == 1 ) {
- $row_line = $row_line . "$line \n";
- }
- if ( $flag5 == 1 ) {
- if ($line =~ "termination_id=1" ) {
- $detected_fail = 1;
- $failed_test_counter++;
- $flag4 = 2;
- } elsif ($line =~ "termination_id=2" ) {
- $detected_brok = 1;
- $brok_test_counter++;
- $flag4 = 2;
- } elsif ($line =~ "termination_id=4" ) {
- $detected_warn = 1;
- $warn_test_counter++;
- $flag4 = 2;
- } elsif ($line =~ "termination_id=32" ) {
- $detected_conf = 1;
- $conf_test_counter++;
- $flag4 = 2;
- } elsif ($line =~ "termination_id=0" ) {
- $detected_pass = 1;
- $test_passed++;
- $flag4 = 2;
- }
- }
- if ( $line =~ /$output_tag/ ) {
- $flag2 = 1;
- $row_line = $row_line . "<td><pre><strong>";
- }
- $flag++;
- }
- }
- close (FILE);
-}
-
-print "</tbody></table></div> \n\n<h2 id=\"_2\">Summary Report</h2>\n\n<div>\n\n<table border=\"1\" cellspacing=\"3\"><tbody>\n<tr>\n<td ";
-if ($ENV{LTP_EXIT_VALUE} == 1 ) {
- print "bgcolor=\"#ff0000\"> <strong>Test Summary</strong></p></td><td bgcolor=\"#ff0000\"><strong>Pan reported some Tests FAIL</strong></p></td></tr>\n";
-}
-else {
- print "bgcolor=\"#66ff66\"> <strong>Test Summary</strong></p></td><td bgcolor=\"#66ff66\"><strong>Pan reported all Test Pass</strong></p></td></tr>\n";
-}
-
-print "<tr><td><strong>LTP Version</strong> </td><td><strong> $ENV{LTP_VERSION} </strong></td></tr>\n";
-print "<tr><td><strong>Start Time</strong> </td><td><strong> $ENV{TEST_START_TIME} </strong></td></tr>\n";
-print "<tr><td><strong>End Time</strong> </td><td><strong> $ENV{TEST_END_TIME} </strong></td></tr>\n";
-print "<tr><td><strong>Log Result</strong> </td><td><a href=\"file://$ENV{TEST_LOGS_DIRECTORY}/\"> <strong>$ENV{TEST_LOGS_DIRECTORY}</strong></a></td></tr>\n";
-print "<tr><td><strong>Output/Failed Result</strong></td><td><a href=\"file://$ENV{TEST_OUTPUT_DIRECTORY}/\"> <strong>$ENV{TEST_OUTPUT_DIRECTORY}</strong></a></td></tr>\n";
-print "<tr><td><strong>Total Tests</strong></td><td><strong>";
-$test_counter--;
-print "$test_counter </strong></td></tr>\n";
-$test_passed=$test_counter-$failed_test_counter-$brok_test_counter-$warn_test_counter-$retr_test_counter-$conf_test_counter;
-print "<tr><td><strong>Total Test TPASS:</strong></td><td><strong> $test_passed </strong></td></tr>\n";
-print "<tr><td><strong>Total Test TFAIL:</strong></td><td><strong> $failed_test_counter </strong></td></tr>\n";
-print "<tr><td><strong>Total Test TBROK</strong></td><td><strong> $brok_test_counter </strong></td></tr>\n";
-print "<tr><td><strong>Total Test TWARN</strong></td><td><strong> $warn_test_counter </strong></td></tr>\n";
-print "<tr><td><strong>Total Test TCONF</strong></td><td><strong> $conf_test_counter </strong></td></tr>\n";
-print "<tr><td><strong>Kernel Version</strong></td><td><strong> $ENV{KERNEL_VERSION} </strong></td></tr>\n";
-print "<tr><td><strong>Machine Architecture</strong></td><td><strong> $ENV{MACHINE_ARCH} </strong></td></tr>\n";
-print "<tr><td><strong>Hostname</strong> </td> <td><strong>";
-$hostname=system("uname -n"); chop($hostname);
-print " $hostname </strong></td></tr></tbody></table></div></body></html>\n";
diff --git a/tools/genload/.gitignore b/tools/genload/.gitignore
deleted file mode 100644
index b89b36741b..0000000000
--- a/tools/genload/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-genload
-stress
diff --git a/tools/genload/Makefile b/tools/genload/Makefile
deleted file mode 100644
index 8bf4d27558..0000000000
--- a/tools/genload/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# tools/genload Makefile.
-#
-# Copyright (C) 2009, Cisco Systems Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir ?= ../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-CFLAGS += -DPACKAGE=\"stress\" -DVERSION=\"0.17pre11\"
-
-LDLIBS += -lm
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/tools/genload/README b/tools/genload/README
deleted file mode 100644
index 7ea37f6634..0000000000
--- a/tools/genload/README
+++ /dev/null
@@ -1,72 +0,0 @@
-USAGE
-
-See the program's usage statement by invoking with --help.
-
-NOTES
-
-This program works really well for me, but it might not have some of the
-features that you want. If you would like, please extend the code and send
-me the patch[1]. Enjoy the program :-)
-
-Please use the context diff format. That is: save the original program
-as stress.c.orig, then make and test your desired changes to stress.c, then
-run 'diff -u stress.c.orig stress.c' to produce a context patch. Thanks.
-
-Amos Waterland <apw@rossby.metr.ou.edu>
-Norman, Oklahoma
-27 Nov 2001
-
-EXAMPLES
-[examples]
-
-The simple case is that you just want to bring the system load average up to
-an arbitrary value. The following forks 13 processes, each of which spins
-in a tight loop calculating the sqrt() of a random number acquired with
-rand().
-
- % stress -c 13
-
-Long options are supported, as well as is making the output less verbose.
-The following forks 1024 processes, and only reports error messages if any.
-
- % stress --quiet --hogcpu 1k
-
-To see how your system performs when it is I/O bound, use the -i switch.
-The following forks 4 processes, each of which spins in a tight loop calling
-sync(), which is a system call that flushes memory buffers to disk.
-
- % stress -i 4
-
-Multiple hogs may be combined on the same command line. The following does
-everything the preceding examples did in one command, but also turns up the
-verbosity level as well as showing how to cause the command to
-self-terminate after 1 minute.
-
- % stress -c 13 -i 4 --verbose --timeout 1m
-
-An value of 0 normally denotes infinity. The following is how to do a fork
-bomb (be careful with this).
-
- % stress -c 0
-
-For the -m and -d options, a value of 0 means to redo their operation an
-infinite number of times. To allocate and free 128MB in a redo loop use the
-following command. This can be useful for "bouncing" against the system RAM
-ceiling.
-
- % stress -m 0 --hogvm-bytes 128M
-
-For the -m and -d options, a negative value of n means to redo the operation
-abs(n) times. Here is now to allocate and free 5MB three times in a row.
-
- % stress -m -3 --hogvm-bytes 5m
-
-You can write a file of arbitrary length to disk. The file is created with
-mkstemp() in the current directory, the default is to unlink it, but
-unlinking can be overridden with the --hoghdd-noclean flag.
-
- % stress -d 1 --hoghdd-noclean --hoghdd-bytes 13
-
-Large file support is enabled.
-
- % stress -d 1 --hoghdd-noclean --hoghdd-bytes 3G
diff --git a/tools/genload/genload.c b/tools/genload/genload.c
deleted file mode 100644
index a19d519fd6..0000000000
--- a/tools/genload/genload.c
+++ /dev/null
@@ -1,898 +0,0 @@
-/* A program to put stress on a POSIX system (stress).
- *
- * Copyright (C) 2001, 2002 Amos Waterland <awaterl@yahoo.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <ctype.h>
-#include <errno.h>
-#include <libgen.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <time.h>
-#include <unistd.h>
-#include <sys/wait.h>
-
-/* By default, print all messages of severity info and above. */
-static int global_debug = 2;
-
-/* By default, just print warning for non-critical errors. */
-static int global_ignore = 1;
-
-/* By default, retry on non-critical errors every 50ms. */
-static int global_retry = 50000;
-
-/* By default, use this as backoff coefficient for good fork throughput. */
-static int global_backoff = 3000;
-
-/* By default, do not timeout. */
-static int global_timeout = 0;
-
-/* Name of this program */
-static char *global_progname = PACKAGE;
-
-/* By default, do not hang after allocating memory. */
-static int global_vmhang = 0;
-
-/* Implemention of runtime-selectable severity message printing. */
-#define dbg if (global_debug >= 3) \
- fprintf (stdout, "%s: debug: (%d) ", global_progname, __LINE__), \
- fprintf
-#define out if (global_debug >= 2) \
- fprintf (stdout, "%s: info: ", global_progname), \
- fprintf
-#define wrn if (global_debug >= 1) \
- fprintf (stderr, "%s: warn: (%d) ", global_progname, __LINE__), \
- fprintf
-#define err if (global_debug >= 0) \
- fprintf (stderr, "%s: error: (%d) ", global_progname, __LINE__), \
- fprintf
-
-/* Implementation of check for option argument correctness. */
-#define assert_arg(A) \
- if (++i == argc || ((arg = argv[i])[0] == '-' && \
- !isdigit ((int)arg[1]) )) \
- { \
- err (stderr, "missing argument to option '%s'\n", A); \
- exit (1); \
- }
-
-/* Prototypes for utility functions. */
-int usage(int status);
-int version(int status);
-long long atoll_s(const char *nptr);
-long long atoll_b(const char *nptr);
-
-/* Prototypes for the worker functions. */
-int hogcpu(long long forks);
-int hogio(long long forks);
-int hogvm(long long forks, long long chunks, long long bytes);
-int hoghdd(long long forks, int clean, long long files, long long bytes);
-
-int main(int argc, char **argv)
-{
- int i, pid, children = 0, retval = 0;
- long starttime, stoptime, runtime;
-
- /* Variables that indicate which options have been selected. */
- int do_dryrun = 0;
- int do_timeout = 0;
- int do_cpu = 0; /* Default to 1 fork. */
- long long do_cpu_forks = 1;
- int do_io = 0; /* Default to 1 fork. */
- long long do_io_forks = 1;
- int do_vm = 0; /* Default to 1 fork, 1 chunk of 256MB. */
- long long do_vm_forks = 1;
- long long do_vm_chunks = 1;
- long long do_vm_bytes = 256 * 1024 * 1024;
- int do_hdd = 0; /* Default to 1 fork, clean, 1 file of 1GB. */
- long long do_hdd_forks = 1;
- int do_hdd_clean = 0;
- long long do_hdd_files = 1;
- long long do_hdd_bytes = 1024 * 1024 * 1024;
-
- /* Record our start time. */
- if ((starttime = time(NULL)) == -1) {
- err(stderr, "failed to acquire current time\n");
- exit(1);
- }
-
- /* SuSv3 does not define any error conditions for this function. */
- global_progname = basename(argv[0]);
-
- /* For portability, parse command line options without getopt_long. */
- for (i = 1; i < argc; i++) {
- char *arg = argv[i];
-
- if (strcmp(arg, "--help") == 0 || strcmp(arg, "-?") == 0) {
- usage(0);
- } else if (strcmp(arg, "--version") == 0) {
- version(0);
- } else if (strcmp(arg, "--verbose") == 0
- || strcmp(arg, "-v") == 0) {
- global_debug = 3;
- } else if (strcmp(arg, "--quiet") == 0
- || strcmp(arg, "-q") == 0) {
- global_debug = 0;
- } else if (strcmp(arg, "--dry-run") == 0
- || strcmp(arg, "-n") == 0) {
- do_dryrun = 1;
- } else if (strcmp(arg, "--no-retry") == 0) {
- global_ignore = 0;
- dbg(stdout,
- "turning off ignore of non-critical errors");
- } else if (strcmp(arg, "--retry-delay") == 0) {
- assert_arg("--retry-delay");
- global_retry = atoll(arg);
- dbg(stdout, "setting retry delay to %dus\n",
- global_retry);
- } else if (strcmp(arg, "--backoff") == 0) {
- assert_arg("--backoff");
- global_backoff = atoll(arg);
- if (global_backoff < 0) {
- err(stderr, "invalid backoff factor: %i\n",
- global_backoff);
- exit(1);
- }
- dbg(stdout, "setting backoff coeffient to %dus\n",
- global_backoff);
- } else if (strcmp(arg, "--timeout") == 0
- || strcmp(arg, "-t") == 0) {
- do_timeout = 1;
- assert_arg("--timeout");
- global_timeout = atoll_s(arg);
- dbg(stdout, "setting timeout to %ds\n", global_timeout);
- } else if (strcmp(arg, "--cpu") == 0 || strcmp(arg, "-c") == 0) {
- do_cpu = 1;
- assert_arg("--cpu");
- do_cpu_forks = atoll_b(arg);
- } else if (strcmp(arg, "--io") == 0 || strcmp(arg, "-i") == 0) {
- do_io = 1;
- assert_arg("--io");
- do_io_forks = atoll_b(arg);
- } else if (strcmp(arg, "--vm") == 0 || strcmp(arg, "-m") == 0) {
- do_vm = 1;
- assert_arg("--vm");
- do_vm_forks = atoll_b(arg);
- } else if (strcmp(arg, "--vm-chunks") == 0) {
- assert_arg("--vm-chunks");
- do_vm_chunks = atoll_b(arg);
- } else if (strcmp(arg, "--vm-bytes") == 0) {
- assert_arg("--vm-bytes");
- do_vm_bytes = atoll_b(arg);
- } else if (strcmp(arg, "--vm-hang") == 0) {
- global_vmhang = 1;
- } else if (strcmp(arg, "--hdd") == 0 || strcmp(arg, "-d") == 0) {
- do_hdd = 1;
- assert_arg("--hdd");
- do_hdd_forks = atoll_b(arg);
- } else if (strcmp(arg, "--hdd-noclean") == 0) {
- do_hdd_clean = 2;
- } else if (strcmp(arg, "--hdd-files") == 0) {
- assert_arg("--hdd-files");
- do_hdd_files = atoll_b(arg);
- } else if (strcmp(arg, "--hdd-bytes") == 0) {
- assert_arg("--hdd-bytes");
- do_hdd_bytes = atoll_b(arg);
- } else {
- err(stderr, "unrecognized option: %s\n", arg);
- exit(1);
- }
- }
-
- /* Hog CPU option. */
- if (do_cpu) {
- out(stdout, "dispatching %lli hogcpu forks\n", do_cpu_forks);
-
- switch (pid = fork()) {
- case 0: /* child */
- if (do_dryrun)
- exit(0);
- exit(hogcpu(do_cpu_forks));
- case -1: /* error */
- err(stderr, "hogcpu dispatcher fork failed\n");
- exit(1);
- default: /* parent */
- children++;
- dbg(stdout, "--> hogcpu dispatcher forked (%i)\n", pid);
- }
- }
-
- /* Hog I/O option. */
- if (do_io) {
- out(stdout, "dispatching %lli hogio forks\n", do_io_forks);
-
- switch (pid = fork()) {
- case 0: /* child */
- if (do_dryrun)
- exit(0);
- exit(hogio(do_io_forks));
- case -1: /* error */
- err(stderr, "hogio dispatcher fork failed\n");
- exit(1);
- default: /* parent */
- children++;
- dbg(stdout, "--> hogio dispatcher forked (%i)\n", pid);
- }
- }
-
- /* Hog VM option. */
- if (do_vm) {
- out(stdout,
- "dispatching %lli hogvm forks, each %lli chunks of %lli bytes\n",
- do_vm_forks, do_vm_chunks, do_vm_bytes);
-
- switch (pid = fork()) {
- case 0: /* child */
- if (do_dryrun)
- exit(0);
- exit(hogvm(do_vm_forks, do_vm_chunks, do_vm_bytes));
- case -1: /* error */
- err(stderr, "hogvm dispatcher fork failed\n");
- exit(1);
- default: /* parent */
- children++;
- dbg(stdout, "--> hogvm dispatcher forked (%i)\n", pid);
- }
- }
-
- /* Hog HDD option. */
- if (do_hdd) {
- out(stdout, "dispatching %lli hoghdd forks, each %lli files of "
- "%lli bytes\n", do_hdd_forks, do_hdd_files, do_hdd_bytes);
-
- switch (pid = fork()) {
- case 0: /* child */
- if (do_dryrun)
- exit(0);
- exit(hoghdd
- (do_hdd_forks, do_hdd_clean, do_hdd_files,
- do_hdd_bytes));
- case -1: /* error */
- err(stderr, "hoghdd dispatcher fork failed\n");
- exit(1);
- default: /* parent */
- children++;
- dbg(stdout, "--> hoghdd dispatcher forked (%i)\n", pid);
- }
- }
-
- /* We have no work to do, so bail out. */
- if (children == 0)
- usage(0);
-
- /* Wait for our children to exit. */
- while (children) {
- int status, ret;
-
- if ((pid = wait(&status)) > 0) {
- if ((WIFEXITED(status)) != 0) {
- if ((ret = WEXITSTATUS(status)) != 0) {
- err(stderr,
- "dispatcher %i returned error %i\n",
- pid, ret);
- retval += ret;
- } else {
- dbg(stdout,
- "<-- dispatcher return (%i)\n",
- pid);
- }
- } else {
- err(stderr,
- "dispatcher did not exit normally\n");
- ++retval;
- }
-
- --children;
- } else {
- dbg(stdout, "wait() returned error: %s\n",
- strerror(errno));
- err(stderr, "detected missing dispatcher children\n");
- ++retval;
- break;
- }
- }
-
- /* Record our stop time. */
- if ((stoptime = time(NULL)) == -1) {
- err(stderr, "failed to acquire current time\n");
- exit(1);
- }
-
- /* Calculate our runtime. */
- runtime = stoptime - starttime;
-
- /* Print final status message. */
- if (retval) {
- err(stderr, "failed run completed in %lis\n", runtime);
- } else {
- out(stdout, "successful run completed in %lis\n", runtime);
- }
-
- exit(retval);
-}
-
-int usage(int status)
-{
- char *mesg =
- "`%s' imposes certain types of compute stress on your system\n\n"
- "Usage: %s [OPTION [ARG]] ...\n\n"
- " -?, --help show this help statement\n"
- " --version show version statement\n"
- " -v, --verbose be verbose\n"
- " -q, --quiet be quiet\n"
- " -n, --dry-run show what would have been done\n"
- " --no-retry exit rather than retry non-critical errors\n"
- " --retry-delay n wait n us before continuing past error\n"
- " -t, --timeout n timeout after n seconds\n"
- " --backoff n wait for factor of n us before starting work\n"
- " -c, --cpu n spawn n procs spinning on sqrt()\n"
- " -i, --io n spawn n procs spinning on sync()\n"
- " -m, --vm n spawn n procs spinning on malloc()\n"
- " --vm-chunks c malloc c chunks (default is 1)\n"
- " --vm-bytes b malloc chunks of b bytes (default is 256MB)\n"
- " --vm-hang hang in a sleep loop after memory allocated\n"
- " -d, --hdd n spawn n procs spinning on write()\n"
- " --hdd-noclean do not unlink file to which random data written\n"
- " --hdd-files f write to f files (default is 1)\n"
- " --hdd-bytes b write b bytes (default is 1GB)\n\n"
- "Infinity is denoted with 0. For -m, -d: n=0 means infinite redo,\n"
- "n<0 means redo abs(n) times. Valid suffixes are m,h,d,y for time;\n"
- "k,m,g for size.\n\n";
-
- fprintf(stdout, mesg, global_progname, global_progname);
-
- if (status <= 0)
- exit(-1 * status);
-
- return 0;
-}
-
-int version(int status)
-{
- char *mesg = "%s %s\n";
-
- fprintf(stdout, mesg, global_progname, VERSION);
-
- if (status <= 0)
- exit(-1 * status);
-
- return 0;
-}
-
-/* Convert a string representation of a number with an optional size suffix
- * to a long long.
- */
-long long atoll_b(const char *nptr)
-{
- int pos;
- char suffix;
- long long factor = 1;
-
- if ((pos = strlen(nptr) - 1) < 0) {
- err(stderr, "invalid string\n");
- exit(1);
- }
-
- switch (suffix = nptr[pos]) {
- case 'k':
- case 'K':
- factor = 1024;
- break;
- case 'm':
- case 'M':
- factor = 1024 * 1024;
- break;
- case 'g':
- case 'G':
- factor = 1024 * 1024 * 1024;
- break;
- default:
- if (suffix < '0' || suffix > '9') {
- err(stderr, "unrecognized suffix: %c\n", suffix);
- exit(1);
- }
- }
-
- factor = atoll(nptr) * factor;
-
- return factor;
-}
-
-/* Convert a string representation of a number with an optional time suffix
- * to a long long.
- */
-long long atoll_s(const char *nptr)
-{
- int pos;
- char suffix;
- long long factor = 1;
-
- if ((pos = strlen(nptr) - 1) < 0) {
- err(stderr, "invalid string\n");
- exit(1);
- }
-
- switch (suffix = nptr[pos]) {
- case 's':
- case 'S':
- factor = 1;
- break;
- case 'm':
- case 'M':
- factor = 60;
- break;
- case 'h':
- case 'H':
- factor = 60 * 60;
- break;
- case 'd':
- case 'D':
- factor = 60 * 60 * 24;
- break;
- case 'y':
- case 'Y':
- factor = 60 * 60 * 24 * 360;
- break;
- default:
- if (suffix < '0' || suffix > '9') {
- err(stderr, "unrecognized suffix: %c\n", suffix);
- exit(1);
- }
- }
-
- factor = atoll(nptr) * factor;
-
- return factor;
-}
-
-int hogcpu(long long forks)
-{
- long long i;
- double d;
- int pid, retval = 0;
-
- /* Make local copies of global variables. */
- int ignore = global_ignore;
- int retry = global_retry;
- int timeout = global_timeout;
- long backoff = global_backoff * forks;
-
- dbg(stdout, "using backoff sleep of %lius for hogcpu\n", backoff);
-
- for (i = 0; forks == 0 || i < forks; i++) {
- switch (pid = fork()) {
- case 0: /* child */
- alarm(timeout);
-
- /* Use a backoff sleep to ensure we get good fork throughput. */
- usleep(backoff);
-
- while (1)
- d = sqrt(rand());
-
- /* This case never falls through; alarm signal can cause exit. */
- case -1: /* error */
- if (ignore) {
- ++retval;
- wrn(stderr,
- "hogcpu worker fork failed, continuing\n");
- usleep(retry);
- continue;
- }
-
- err(stderr, "hogcpu worker fork failed\n");
- return 1;
- default: /* parent */
- dbg(stdout, "--> hogcpu worker forked (%i)\n", pid);
- }
- }
-
- /* Wait for our children to exit. */
- while (i) {
- int status, ret;
-
- if ((pid = wait(&status)) > 0) {
- if ((WIFEXITED(status)) != 0) {
- if ((ret = WEXITSTATUS(status)) != 0) {
- err(stderr,
- "hogcpu worker %i exited %i\n", pid,
- ret);
- retval += ret;
- } else {
- dbg(stdout,
- "<-- hogcpu worker exited (%i)\n",
- pid);
- }
- } else {
- dbg(stdout,
- "<-- hogcpu worker signalled (%i)\n", pid);
- }
-
- --i;
- } else {
- dbg(stdout, "wait() returned error: %s\n",
- strerror(errno));
- err(stderr,
- "detected missing hogcpu worker children\n");
- ++retval;
- break;
- }
- }
-
- return retval;
-}
-
-int hogio(long long forks)
-{
- long long i;
- int pid, retval = 0;
-
- /* Make local copies of global variables. */
- int ignore = global_ignore;
- int retry = global_retry;
- int timeout = global_timeout;
- long backoff = global_backoff * forks;
-
- dbg(stdout, "using backoff sleep of %lius for hogio\n", backoff);
-
- for (i = 0; forks == 0 || i < forks; i++) {
- switch (pid = fork()) {
- case 0: /* child */
- alarm(timeout);
-
- /* Use a backoff sleep to ensure we get good fork throughput. */
- usleep(backoff);
-
- while (1)
- sync();
-
- /* This case never falls through; alarm signal can cause exit. */
- case -1: /* error */
- if (ignore) {
- ++retval;
- wrn(stderr,
- "hogio worker fork failed, continuing\n");
- usleep(retry);
- continue;
- }
-
- err(stderr, "hogio worker fork failed\n");
- return 1;
- default: /* parent */
- dbg(stdout, "--> hogio worker forked (%i)\n", pid);
- }
- }
-
- /* Wait for our children to exit. */
- while (i) {
- int status, ret;
-
- if ((pid = wait(&status)) > 0) {
- if ((WIFEXITED(status)) != 0) {
- if ((ret = WEXITSTATUS(status)) != 0) {
- err(stderr,
- "hogio worker %i exited %i\n", pid,
- ret);
- retval += ret;
- } else {
- dbg(stdout,
- "<-- hogio worker exited (%i)\n",
- pid);
- }
- } else {
- dbg(stdout, "<-- hogio worker signalled (%i)\n",
- pid);
- }
-
- --i;
- } else {
- dbg(stdout, "wait() returned error: %s\n",
- strerror(errno));
- err(stderr, "detected missing hogio worker children\n");
- ++retval;
- break;
- }
- }
-
- return retval;
-}
-
-int hogvm(long long forks, long long chunks, long long bytes)
-{
- long long i, j, k;
- int pid, retval = 0;
- char **ptr;
-
- /* Make local copies of global variables. */
- int ignore = global_ignore;
- int retry = global_retry;
- int timeout = global_timeout;
- long backoff = global_backoff * forks;
-
- dbg(stdout, "using backoff sleep of %lius for hogvm\n", backoff);
-
- if (bytes == 0) {
- /* 512MB is guess at the largest value can than be malloced at once. */
- bytes = 512 * 1024 * 1024;
- }
-
- for (i = 0; forks == 0 || i < forks; i++) {
- switch (pid = fork()) {
- case 0: /* child */
- alarm(timeout);
-
- /* Use a backoff sleep to ensure we get good fork throughput. */
- usleep(backoff);
-
- /* If chunks is 0, ptr will allocate 0 bytes's
- * memory, it will cause the process to crash
- * during runtime, so adjust to 1 */
- if (chunks == 0)
- chunks = 1;
-
- while (1) {
- ptr = (char **)malloc(chunks *
- sizeof(char *));
- for (j = 0; j < chunks; j++) {
- if ((ptr[j] =
- (char *)malloc(bytes *
- sizeof(char)))) {
- for (k = 0; k < bytes; k++)
- ptr[j][k] = 'Z'; /* Ensure that COW happens. */
- dbg(stdout,
- "hogvm worker malloced %lli bytes\n",
- k);
- } else if (ignore) {
- ++retval;
- wrn(stderr,
- "hogvm malloc failed, continuing\n");
- usleep(retry);
- continue;
- } else {
- ++retval;
- err(stderr,
- "hogvm malloc failed\n");
- break;
- }
- }
- if (global_vmhang && retval == 0) {
- dbg(stdout,
- "sleeping forever with allocated memory\n");
- while (1)
- sleep(1024);
- }
- if (retval == 0) {
- dbg(stdout,
- "hogvm worker freeing memory and starting over\n");
- for (j = 0; j < chunks; j++)
- free(ptr[j]);
- free(ptr);
- continue;
- }
-
- exit(retval);
- }
-
- /* This case never falls through; alarm signal can cause exit. */
- case -1: /* error */
- if (ignore) {
- ++retval;
- wrn(stderr,
- "hogvm worker fork failed, continuing\n");
- usleep(retry);
- continue;
- }
-
- err(stderr, "hogvm worker fork failed\n");
- return 1;
- default: /* parent */
- dbg(stdout, "--> hogvm worker forked (%i)\n", pid);
- }
- }
-
- /* Wait for our children to exit. */
- while (i) {
- int status, ret;
-
- if ((pid = wait(&status)) > 0) {
- if ((WIFEXITED(status)) != 0) {
- if ((ret = WEXITSTATUS(status)) != 0) {
- err(stderr,
- "hogvm worker %i exited %i\n", pid,
- ret);
- retval += ret;
- } else {
- dbg(stdout,
- "<-- hogvm worker exited (%i)\n",
- pid);
- }
- } else {
- dbg(stdout, "<-- hogvm worker signalled (%i)\n",
- pid);
- }
-
- --i;
- } else {
- dbg(stdout, "wait() returned error: %s\n",
- strerror(errno));
- err(stderr, "detected missing hogvm worker children\n");
- ++retval;
- break;
- }
- }
-
- return retval;
-}
-
-int hoghdd(long long forks, int clean, long long files, long long bytes)
-{
- long long i, j;
- int fd, pid, retval = 0;
- int chunk = (1024 * 1024) - 1; /* Minimize slow writing. */
- char buff[chunk];
-
- /* Make local copies of global variables. */
- int ignore = global_ignore;
- int retry = global_retry;
- int timeout = global_timeout;
- long backoff = global_backoff * forks;
-
- /* Initialize buffer with some random ASCII data. */
- dbg(stdout, "seeding buffer with random data\n");
- for (i = 0; i < chunk - 1; i++) {
- j = rand();
- j = (j < 0) ? -j : j;
- j %= 95;
- j += 32;
- buff[i] = j;
- }
- buff[i] = '\n';
-
- dbg(stdout, "using backoff sleep of %lius for hoghdd\n", backoff);
-
- for (i = 0; forks == 0 || i < forks; i++) {
- switch (pid = fork()) {
- case 0: /* child */
- alarm(timeout);
-
- /* Use a backoff sleep to ensure we get good fork throughput. */
- usleep(backoff);
-
- while (1) {
- for (i = 0; i < files; i++) {
- char name[] = "./stress.XXXXXX";
-
- if ((fd = mkstemp(name)) < 0) {
- perror("mkstemp");
- err(stderr, "mkstemp failed\n");
- exit(1);
- }
-
- if (clean == 0) {
- dbg(stdout, "unlinking %s\n",
- name);
- if (unlink(name)) {
- err(stderr,
- "unlink failed\n");
- exit(1);
- }
- }
-
- dbg(stdout, "fast writing to %s\n",
- name);
- for (j = 0;
- bytes == 0 || j + chunk < bytes;
- j += chunk) {
- if (write(fd, buff, chunk) !=
- chunk) {
- err(stderr,
- "write failed\n");
- exit(1);
- }
- }
-
- dbg(stdout, "slow writing to %s\n",
- name);
- for (; bytes == 0 || j < bytes - 1; j++) {
- if (write(fd, "Z", 1) != 1) {
- err(stderr,
- "write failed\n");
- exit(1);
- }
- }
- if (write(fd, "\n", 1) != 1) {
- err(stderr, "write failed\n");
- exit(1);
- }
- ++j;
-
- dbg(stdout,
- "closing %s after writing %lli bytes\n",
- name, j);
- close(fd);
-
- if (clean == 1) {
- if (unlink(name)) {
- err(stderr,
- "unlink failed\n");
- exit(1);
- }
- }
- }
- if (retval == 0) {
- dbg(stdout,
- "hoghdd worker starting over\n");
- continue;
- }
-
- exit(retval);
- }
-
- /* This case never falls through; alarm signal can cause exit. */
- case -1: /* error */
- if (ignore) {
- ++retval;
- wrn(stderr,
- "hoghdd worker fork failed, continuing\n");
- usleep(retry);
- continue;
- }
-
- err(stderr, "hoghdd worker fork failed\n");
- return 1;
- default: /* parent */
- dbg(stdout, "--> hoghdd worker forked (%i)\n", pid);
- }
- }
-
- /* Wait for our children to exit. */
- while (i) {
- int status, ret;
-
- if ((pid = wait(&status)) > 0) {
- if ((WIFEXITED(status)) != 0) {
- if ((ret = WEXITSTATUS(status)) != 0) {
- err(stderr,
- "hoghdd worker %i exited %i\n", pid,
- ret);
- retval += ret;
- } else {
- dbg(stdout,
- "<-- hoghdd worker exited (%i)\n",
- pid);
- }
- } else {
- dbg(stdout,
- "<-- hoghdd worker signalled (%i)\n", pid);
- }
-
- --i;
- } else {
- dbg(stdout, "wait() returned error: %s\n",
- strerror(errno));
- err(stderr,
- "detected missing hoghdd worker children\n");
- ++retval;
- break;
- }
- }
-
- return retval;
-}
diff --git a/tools/genload/stress.c b/tools/genload/stress.c
deleted file mode 100644
index a19d519fd6..0000000000
--- a/tools/genload/stress.c
+++ /dev/null
@@ -1,898 +0,0 @@
-/* A program to put stress on a POSIX system (stress).
- *
- * Copyright (C) 2001, 2002 Amos Waterland <awaterl@yahoo.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <ctype.h>
-#include <errno.h>
-#include <libgen.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <time.h>
-#include <unistd.h>
-#include <sys/wait.h>
-
-/* By default, print all messages of severity info and above. */
-static int global_debug = 2;
-
-/* By default, just print warning for non-critical errors. */
-static int global_ignore = 1;
-
-/* By default, retry on non-critical errors every 50ms. */
-static int global_retry = 50000;
-
-/* By default, use this as backoff coefficient for good fork throughput. */
-static int global_backoff = 3000;
-
-/* By default, do not timeout. */
-static int global_timeout = 0;
-
-/* Name of this program */
-static char *global_progname = PACKAGE;
-
-/* By default, do not hang after allocating memory. */
-static int global_vmhang = 0;
-
-/* Implemention of runtime-selectable severity message printing. */
-#define dbg if (global_debug >= 3) \
- fprintf (stdout, "%s: debug: (%d) ", global_progname, __LINE__), \
- fprintf
-#define out if (global_debug >= 2) \
- fprintf (stdout, "%s: info: ", global_progname), \
- fprintf
-#define wrn if (global_debug >= 1) \
- fprintf (stderr, "%s: warn: (%d) ", global_progname, __LINE__), \
- fprintf
-#define err if (global_debug >= 0) \
- fprintf (stderr, "%s: error: (%d) ", global_progname, __LINE__), \
- fprintf
-
-/* Implementation of check for option argument correctness. */
-#define assert_arg(A) \
- if (++i == argc || ((arg = argv[i])[0] == '-' && \
- !isdigit ((int)arg[1]) )) \
- { \
- err (stderr, "missing argument to option '%s'\n", A); \
- exit (1); \
- }
-
-/* Prototypes for utility functions. */
-int usage(int status);
-int version(int status);
-long long atoll_s(const char *nptr);
-long long atoll_b(const char *nptr);
-
-/* Prototypes for the worker functions. */
-int hogcpu(long long forks);
-int hogio(long long forks);
-int hogvm(long long forks, long long chunks, long long bytes);
-int hoghdd(long long forks, int clean, long long files, long long bytes);
-
-int main(int argc, char **argv)
-{
- int i, pid, children = 0, retval = 0;
- long starttime, stoptime, runtime;
-
- /* Variables that indicate which options have been selected. */
- int do_dryrun = 0;
- int do_timeout = 0;
- int do_cpu = 0; /* Default to 1 fork. */
- long long do_cpu_forks = 1;
- int do_io = 0; /* Default to 1 fork. */
- long long do_io_forks = 1;
- int do_vm = 0; /* Default to 1 fork, 1 chunk of 256MB. */
- long long do_vm_forks = 1;
- long long do_vm_chunks = 1;
- long long do_vm_bytes = 256 * 1024 * 1024;
- int do_hdd = 0; /* Default to 1 fork, clean, 1 file of 1GB. */
- long long do_hdd_forks = 1;
- int do_hdd_clean = 0;
- long long do_hdd_files = 1;
- long long do_hdd_bytes = 1024 * 1024 * 1024;
-
- /* Record our start time. */
- if ((starttime = time(NULL)) == -1) {
- err(stderr, "failed to acquire current time\n");
- exit(1);
- }
-
- /* SuSv3 does not define any error conditions for this function. */
- global_progname = basename(argv[0]);
-
- /* For portability, parse command line options without getopt_long. */
- for (i = 1; i < argc; i++) {
- char *arg = argv[i];
-
- if (strcmp(arg, "--help") == 0 || strcmp(arg, "-?") == 0) {
- usage(0);
- } else if (strcmp(arg, "--version") == 0) {
- version(0);
- } else if (strcmp(arg, "--verbose") == 0
- || strcmp(arg, "-v") == 0) {
- global_debug = 3;
- } else if (strcmp(arg, "--quiet") == 0
- || strcmp(arg, "-q") == 0) {
- global_debug = 0;
- } else if (strcmp(arg, "--dry-run") == 0
- || strcmp(arg, "-n") == 0) {
- do_dryrun = 1;
- } else if (strcmp(arg, "--no-retry") == 0) {
- global_ignore = 0;
- dbg(stdout,
- "turning off ignore of non-critical errors");
- } else if (strcmp(arg, "--retry-delay") == 0) {
- assert_arg("--retry-delay");
- global_retry = atoll(arg);
- dbg(stdout, "setting retry delay to %dus\n",
- global_retry);
- } else if (strcmp(arg, "--backoff") == 0) {
- assert_arg("--backoff");
- global_backoff = atoll(arg);
- if (global_backoff < 0) {
- err(stderr, "invalid backoff factor: %i\n",
- global_backoff);
- exit(1);
- }
- dbg(stdout, "setting backoff coeffient to %dus\n",
- global_backoff);
- } else if (strcmp(arg, "--timeout") == 0
- || strcmp(arg, "-t") == 0) {
- do_timeout = 1;
- assert_arg("--timeout");
- global_timeout = atoll_s(arg);
- dbg(stdout, "setting timeout to %ds\n", global_timeout);
- } else if (strcmp(arg, "--cpu") == 0 || strcmp(arg, "-c") == 0) {
- do_cpu = 1;
- assert_arg("--cpu");
- do_cpu_forks = atoll_b(arg);
- } else if (strcmp(arg, "--io") == 0 || strcmp(arg, "-i") == 0) {
- do_io = 1;
- assert_arg("--io");
- do_io_forks = atoll_b(arg);
- } else if (strcmp(arg, "--vm") == 0 || strcmp(arg, "-m") == 0) {
- do_vm = 1;
- assert_arg("--vm");
- do_vm_forks = atoll_b(arg);
- } else if (strcmp(arg, "--vm-chunks") == 0) {
- assert_arg("--vm-chunks");
- do_vm_chunks = atoll_b(arg);
- } else if (strcmp(arg, "--vm-bytes") == 0) {
- assert_arg("--vm-bytes");
- do_vm_bytes = atoll_b(arg);
- } else if (strcmp(arg, "--vm-hang") == 0) {
- global_vmhang = 1;
- } else if (strcmp(arg, "--hdd") == 0 || strcmp(arg, "-d") == 0) {
- do_hdd = 1;
- assert_arg("--hdd");
- do_hdd_forks = atoll_b(arg);
- } else if (strcmp(arg, "--hdd-noclean") == 0) {
- do_hdd_clean = 2;
- } else if (strcmp(arg, "--hdd-files") == 0) {
- assert_arg("--hdd-files");
- do_hdd_files = atoll_b(arg);
- } else if (strcmp(arg, "--hdd-bytes") == 0) {
- assert_arg("--hdd-bytes");
- do_hdd_bytes = atoll_b(arg);
- } else {
- err(stderr, "unrecognized option: %s\n", arg);
- exit(1);
- }
- }
-
- /* Hog CPU option. */
- if (do_cpu) {
- out(stdout, "dispatching %lli hogcpu forks\n", do_cpu_forks);
-
- switch (pid = fork()) {
- case 0: /* child */
- if (do_dryrun)
- exit(0);
- exit(hogcpu(do_cpu_forks));
- case -1: /* error */
- err(stderr, "hogcpu dispatcher fork failed\n");
- exit(1);
- default: /* parent */
- children++;
- dbg(stdout, "--> hogcpu dispatcher forked (%i)\n", pid);
- }
- }
-
- /* Hog I/O option. */
- if (do_io) {
- out(stdout, "dispatching %lli hogio forks\n", do_io_forks);
-
- switch (pid = fork()) {
- case 0: /* child */
- if (do_dryrun)
- exit(0);
- exit(hogio(do_io_forks));
- case -1: /* error */
- err(stderr, "hogio dispatcher fork failed\n");
- exit(1);
- default: /* parent */
- children++;
- dbg(stdout, "--> hogio dispatcher forked (%i)\n", pid);
- }
- }
-
- /* Hog VM option. */
- if (do_vm) {
- out(stdout,
- "dispatching %lli hogvm forks, each %lli chunks of %lli bytes\n",
- do_vm_forks, do_vm_chunks, do_vm_bytes);
-
- switch (pid = fork()) {
- case 0: /* child */
- if (do_dryrun)
- exit(0);
- exit(hogvm(do_vm_forks, do_vm_chunks, do_vm_bytes));
- case -1: /* error */
- err(stderr, "hogvm dispatcher fork failed\n");
- exit(1);
- default: /* parent */
- children++;
- dbg(stdout, "--> hogvm dispatcher forked (%i)\n", pid);
- }
- }
-
- /* Hog HDD option. */
- if (do_hdd) {
- out(stdout, "dispatching %lli hoghdd forks, each %lli files of "
- "%lli bytes\n", do_hdd_forks, do_hdd_files, do_hdd_bytes);
-
- switch (pid = fork()) {
- case 0: /* child */
- if (do_dryrun)
- exit(0);
- exit(hoghdd
- (do_hdd_forks, do_hdd_clean, do_hdd_files,
- do_hdd_bytes));
- case -1: /* error */
- err(stderr, "hoghdd dispatcher fork failed\n");
- exit(1);
- default: /* parent */
- children++;
- dbg(stdout, "--> hoghdd dispatcher forked (%i)\n", pid);
- }
- }
-
- /* We have no work to do, so bail out. */
- if (children == 0)
- usage(0);
-
- /* Wait for our children to exit. */
- while (children) {
- int status, ret;
-
- if ((pid = wait(&status)) > 0) {
- if ((WIFEXITED(status)) != 0) {
- if ((ret = WEXITSTATUS(status)) != 0) {
- err(stderr,
- "dispatcher %i returned error %i\n",
- pid, ret);
- retval += ret;
- } else {
- dbg(stdout,
- "<-- dispatcher return (%i)\n",
- pid);
- }
- } else {
- err(stderr,
- "dispatcher did not exit normally\n");
- ++retval;
- }
-
- --children;
- } else {
- dbg(stdout, "wait() returned error: %s\n",
- strerror(errno));
- err(stderr, "detected missing dispatcher children\n");
- ++retval;
- break;
- }
- }
-
- /* Record our stop time. */
- if ((stoptime = time(NULL)) == -1) {
- err(stderr, "failed to acquire current time\n");
- exit(1);
- }
-
- /* Calculate our runtime. */
- runtime = stoptime - starttime;
-
- /* Print final status message. */
- if (retval) {
- err(stderr, "failed run completed in %lis\n", runtime);
- } else {
- out(stdout, "successful run completed in %lis\n", runtime);
- }
-
- exit(retval);
-}
-
-int usage(int status)
-{
- char *mesg =
- "`%s' imposes certain types of compute stress on your system\n\n"
- "Usage: %s [OPTION [ARG]] ...\n\n"
- " -?, --help show this help statement\n"
- " --version show version statement\n"
- " -v, --verbose be verbose\n"
- " -q, --quiet be quiet\n"
- " -n, --dry-run show what would have been done\n"
- " --no-retry exit rather than retry non-critical errors\n"
- " --retry-delay n wait n us before continuing past error\n"
- " -t, --timeout n timeout after n seconds\n"
- " --backoff n wait for factor of n us before starting work\n"
- " -c, --cpu n spawn n procs spinning on sqrt()\n"
- " -i, --io n spawn n procs spinning on sync()\n"
- " -m, --vm n spawn n procs spinning on malloc()\n"
- " --vm-chunks c malloc c chunks (default is 1)\n"
- " --vm-bytes b malloc chunks of b bytes (default is 256MB)\n"
- " --vm-hang hang in a sleep loop after memory allocated\n"
- " -d, --hdd n spawn n procs spinning on write()\n"
- " --hdd-noclean do not unlink file to which random data written\n"
- " --hdd-files f write to f files (default is 1)\n"
- " --hdd-bytes b write b bytes (default is 1GB)\n\n"
- "Infinity is denoted with 0. For -m, -d: n=0 means infinite redo,\n"
- "n<0 means redo abs(n) times. Valid suffixes are m,h,d,y for time;\n"
- "k,m,g for size.\n\n";
-
- fprintf(stdout, mesg, global_progname, global_progname);
-
- if (status <= 0)
- exit(-1 * status);
-
- return 0;
-}
-
-int version(int status)
-{
- char *mesg = "%s %s\n";
-
- fprintf(stdout, mesg, global_progname, VERSION);
-
- if (status <= 0)
- exit(-1 * status);
-
- return 0;
-}
-
-/* Convert a string representation of a number with an optional size suffix
- * to a long long.
- */
-long long atoll_b(const char *nptr)
-{
- int pos;
- char suffix;
- long long factor = 1;
-
- if ((pos = strlen(nptr) - 1) < 0) {
- err(stderr, "invalid string\n");
- exit(1);
- }
-
- switch (suffix = nptr[pos]) {
- case 'k':
- case 'K':
- factor = 1024;
- break;
- case 'm':
- case 'M':
- factor = 1024 * 1024;
- break;
- case 'g':
- case 'G':
- factor = 1024 * 1024 * 1024;
- break;
- default:
- if (suffix < '0' || suffix > '9') {
- err(stderr, "unrecognized suffix: %c\n", suffix);
- exit(1);
- }
- }
-
- factor = atoll(nptr) * factor;
-
- return factor;
-}
-
-/* Convert a string representation of a number with an optional time suffix
- * to a long long.
- */
-long long atoll_s(const char *nptr)
-{
- int pos;
- char suffix;
- long long factor = 1;
-
- if ((pos = strlen(nptr) - 1) < 0) {
- err(stderr, "invalid string\n");
- exit(1);
- }
-
- switch (suffix = nptr[pos]) {
- case 's':
- case 'S':
- factor = 1;
- break;
- case 'm':
- case 'M':
- factor = 60;
- break;
- case 'h':
- case 'H':
- factor = 60 * 60;
- break;
- case 'd':
- case 'D':
- factor = 60 * 60 * 24;
- break;
- case 'y':
- case 'Y':
- factor = 60 * 60 * 24 * 360;
- break;
- default:
- if (suffix < '0' || suffix > '9') {
- err(stderr, "unrecognized suffix: %c\n", suffix);
- exit(1);
- }
- }
-
- factor = atoll(nptr) * factor;
-
- return factor;
-}
-
-int hogcpu(long long forks)
-{
- long long i;
- double d;
- int pid, retval = 0;
-
- /* Make local copies of global variables. */
- int ignore = global_ignore;
- int retry = global_retry;
- int timeout = global_timeout;
- long backoff = global_backoff * forks;
-
- dbg(stdout, "using backoff sleep of %lius for hogcpu\n", backoff);
-
- for (i = 0; forks == 0 || i < forks; i++) {
- switch (pid = fork()) {
- case 0: /* child */
- alarm(timeout);
-
- /* Use a backoff sleep to ensure we get good fork throughput. */
- usleep(backoff);
-
- while (1)
- d = sqrt(rand());
-
- /* This case never falls through; alarm signal can cause exit. */
- case -1: /* error */
- if (ignore) {
- ++retval;
- wrn(stderr,
- "hogcpu worker fork failed, continuing\n");
- usleep(retry);
- continue;
- }
-
- err(stderr, "hogcpu worker fork failed\n");
- return 1;
- default: /* parent */
- dbg(stdout, "--> hogcpu worker forked (%i)\n", pid);
- }
- }
-
- /* Wait for our children to exit. */
- while (i) {
- int status, ret;
-
- if ((pid = wait(&status)) > 0) {
- if ((WIFEXITED(status)) != 0) {
- if ((ret = WEXITSTATUS(status)) != 0) {
- err(stderr,
- "hogcpu worker %i exited %i\n", pid,
- ret);
- retval += ret;
- } else {
- dbg(stdout,
- "<-- hogcpu worker exited (%i)\n",
- pid);
- }
- } else {
- dbg(stdout,
- "<-- hogcpu worker signalled (%i)\n", pid);
- }
-
- --i;
- } else {
- dbg(stdout, "wait() returned error: %s\n",
- strerror(errno));
- err(stderr,
- "detected missing hogcpu worker children\n");
- ++retval;
- break;
- }
- }
-
- return retval;
-}
-
-int hogio(long long forks)
-{
- long long i;
- int pid, retval = 0;
-
- /* Make local copies of global variables. */
- int ignore = global_ignore;
- int retry = global_retry;
- int timeout = global_timeout;
- long backoff = global_backoff * forks;
-
- dbg(stdout, "using backoff sleep of %lius for hogio\n", backoff);
-
- for (i = 0; forks == 0 || i < forks; i++) {
- switch (pid = fork()) {
- case 0: /* child */
- alarm(timeout);
-
- /* Use a backoff sleep to ensure we get good fork throughput. */
- usleep(backoff);
-
- while (1)
- sync();
-
- /* This case never falls through; alarm signal can cause exit. */
- case -1: /* error */
- if (ignore) {
- ++retval;
- wrn(stderr,
- "hogio worker fork failed, continuing\n");
- usleep(retry);
- continue;
- }
-
- err(stderr, "hogio worker fork failed\n");
- return 1;
- default: /* parent */
- dbg(stdout, "--> hogio worker forked (%i)\n", pid);
- }
- }
-
- /* Wait for our children to exit. */
- while (i) {
- int status, ret;
-
- if ((pid = wait(&status)) > 0) {
- if ((WIFEXITED(status)) != 0) {
- if ((ret = WEXITSTATUS(status)) != 0) {
- err(stderr,
- "hogio worker %i exited %i\n", pid,
- ret);
- retval += ret;
- } else {
- dbg(stdout,
- "<-- hogio worker exited (%i)\n",
- pid);
- }
- } else {
- dbg(stdout, "<-- hogio worker signalled (%i)\n",
- pid);
- }
-
- --i;
- } else {
- dbg(stdout, "wait() returned error: %s\n",
- strerror(errno));
- err(stderr, "detected missing hogio worker children\n");
- ++retval;
- break;
- }
- }
-
- return retval;
-}
-
-int hogvm(long long forks, long long chunks, long long bytes)
-{
- long long i, j, k;
- int pid, retval = 0;
- char **ptr;
-
- /* Make local copies of global variables. */
- int ignore = global_ignore;
- int retry = global_retry;
- int timeout = global_timeout;
- long backoff = global_backoff * forks;
-
- dbg(stdout, "using backoff sleep of %lius for hogvm\n", backoff);
-
- if (bytes == 0) {
- /* 512MB is guess at the largest value can than be malloced at once. */
- bytes = 512 * 1024 * 1024;
- }
-
- for (i = 0; forks == 0 || i < forks; i++) {
- switch (pid = fork()) {
- case 0: /* child */
- alarm(timeout);
-
- /* Use a backoff sleep to ensure we get good fork throughput. */
- usleep(backoff);
-
- /* If chunks is 0, ptr will allocate 0 bytes's
- * memory, it will cause the process to crash
- * during runtime, so adjust to 1 */
- if (chunks == 0)
- chunks = 1;
-
- while (1) {
- ptr = (char **)malloc(chunks *
- sizeof(char *));
- for (j = 0; j < chunks; j++) {
- if ((ptr[j] =
- (char *)malloc(bytes *
- sizeof(char)))) {
- for (k = 0; k < bytes; k++)
- ptr[j][k] = 'Z'; /* Ensure that COW happens. */
- dbg(stdout,
- "hogvm worker malloced %lli bytes\n",
- k);
- } else if (ignore) {
- ++retval;
- wrn(stderr,
- "hogvm malloc failed, continuing\n");
- usleep(retry);
- continue;
- } else {
- ++retval;
- err(stderr,
- "hogvm malloc failed\n");
- break;
- }
- }
- if (global_vmhang && retval == 0) {
- dbg(stdout,
- "sleeping forever with allocated memory\n");
- while (1)
- sleep(1024);
- }
- if (retval == 0) {
- dbg(stdout,
- "hogvm worker freeing memory and starting over\n");
- for (j = 0; j < chunks; j++)
- free(ptr[j]);
- free(ptr);
- continue;
- }
-
- exit(retval);
- }
-
- /* This case never falls through; alarm signal can cause exit. */
- case -1: /* error */
- if (ignore) {
- ++retval;
- wrn(stderr,
- "hogvm worker fork failed, continuing\n");
- usleep(retry);
- continue;
- }
-
- err(stderr, "hogvm worker fork failed\n");
- return 1;
- default: /* parent */
- dbg(stdout, "--> hogvm worker forked (%i)\n", pid);
- }
- }
-
- /* Wait for our children to exit. */
- while (i) {
- int status, ret;
-
- if ((pid = wait(&status)) > 0) {
- if ((WIFEXITED(status)) != 0) {
- if ((ret = WEXITSTATUS(status)) != 0) {
- err(stderr,
- "hogvm worker %i exited %i\n", pid,
- ret);
- retval += ret;
- } else {
- dbg(stdout,
- "<-- hogvm worker exited (%i)\n",
- pid);
- }
- } else {
- dbg(stdout, "<-- hogvm worker signalled (%i)\n",
- pid);
- }
-
- --i;
- } else {
- dbg(stdout, "wait() returned error: %s\n",
- strerror(errno));
- err(stderr, "detected missing hogvm worker children\n");
- ++retval;
- break;
- }
- }
-
- return retval;
-}
-
-int hoghdd(long long forks, int clean, long long files, long long bytes)
-{
- long long i, j;
- int fd, pid, retval = 0;
- int chunk = (1024 * 1024) - 1; /* Minimize slow writing. */
- char buff[chunk];
-
- /* Make local copies of global variables. */
- int ignore = global_ignore;
- int retry = global_retry;
- int timeout = global_timeout;
- long backoff = global_backoff * forks;
-
- /* Initialize buffer with some random ASCII data. */
- dbg(stdout, "seeding buffer with random data\n");
- for (i = 0; i < chunk - 1; i++) {
- j = rand();
- j = (j < 0) ? -j : j;
- j %= 95;
- j += 32;
- buff[i] = j;
- }
- buff[i] = '\n';
-
- dbg(stdout, "using backoff sleep of %lius for hoghdd\n", backoff);
-
- for (i = 0; forks == 0 || i < forks; i++) {
- switch (pid = fork()) {
- case 0: /* child */
- alarm(timeout);
-
- /* Use a backoff sleep to ensure we get good fork throughput. */
- usleep(backoff);
-
- while (1) {
- for (i = 0; i < files; i++) {
- char name[] = "./stress.XXXXXX";
-
- if ((fd = mkstemp(name)) < 0) {
- perror("mkstemp");
- err(stderr, "mkstemp failed\n");
- exit(1);
- }
-
- if (clean == 0) {
- dbg(stdout, "unlinking %s\n",
- name);
- if (unlink(name)) {
- err(stderr,
- "unlink failed\n");
- exit(1);
- }
- }
-
- dbg(stdout, "fast writing to %s\n",
- name);
- for (j = 0;
- bytes == 0 || j + chunk < bytes;
- j += chunk) {
- if (write(fd, buff, chunk) !=
- chunk) {
- err(stderr,
- "write failed\n");
- exit(1);
- }
- }
-
- dbg(stdout, "slow writing to %s\n",
- name);
- for (; bytes == 0 || j < bytes - 1; j++) {
- if (write(fd, "Z", 1) != 1) {
- err(stderr,
- "write failed\n");
- exit(1);
- }
- }
- if (write(fd, "\n", 1) != 1) {
- err(stderr, "write failed\n");
- exit(1);
- }
- ++j;
-
- dbg(stdout,
- "closing %s after writing %lli bytes\n",
- name, j);
- close(fd);
-
- if (clean == 1) {
- if (unlink(name)) {
- err(stderr,
- "unlink failed\n");
- exit(1);
- }
- }
- }
- if (retval == 0) {
- dbg(stdout,
- "hoghdd worker starting over\n");
- continue;
- }
-
- exit(retval);
- }
-
- /* This case never falls through; alarm signal can cause exit. */
- case -1: /* error */
- if (ignore) {
- ++retval;
- wrn(stderr,
- "hoghdd worker fork failed, continuing\n");
- usleep(retry);
- continue;
- }
-
- err(stderr, "hoghdd worker fork failed\n");
- return 1;
- default: /* parent */
- dbg(stdout, "--> hoghdd worker forked (%i)\n", pid);
- }
- }
-
- /* Wait for our children to exit. */
- while (i) {
- int status, ret;
-
- if ((pid = wait(&status)) > 0) {
- if ((WIFEXITED(status)) != 0) {
- if ((ret = WEXITSTATUS(status)) != 0) {
- err(stderr,
- "hoghdd worker %i exited %i\n", pid,
- ret);
- retval += ret;
- } else {
- dbg(stdout,
- "<-- hoghdd worker exited (%i)\n",
- pid);
- }
- } else {
- dbg(stdout,
- "<-- hoghdd worker signalled (%i)\n", pid);
- }
-
- --i;
- } else {
- dbg(stdout, "wait() returned error: %s\n",
- strerror(errno));
- err(stderr,
- "detected missing hoghdd worker children\n");
- ++retval;
- break;
- }
- }
-
- return retval;
-}
diff --git a/tools/html_report_header.txt b/tools/html_report_header.txt
deleted file mode 100644
index b3da2c5441..0000000000
--- a/tools/html_report_header.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
-<head>
- <title>Linux Test Project - Results</title>
-</head>
-<body>
-
-<h1>LTP Output/Log </h1>
-<table border="1" cellspacing="3">
- <tbody>
- <tr>
- <td bgcolor="#66ff66"><b> PASSED </b></td>
- <td bgcolor="#ff0000"><b> FAILED </b></td>
- <td bgcolor="Fuchsia"><b> WARNING </b></td>
- <td bgcolor="Yellow"><b> BROKEN </b></td>
- <td bgcolor="#8dc997"><b> RETIRED </b></td>
- <td bgcolor="Aqua"><b> CONFIG-ERROR </b></td>
- </tr>
- </tbody>
-</table>
-<br>
-<b>Meaning of the following KEYWORDS in test results/logs:</b>
-<hr>
-<li><b>TPASS -</b> Indicates that the test case had the expected result and passed</li>
-<li><b>TFAIL -</b> Indicates that the test case had an unexpected result and failed.</li>
-<li><b>TBROK -</b> Indicates that the remaining test cases are broken and will not execute correctly, because some precondition not met, such as a resource not being available.</li>
-<li><b>TCONF -</b> Indicates that the test case was not written to run on the current harware or software configuration such as machine type, or, kernel version.</li>
-<li><b>TWARN -</b> Indicates that the test case experienced an unexpected or undesirable event that should not affect the test itself such as being unable to cleanup resources after the test finished.</li>
-<li><b>TINFO -</b> Specifies useful information about the status of the test that does not affect the result and does not indicate a problem.</li>
-<hr>
-
-<br>
-<li><a href="#_1">Click Here for Detailed Report</a></li>
-<li><a href="#_2">Click Here for Summary Report</a></li>
-<br>
-
-<h2 id="_1">Detailed Report</h2>
-<div>
-<table border="1" cellspacing="3">
-<tbody>
- <tr>
- <td bgcolor="Silver"><strong>No</strong></td>
- <td bgcolor="Silver"><strong>Test-Name</strong></td>
- <td bgcolor="Silver"><strong>Start-Time</strong></td>
- <td bgcolor="Silver"><strong>Command-Line</strong></td>
- <td bgcolor="Silver"><strong>Contacts</strong></td>
- <td bgcolor="Silver"><strong>Analysis</strong></td>
- <td bgcolor="Silver"><strong>Test-Output</strong></td>
- <td bgcolor="Silver"><strong>Initiation-Status</strong></td>
- <td bgcolor="Silver"><strong>Duration</strong></td>
- <td bgcolor="Silver"><strong>Termination-type</strong></td>
- <td bgcolor="Silver"><strong>Termination-id</strong></td>
- <td bgcolor="Silver"><strong>Core-File</strong></td>
- <td bgcolor="Silver"><strong>cutime</strong></td>
- <td bgcolor="Silver"><strong>cstime</strong></td>
- </tr>
diff --git a/tools/insert_kernel_faults.sh b/tools/insert_kernel_faults.sh
deleted file mode 100755
index ae24ae108f..0000000000
--- a/tools/insert_kernel_faults.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2009 ##
-## ##
-## This program is free software; you can redistribute it and/or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-################################################################################
-# ##
-# File : insert_kernel_faults.sh ##
-# ##
-# Usage: insert_kernel_faults.sh <fault_percentage> ##
-# ##
-# Description: This is a simple script that inserts faults at various ##
-# subsystems of the kernel. Please refer to the ltp/README ##
-# for the various kernel CONFIG options needed to exploit ##
-# all those features ##
-# ##
-# Author: Subrata Modak <subrata@linux.vnet.ibm.com> ##
-# ##
-# History: Aug 11 2009 - Created - Subrata Modak. ##
-# Aug 17 2009 - Changed the debugfs mount point - Subrata Modak.##
-################################################################################
-
-if [ -z "$1" ]
- then
- #Check if Useage has been proper
- echo "Usage: $0 <fault_percentage>"
- exit 1
-fi
-
-#These are the types of Subsystems where fault will be injected
-#Make sure debugfs has been mounted
-for FAILTYPE in fail_io_timeout fail_make_request fail_page_alloc failslab
-do
- echo $1 > /sys/kernel/debug/$FAILTYPE/probability
- echo 100 > /sys/kernel/debug/$FAILTYPE/interval
- echo -1 > /sys/kernel/debug/$FAILTYPE/times
- echo 0 > /sys/kernel/debug/$FAILTYPE/space
-done
-
diff --git a/tools/restore_kernel_faults_default.sh b/tools/restore_kernel_faults_default.sh
deleted file mode 100755
index c819107bfe..0000000000
--- a/tools/restore_kernel_faults_default.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/sh
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2009 ##
-## ##
-## This program is free software; you can redistribute it and/or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-################################################################################
-# ##
-# File : restore_kernel_faults_default.sh ##
-# ##
-# Usage: restore_kernel_faults_default.sh ##
-# ##
-# Description: This is a simple script that will restore the /debugfs/fail* ##
-# entries to their default values ##
-# ##
-# Author: Subrata Modak <subrata@linux.vnet.ibm.com> ##
-# ##
-# History: Aug 11 2009 - Created - Subrata Modak. ##
-# Aug 17 2009 - Changed debugfs mount point - Subrata Modak. ##
-################################################################################
-
-echo 0 > /sys/kernel/debug/fail_io_timeout/reject-end
-echo 0 > /sys/kernel/debug/fail_io_timeout/reject-start
-echo 4294967295 > /sys/kernel/debug/fail_io_timeout/require-end
-echo 0 > /sys/kernel/debug/fail_io_timeout/require-start
-echo 32 > /sys/kernel/debug/fail_io_timeout/stacktrace-depth
-echo N > /sys/kernel/debug/fail_io_timeout/task-filter
-echo 2 > /sys/kernel/debug/fail_io_timeout/verbose
-echo 0 > /sys/kernel/debug/fail_io_timeout/space
-echo 1 > /sys/kernel/debug/fail_io_timeout/times
-echo 1 > /sys/kernel/debug/fail_io_timeout/interval
-echo 0 > /sys/kernel/debug/fail_io_timeout/probability
-
-echo 0 > /sys/kernel/debug/fail_make_request/reject-end
-echo 0 > /sys/kernel/debug/fail_make_request/reject-start
-echo 4294967295 > /sys/kernel/debug/fail_make_request/require-end
-echo 0 > /sys/kernel/debug/fail_make_request/require-start
-echo 32 > /sys/kernel/debug/fail_make_request/stacktrace-depth
-echo N > /sys/kernel/debug/fail_make_request/task-filter
-echo 2 > /sys/kernel/debug/fail_make_request/verbose
-echo 0 > /sys/kernel/debug/fail_make_request/space
-echo 1 > /sys/kernel/debug/fail_make_request/times
-echo 1 > /sys/kernel/debug/fail_make_request/interval
-echo 0 > /sys/kernel/debug/fail_make_request/probability
-
-echo 1 > /sys/kernel/debug/fail_page_alloc/min-order
-echo Y > /sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem
-echo Y > /sys/kernel/debug/fail_page_alloc/ignore-gfp-wait
-echo 0 > /sys/kernel/debug/fail_page_alloc/reject-end
-echo 0 > /sys/kernel/debug/fail_page_alloc/reject-start
-echo 4294967295 > /sys/kernel/debug/fail_page_alloc/require-end
-echo 0 > /sys/kernel/debug/fail_page_alloc/require-start
-echo 32 > /sys/kernel/debug/fail_page_alloc/stacktrace-depth
-echo N > /sys/kernel/debug/fail_page_alloc/task-filter
-echo 2 > /sys/kernel/debug/fail_page_alloc/verbose
-echo 0 > /sys/kernel/debug/fail_page_alloc/space
-echo 1 > /sys/kernel/debug/fail_page_alloc/times
-echo 1 > /sys/kernel/debug/fail_page_alloc/interval
-echo 0 > /sys/kernel/debug/fail_page_alloc/probability
-
-echo Y > /sys/kernel/debug/failslab/ignore-gfp-wait
-echo 0 > /sys/kernel/debug/failslab/reject-end
-echo 0 > /sys/kernel/debug/failslab/reject-start
-echo 4294967295 > /sys/kernel/debug/failslab/require-end
-echo 0 > /sys/kernel/debug/failslab/require-start
-echo 32 > /sys/kernel/debug/failslab/stacktrace-depth
-echo N > /sys/kernel/debug/failslab/task-filter
-echo 2 > /sys/kernel/debug/failslab/verbose
-echo 0 > /sys/kernel/debug/failslab/space
-echo 1 > /sys/kernel/debug/failslab/times
-echo 1 > /sys/kernel/debug/failslab/interval
-echo 0 > /sys/kernel/debug/failslab/probability
-
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [LTP] [PATCH v2 6/6] kirk: Remove runltp-ng symlink
2026-02-05 12:15 [LTP] [PATCH v2 0/6] Remove runltp Petr Vorel
` (4 preceding siblings ...)
2026-02-05 12:15 ` [LTP] [PATCH v2 5/6] tools: Remove tools used by runltp Petr Vorel
@ 2026-02-05 12:15 ` Petr Vorel
2026-02-17 9:50 ` Cyril Hrubis
[not found] ` <29BA2651-45AB-4A29-973D-AAE15C887ACB@gmail.com>
2026-02-11 9:17 ` [LTP] [PATCH v2 0/6] Remove runltp Andrea Cervesato via ltp
2026-02-20 11:55 ` Andrea Cervesato via ltp
7 siblings, 2 replies; 29+ messages in thread
From: Petr Vorel @ 2026-02-05 12:15 UTC (permalink / raw)
To: ltp
Cc: Thomas Petazzoni, Vasileios Almpanis, Tim Bird, Julien Olivain,
automated-testing
kirk is here long enough to remove the symlink.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
tools/kirk/Makefile | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/kirk/Makefile b/tools/kirk/Makefile
index 876eb3e2ed..859afde6e6 100644
--- a/tools/kirk/Makefile
+++ b/tools/kirk/Makefile
@@ -17,8 +17,6 @@ ifneq ($(wildcard $(abs_srcdir)/kirk-src/libkirk/*.py),)
install -m 00644 $(abs_srcdir)/kirk-src/libkirk/*.py $(BASE_DIR)/libkirk
install -m 00644 $(abs_srcdir)/kirk-src/libkirk/channels/*.py $(BASE_DIR)/libkirk/channels
install -m 00775 $(abs_srcdir)/kirk-src/kirk $(BASE_DIR)/kirk
-
- cd $(BASE_DIR) && ln -sf kirk runltp-ng
endif
include $(top_srcdir)/include/mk/generic_leaf_target.mk
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 0/6] Remove runltp
2026-02-05 12:15 [LTP] [PATCH v2 0/6] Remove runltp Petr Vorel
` (5 preceding siblings ...)
2026-02-05 12:15 ` [LTP] [PATCH v2 6/6] kirk: Remove runltp-ng symlink Petr Vorel
@ 2026-02-11 9:17 ` Andrea Cervesato via ltp
2026-02-11 9:20 ` Petr Vorel
2026-02-20 11:55 ` Andrea Cervesato via ltp
7 siblings, 1 reply; 29+ messages in thread
From: Andrea Cervesato via ltp @ 2026-02-11 9:17 UTC (permalink / raw)
To: Petr Vorel, ltp
Cc: Thomas Petazzoni, Vasileios Almpanis, Tim Bird, Julien Olivain,
automated-testing
Hi!
I don't know if it makes sense for you, but I would implement this
before merging this patch. What do you think?
https://github.com/linux-test-project/kirk/issues/72
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 0/6] Remove runltp
2026-02-11 9:17 ` [LTP] [PATCH v2 0/6] Remove runltp Andrea Cervesato via ltp
@ 2026-02-11 9:20 ` Petr Vorel
0 siblings, 0 replies; 29+ messages in thread
From: Petr Vorel @ 2026-02-11 9:20 UTC (permalink / raw)
To: Andrea Cervesato
Cc: Thomas Petazzoni, Vasileios Almpanis, Tim Bird, Julien Olivain,
ltp, automated-testing
Hi Andrea,
> Hi!
> I don't know if it makes sense for you, but I would implement this
> before merging this patch. What do you think?
> https://github.com/linux-test-project/kirk/issues/72
Yes, supporting environment variables would be useful.
And I understand that due that you want to drop --env.
=> ack
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-05 12:15 ` [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc Petr Vorel
@ 2026-02-17 9:19 ` Cyril Hrubis
2026-02-17 10:23 ` Andrea Cervesato via ltp
2026-02-19 20:20 ` Petr Vorel
0 siblings, 2 replies; 29+ messages in thread
From: Cyril Hrubis @ 2026-02-17 9:19 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp, automated-testing
Hi!
> Remove runltp from all doc, replace it with kirk.
> Also replace the old runltp-ng with kirk.
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> INSTALL | 4 +++-
> doc/developers/test_case_tutorial.rst | 6 +++---
> doc/developers/todo.rst | 10 ----------
> metadata/README.md | 2 +-
> testcases/kernel/fs/fs_readonly/test_robind.sh | 2 +-
> testcases/kernel/io/direct_io/dma_thread_diotest.c | 3 +--
> testcases/kernel/security/smack/README | 2 +-
> testcases/network/can/filter-tests/INSTALL | 2 +-
> testcases/network/rpc/rpc-tirpc/README | 2 +-
> testscripts/Readme_ROBind | 4 ++--
> 10 files changed, 14 insertions(+), 23 deletions(-)
>
> diff --git a/INSTALL b/INSTALL
> index c44bb4e660..9ef929a971 100644
> --- a/INSTALL
> +++ b/INSTALL
> @@ -105,9 +105,9 @@ Quick Start
> $ ./configure
> $ make all
> # make install
^
This should be $ (not caused by this patch but worth fixing)
> - $ /opt/ltp/runltp
>
> *NOTE:
> +- For running tests use kirk [1], individual test you can run directly.
^
This sentece has wrong order of words.
And also oversimplifies things, there is no mention of setting correct
PATH that needs to be done in order to run these tests.
I would just drop that and leave only the first sentence.
> - LTP assumes the existence of the nobody, bin, and daemon users and their
> groups. If these IDs do not exist, certain tests will fail. The respective
> user and group IDs should be the same, i.e. if `nobody's' user ID is 99, then
> @@ -117,6 +117,8 @@ its group ID should also be 99. The names of the groups are irrelevant.
> DESTDIR= is also honored for install and will install into $DESTDIR/$prefix,
> if you want to install into a chroot or a rootfs for instance.
>
> +[1] https://github.com/linux-test-project/kirk
> +
> Detailed Installation
> ---------------------
>
> diff --git a/doc/developers/test_case_tutorial.rst b/doc/developers/test_case_tutorial.rst
> index 08bd1b1519..240897e36b 100644
> --- a/doc/developers/test_case_tutorial.rst
> +++ b/doc/developers/test_case_tutorial.rst
> @@ -205,9 +205,9 @@ please do:
>
> This should build the test and then run it. However, even though the test is
> in :master:`testcases/kernel/syscalls` directory it won't be automatically ran
> -as part of the syscalls test group (e.g. not run via ``kirk -r math`` or
> -``./runltp -f syscalls``). For this we need to add it to the runtest file. So
> -open :master:`runtest/syscalls` and add the lines starting with a ``+``.
> +as part of the syscalls test group (e.g. not run via ``kirk -r math``. For
^
missing
closing
)
Also the path to syscalls is missing after the change.
> +this we need to add it to the runtest file. So open :master:`runtest/syscalls`
> +and add the lines starting with a ``+``.
>
> .. code-block::
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 2/6] testscripts/lvmtest.sh: Replace runltp with kirk
2026-02-05 12:15 ` [LTP] [PATCH v2 2/6] testscripts/lvmtest.sh: Replace runltp with kirk Petr Vorel
@ 2026-02-17 9:22 ` Cyril Hrubis
0 siblings, 0 replies; 29+ messages in thread
From: Cyril Hrubis @ 2026-02-17 9:22 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp, automated-testing
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 3/6] runltp: Remove
2026-02-05 12:15 ` [LTP] [PATCH v2 3/6] runltp: Remove Petr Vorel
@ 2026-02-17 9:29 ` Cyril Hrubis
[not found] ` <E8C09635-59E1-4DB0-A223-7D05616029E4@gmail.com>
2026-02-19 8:29 ` Jan Stancek via ltp
1 sibling, 1 reply; 29+ messages in thread
From: Cyril Hrubis @ 2026-02-17 9:29 UTC (permalink / raw)
To: Petr Vorel
Cc: Vasileios Almpanis, Tim Bird, Julien Olivain, Thomas Petazzoni,
ltp, automated-testing
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 4/6] pan: Remove
2026-02-05 12:15 ` [LTP] [PATCH v2 4/6] pan: Remove Petr Vorel
@ 2026-02-17 9:34 ` Cyril Hrubis
0 siblings, 0 replies; 29+ messages in thread
From: Cyril Hrubis @ 2026-02-17 9:34 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp, automated-testing
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 5/6] tools: Remove tools used by runltp
2026-02-05 12:15 ` [LTP] [PATCH v2 5/6] tools: Remove tools used by runltp Petr Vorel
@ 2026-02-17 9:46 ` Cyril Hrubis
0 siblings, 0 replies; 29+ messages in thread
From: Cyril Hrubis @ 2026-02-17 9:46 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp, automated-testing
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 6/6] kirk: Remove runltp-ng symlink
2026-02-05 12:15 ` [LTP] [PATCH v2 6/6] kirk: Remove runltp-ng symlink Petr Vorel
@ 2026-02-17 9:50 ` Cyril Hrubis
[not found] ` <29BA2651-45AB-4A29-973D-AAE15C887ACB@gmail.com>
1 sibling, 0 replies; 29+ messages in thread
From: Cyril Hrubis @ 2026-02-17 9:50 UTC (permalink / raw)
To: Petr Vorel
Cc: Vasileios Almpanis, Tim Bird, Julien Olivain, Thomas Petazzoni,
ltp, automated-testing
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-17 9:19 ` Cyril Hrubis
@ 2026-02-17 10:23 ` Andrea Cervesato via ltp
2026-02-19 20:20 ` Petr Vorel
1 sibling, 0 replies; 29+ messages in thread
From: Andrea Cervesato via ltp @ 2026-02-17 10:23 UTC (permalink / raw)
To: Cyril Hrubis, Petr Vorel; +Cc: ltp, automated-testing
I also noticed there are a couple of bugs in the documentation, where
kirk command is still used with the -U (framework) parameter. That
should be probably fixed.
Kind Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 3/6] runltp: Remove
[not found] ` <E8C09635-59E1-4DB0-A223-7D05616029E4@gmail.com>
@ 2026-02-18 21:09 ` Anders Roxell
0 siblings, 0 replies; 29+ messages in thread
From: Anders Roxell @ 2026-02-18 21:09 UTC (permalink / raw)
To: Enji Cooper (yaneurabeya)
Cc: Thomas Petazzoni, Vasileios Almpanis, Tim Bird, Julien Olivain,
ltp, automated-testing
On Tue, 17 Feb 2026 at 23:01, Enji Cooper (yaneurabeya)
<yaneurabeya@gmail.com> wrote:
>
>
> > On Feb 17, 2026, at 1:29 AM, Cyril Hrubis <chrubis@suse.cz> wrote:
> >
> > Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
>
> Reviewed-by: Enji Cooper <yaneurabeya@gmail.com>
Reviewed-by: Anders Roxell <anders.roxell@linaro.org>
Cheers,
Anders
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 6/6] kirk: Remove runltp-ng symlink
[not found] ` <29BA2651-45AB-4A29-973D-AAE15C887ACB@gmail.com>
@ 2026-02-18 21:10 ` Anders Roxell
0 siblings, 0 replies; 29+ messages in thread
From: Anders Roxell @ 2026-02-18 21:10 UTC (permalink / raw)
To: Enji Cooper (yaneurabeya)
Cc: Thomas Petazzoni, Vasileios Almpanis, Tim Bird, Julien Olivain,
ltp, automated-testing
On Tue, 17 Feb 2026 at 23:02, Enji Cooper (yaneurabeya)
<yaneurabeya@gmail.com> wrote:
>
>
> > On Feb 5, 2026, at 4:15 AM, Petr Vorel <pvorel@suse.cz> wrote:
> >
> > kirk is here long enough to remove the symlink.
> >
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > tools/kirk/Makefile | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/tools/kirk/Makefile b/tools/kirk/Makefile
> > index 876eb3e2ed..859afde6e6 100644
> > --- a/tools/kirk/Makefile
> > +++ b/tools/kirk/Makefile
> > @@ -17,8 +17,6 @@ ifneq ($(wildcard $(abs_srcdir)/kirk-src/libkirk/*.py),)
> > install -m 00644 $(abs_srcdir)/kirk-src/libkirk/*.py $(BASE_DIR)/libkirk
> > install -m 00644 $(abs_srcdir)/kirk-src/libkirk/channels/*.py $(BASE_DIR)/libkirk/channels
> > install -m 00775 $(abs_srcdir)/kirk-src/kirk $(BASE_DIR)/kirk
> > -
> > - cd $(BASE_DIR) && ln -sf kirk runltp-ng
> > endif
> >
> > include $(top_srcdir)/include/mk/generic_leaf_target.mk
>
> Reviewed-by: Enji Cooper <yaneurabeya@gmail.com>
Reviewed-by: Anders Roxell <anders.roxell@linaro.org>
Cheers,
Anders
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 3/6] runltp: Remove
2026-02-05 12:15 ` [LTP] [PATCH v2 3/6] runltp: Remove Petr Vorel
2026-02-17 9:29 ` Cyril Hrubis
@ 2026-02-19 8:29 ` Jan Stancek via ltp
1 sibling, 0 replies; 29+ messages in thread
From: Jan Stancek via ltp @ 2026-02-19 8:29 UTC (permalink / raw)
To: Petr Vorel
Cc: Thomas Petazzoni, Vasileios Almpanis, Tim Bird, Julien Olivain,
ltp, automated-testing
On Thu, Feb 5, 2026 at 1:16 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> runltp was replaced with kirk.
> https://github.com/linux-test-project/kirk
>
> Replace it with simple script just posting info about kirk and exit 1
> (fail).
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Jan Stancek <jstancek@redhat.com>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-17 9:19 ` Cyril Hrubis
2026-02-17 10:23 ` Andrea Cervesato via ltp
@ 2026-02-19 20:20 ` Petr Vorel
2026-02-20 8:12 ` Andrea Cervesato via ltp
2026-02-20 11:47 ` Cyril Hrubis
1 sibling, 2 replies; 29+ messages in thread
From: Petr Vorel @ 2026-02-19 20:20 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp, automated-testing
> Hi!
> > Remove runltp from all doc, replace it with kirk.
> > Also replace the old runltp-ng with kirk.
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > INSTALL | 4 +++-
> > doc/developers/test_case_tutorial.rst | 6 +++---
> > doc/developers/todo.rst | 10 ----------
> > metadata/README.md | 2 +-
> > testcases/kernel/fs/fs_readonly/test_robind.sh | 2 +-
> > testcases/kernel/io/direct_io/dma_thread_diotest.c | 3 +--
> > testcases/kernel/security/smack/README | 2 +-
> > testcases/network/can/filter-tests/INSTALL | 2 +-
> > testcases/network/rpc/rpc-tirpc/README | 2 +-
> > testscripts/Readme_ROBind | 4 ++--
> > 10 files changed, 14 insertions(+), 23 deletions(-)
> > diff --git a/INSTALL b/INSTALL
> > index c44bb4e660..9ef929a971 100644
> > --- a/INSTALL
> > +++ b/INSTALL
> > @@ -105,9 +105,9 @@ Quick Start
> > $ ./configure
> > $ make all
> > # make install
> ^
> This should be $ (not caused by this patch but worth fixing)
I can change it, but IMHO for creating /opt/ltp is needed to run it as root
for a first time. Or one must chmod/chown /opt/ltp under root.
> > - $ /opt/ltp/runltp
> > *NOTE:
> > +- For running tests use kirk [1], individual test you can run directly.
> ^
> This sentece has wrong order of words.
> And also oversimplifies things, there is no mention of setting correct
> PATH that needs to be done in order to run these tests.
> I would just drop that and leave only the first sentence.
Sure, I can remove it:
+++ INSTALL
@@ -107,7 +107,7 @@ Quick Start
# make install
*NOTE:
-- For running tests use kirk [1], individual test you can run directly.
+- For running tests use kirk [1].
- LTP assumes the existence of the nobody, bin, and daemon users and their
groups. If these IDs do not exist, certain tests will fail. The respective
user and group IDs should be the same, i.e. if `nobody's' user ID is 99, then
---
If I'm correct this is likely the only change. Can you add your RBT and I modify
before merge?
And I see Andrea already removed '-U ltp' kirk usage.
Anyway, I can wait little longer, but I got already quite a lot of ack to merge
whole patchset.
Kind regards,
Petr
> > - LTP assumes the existence of the nobody, bin, and daemon users and their
> > groups. If these IDs do not exist, certain tests will fail. The respective
> > user and group IDs should be the same, i.e. if `nobody's' user ID is 99, then
> > @@ -117,6 +117,8 @@ its group ID should also be 99. The names of the groups are irrelevant.
> > DESTDIR= is also honored for install and will install into $DESTDIR/$prefix,
> > if you want to install into a chroot or a rootfs for instance.
> > +[1] https://github.com/linux-test-project/kirk
> > +
> > Detailed Installation
> > ---------------------
> > diff --git a/doc/developers/test_case_tutorial.rst b/doc/developers/test_case_tutorial.rst
> > index 08bd1b1519..240897e36b 100644
> > --- a/doc/developers/test_case_tutorial.rst
> > +++ b/doc/developers/test_case_tutorial.rst
> > @@ -205,9 +205,9 @@ please do:
> > This should build the test and then run it. However, even though the test is
> > in :master:`testcases/kernel/syscalls` directory it won't be automatically ran
> > -as part of the syscalls test group (e.g. not run via ``kirk -r math`` or
> > -``./runltp -f syscalls``). For this we need to add it to the runtest file. So
> > -open :master:`runtest/syscalls` and add the lines starting with a ``+``.
> > +as part of the syscalls test group (e.g. not run via ``kirk -r math``. For
> ^
> missing
> closing
> )
> Also the path to syscalls is missing after the change.
> > +this we need to add it to the runtest file. So open :master:`runtest/syscalls`
> > +and add the lines starting with a ``+``.
> > .. code-block::
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-19 20:20 ` Petr Vorel
@ 2026-02-20 8:12 ` Andrea Cervesato via ltp
2026-02-20 11:47 ` Cyril Hrubis
1 sibling, 0 replies; 29+ messages in thread
From: Andrea Cervesato via ltp @ 2026-02-20 8:12 UTC (permalink / raw)
To: Petr Vorel, Cyril Hrubis; +Cc: ltp, automated-testing
> Anyway, I can wait little longer, but I got already quite a lot of ack to merge
> whole patchset.
>
> Kind regards,
> Petr
I agree, let's finish this PR and make a new release.
https://github.com/linux-test-project/kirk/pull/92
Then upgrade kirk in the LTP upstream and remove runltp one for all :)
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-19 20:20 ` Petr Vorel
2026-02-20 8:12 ` Andrea Cervesato via ltp
@ 2026-02-20 11:47 ` Cyril Hrubis
2026-02-20 15:34 ` Petr Vorel
1 sibling, 1 reply; 29+ messages in thread
From: Cyril Hrubis @ 2026-02-20 11:47 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp, automated-testing
Hi!
> > > @@ -105,9 +105,9 @@ Quick Start
> > > $ ./configure
> > > $ make all
> > > # make install
> > ^
> > This should be $ (not caused by this patch but worth fixing)
>
> I can change it, but IMHO for creating /opt/ltp is needed to run it as root
> for a first time. Or one must chmod/chown /opt/ltp under root.
Huh? The make install should just work fine. I'm just pointing out the
typo # vs $. Or did I miss something?
> > > - $ /opt/ltp/runltp
>
> > > *NOTE:
> > > +- For running tests use kirk [1], individual test you can run directly.
> > ^
> > This sentece has wrong order of words.
>
> > And also oversimplifies things, there is no mention of setting correct
> > PATH that needs to be done in order to run these tests.
>
> > I would just drop that and leave only the first sentence.
>
> Sure, I can remove it:
>
> +++ INSTALL
> @@ -107,7 +107,7 @@ Quick Start
> # make install
>
> *NOTE:
> -- For running tests use kirk [1], individual test you can run directly.
> +- For running tests use kirk [1].
> - LTP assumes the existence of the nobody, bin, and daemon users and their
> groups. If these IDs do not exist, certain tests will fail. The respective
> user and group IDs should be the same, i.e. if `nobody's' user ID is 99, then
> ---
> If I'm correct this is likely the only change. Can you add your RBT and I modify
> before merge?
Once we agree on the # vs $.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 0/6] Remove runltp
2026-02-05 12:15 [LTP] [PATCH v2 0/6] Remove runltp Petr Vorel
` (6 preceding siblings ...)
2026-02-11 9:17 ` [LTP] [PATCH v2 0/6] Remove runltp Andrea Cervesato via ltp
@ 2026-02-20 11:55 ` Andrea Cervesato via ltp
7 siblings, 0 replies; 29+ messages in thread
From: Andrea Cervesato via ltp @ 2026-02-20 11:55 UTC (permalink / raw)
To: Petr Vorel, ltp
Cc: Thomas Petazzoni, Vasileios Almpanis, Tim Bird, Julien Olivain,
automated-testing
Ok, let's kill this runltp! Can't wait to have the kirk PR list full
of bugs to fix ;-)
Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-20 11:47 ` Cyril Hrubis
@ 2026-02-20 15:34 ` Petr Vorel
2026-02-20 16:35 ` Cyril Hrubis
0 siblings, 1 reply; 29+ messages in thread
From: Petr Vorel @ 2026-02-20 15:34 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp, automated-testing
> Hi!
> > > > @@ -105,9 +105,9 @@ Quick Start
> > > > $ ./configure
> > > > $ make all
> > > > # make install
> > > ^
> > > This should be $ (not caused by this patch but worth fixing)
> > I can change it, but IMHO for creating /opt/ltp is needed to run it as root
> > for a first time. Or one must chmod/chown /opt/ltp under root.
> Huh? The make install should just work fine. I'm just pointing out the
> typo # vs $. Or did I miss something?
Yeah, I understand it and plan to change # => $. I talked about /opt (our
default prefix) usually not being writable by regular users (installing any
software using standard system prefix will have this problem). Root is needed
only for creating /opt/ltp. That was the reason for the original user to use '#'.
But as I wrote, I'm ok to change the prompt.
> > > > - $ /opt/ltp/runltp
> > > > *NOTE:
> > > > +- For running tests use kirk [1], individual test you can run directly.
> > > ^
> > > This sentece has wrong order of words.
> > > And also oversimplifies things, there is no mention of setting correct
> > > PATH that needs to be done in order to run these tests.
> > > I would just drop that and leave only the first sentence.
> > Sure, I can remove it:
> > +++ INSTALL
> > @@ -107,7 +107,7 @@ Quick Start
> > # make install
> > *NOTE:
> > -- For running tests use kirk [1], individual test you can run directly.
> > +- For running tests use kirk [1].
> > - LTP assumes the existence of the nobody, bin, and daemon users and their
> > groups. If these IDs do not exist, certain tests will fail. The respective
> > user and group IDs should be the same, i.e. if `nobody's' user ID is 99, then
> > ---
> > If I'm correct this is likely the only change. Can you add your RBT and I modify
> > before merge?
> Once we agree on the # vs $.
+1
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-20 15:34 ` Petr Vorel
@ 2026-02-20 16:35 ` Cyril Hrubis
2026-02-22 20:21 ` Petr Vorel
2026-02-23 15:44 ` Petr Vorel
0 siblings, 2 replies; 29+ messages in thread
From: Cyril Hrubis @ 2026-02-20 16:35 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp, automated-testing
Hi!
> > > > > @@ -105,9 +105,9 @@ Quick Start
> > > > > $ ./configure
> > > > > $ make all
> > > > > # make install
> > > > ^
> > > > This should be $ (not caused by this patch but worth fixing)
>
> > > I can change it, but IMHO for creating /opt/ltp is needed to run it as root
> > > for a first time. Or one must chmod/chown /opt/ltp under root.
>
> > Huh? The make install should just work fine. I'm just pointing out the
> > typo # vs $. Or did I miss something?
>
> Yeah, I understand it and plan to change # => $. I talked about /opt (our
> default prefix) usually not being writable by regular users (installing any
> software using standard system prefix will have this problem). Root is needed
> only for creating /opt/ltp. That was the reason for the original user to use '#'.
> But as I wrote, I'm ok to change the prompt.
Ah, that's a bit confusing then because in shell script # is a comment.
I usually prefix commands that needs root with sudo instead. So what
about "$ sudo make install" ?
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-20 16:35 ` Cyril Hrubis
@ 2026-02-22 20:21 ` Petr Vorel
2026-02-22 20:26 ` Enji Cooper (yaneurabeya)
2026-02-23 15:44 ` Petr Vorel
1 sibling, 1 reply; 29+ messages in thread
From: Petr Vorel @ 2026-02-22 20:21 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp, automated-testing
> Hi!
> > > > > > @@ -105,9 +105,9 @@ Quick Start
> > > > > > $ ./configure
> > > > > > $ make all
> > > > > > # make install
> > > > > ^
> > > > > This should be $ (not caused by this patch but worth fixing)
> > > > I can change it, but IMHO for creating /opt/ltp is needed to run it as root
> > > > for a first time. Or one must chmod/chown /opt/ltp under root.
> > > Huh? The make install should just work fine. I'm just pointing out the
> > > typo # vs $. Or did I miss something?
> > Yeah, I understand it and plan to change # => $. I talked about /opt (our
> > default prefix) usually not being writable by regular users (installing any
> > software using standard system prefix will have this problem). Root is needed
> > only for creating /opt/ltp. That was the reason for the original user to use '#'.
> > But as I wrote, I'm ok to change the prompt.
> Ah, that's a bit confusing then because in shell script # is a comment.
> I usually prefix commands that needs root with sudo instead. So what
> about "$ sudo make install" ?
+1, good point.
I'll merge whole patchset with this change tomorrow.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-22 20:21 ` Petr Vorel
@ 2026-02-22 20:26 ` Enji Cooper (yaneurabeya)
2026-02-23 12:02 ` Petr Vorel
0 siblings, 1 reply; 29+ messages in thread
From: Enji Cooper (yaneurabeya) @ 2026-02-22 20:26 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp, automated-testing
> On Feb 22, 2026, at 12:21 PM, Petr Vorel <pvorel@suse.cz> wrote:
>
>> Hi!
>>>>>>> @@ -105,9 +105,9 @@ Quick Start
>>>>>>> $ ./configure
>>>>>>> $ make all
>>>>>>> # make install
>>>>>> ^
>>>>>> This should be $ (not caused by this patch but worth fixing)
>
>>>>> I can change it, but IMHO for creating /opt/ltp is needed to run it as root
>>>>> for a first time. Or one must chmod/chown /opt/ltp under root.
>
>>>> Huh? The make install should just work fine. I'm just pointing out the
>>>> typo # vs $. Or did I miss something?
>
>>> Yeah, I understand it and plan to change # => $. I talked about /opt (our
>>> default prefix) usually not being writable by regular users (installing any
>>> software using standard system prefix will have this problem). Root is needed
>>> only for creating /opt/ltp. That was the reason for the original user to use '#'.
>>> But as I wrote, I'm ok to change the prompt.
>
>> Ah, that's a bit confusing then because in shell script # is a comment.
>> I usually prefix commands that needs root with sudo instead. So what
>> about "$ sudo make install" ?
>
> +1, good point.
> I'll merge whole patchset with this change tomorrow.
Using markdown and sudo would make it unambiguous. I’m not sure if markdown makes sense here, but at the very least I would reference sudo or made the directions explicitly state that the command must be run as root.
Just my 2 cents...
-Enji
Example:
```bash
$ ./configure
$ make all
$ sudo make install
```
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-22 20:26 ` Enji Cooper (yaneurabeya)
@ 2026-02-23 12:02 ` Petr Vorel
0 siblings, 0 replies; 29+ messages in thread
From: Petr Vorel @ 2026-02-23 12:02 UTC (permalink / raw)
To: Enji Cooper (yaneurabeya); +Cc: ltp, automated-testing
> > On Feb 22, 2026, at 12:21 PM, Petr Vorel <pvorel@suse.cz> wrote:
> >> Hi!
> >>>>>>> @@ -105,9 +105,9 @@ Quick Start
> >>>>>>> $ ./configure
> >>>>>>> $ make all
> >>>>>>> # make install
> >>>>>> ^
> >>>>>> This should be $ (not caused by this patch but worth fixing)
> >>>>> I can change it, but IMHO for creating /opt/ltp is needed to run it as root
> >>>>> for a first time. Or one must chmod/chown /opt/ltp under root.
> >>>> Huh? The make install should just work fine. I'm just pointing out the
> >>>> typo # vs $. Or did I miss something?
> >>> Yeah, I understand it and plan to change # => $. I talked about /opt (our
> >>> default prefix) usually not being writable by regular users (installing any
> >>> software using standard system prefix will have this problem). Root is needed
> >>> only for creating /opt/ltp. That was the reason for the original user to use '#'.
> >>> But as I wrote, I'm ok to change the prompt.
> >> Ah, that's a bit confusing then because in shell script # is a comment.
> >> I usually prefix commands that needs root with sudo instead. So what
> >> about "$ sudo make install" ?
> > +1, good point.
> > I'll merge whole patchset with this change tomorrow.
> Using markdown and sudo would make it unambiguous. I’m not sure if markdown makes sense here, but at the very least I would reference sudo or made the directions explicitly state that the command must be run as root.
> Just my 2 cents...
> -Enji
> Example:
> ```bash
> $ ./configure
> $ make all
> $ sudo make install
> ```
I would prefer to drive away from GitHub Markdown, when we have readthedocs
https://linux-test-project.readthedocs.io/en/latest/index.html
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc
2026-02-20 16:35 ` Cyril Hrubis
2026-02-22 20:21 ` Petr Vorel
@ 2026-02-23 15:44 ` Petr Vorel
1 sibling, 0 replies; 29+ messages in thread
From: Petr Vorel @ 2026-02-23 15:44 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: Tim Bird, ltp, automated-testing
Hi all,
...
> Ah, that's a bit confusing then because in shell script # is a comment.
> I usually prefix commands that needs root with sudo instead. So what
> about "$ sudo make install" ?
patchset merged with agreed diff (below). LTP is now without runltp.
Thanks a lot for a review.
Kind regards,
Petr
+++ INSTALL
@@ -104,10 +104,10 @@ Quick Start
$ cd ltp
$ ./configure
$ make all
- # make install
+ $ sudo make install
*NOTE:
-- For running tests use kirk [1], individual test you can run directly.
+- For running tests use kirk [1].
- LTP assumes the existence of the nobody, bin, and daemon users and their
groups. If these IDs do not exist, certain tests will fail. The respective
user and group IDs should be the same, i.e. if `nobody's' user ID is 99, then
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2026-02-23 15:45 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-05 12:15 [LTP] [PATCH v2 0/6] Remove runltp Petr Vorel
2026-02-05 12:15 ` [LTP] [PATCH v2 1/6] doc: INSTALL: dma_thread_diotest.c: Remove runltp from doc Petr Vorel
2026-02-17 9:19 ` Cyril Hrubis
2026-02-17 10:23 ` Andrea Cervesato via ltp
2026-02-19 20:20 ` Petr Vorel
2026-02-20 8:12 ` Andrea Cervesato via ltp
2026-02-20 11:47 ` Cyril Hrubis
2026-02-20 15:34 ` Petr Vorel
2026-02-20 16:35 ` Cyril Hrubis
2026-02-22 20:21 ` Petr Vorel
2026-02-22 20:26 ` Enji Cooper (yaneurabeya)
2026-02-23 12:02 ` Petr Vorel
2026-02-23 15:44 ` Petr Vorel
2026-02-05 12:15 ` [LTP] [PATCH v2 2/6] testscripts/lvmtest.sh: Replace runltp with kirk Petr Vorel
2026-02-17 9:22 ` Cyril Hrubis
2026-02-05 12:15 ` [LTP] [PATCH v2 3/6] runltp: Remove Petr Vorel
2026-02-17 9:29 ` Cyril Hrubis
[not found] ` <E8C09635-59E1-4DB0-A223-7D05616029E4@gmail.com>
2026-02-18 21:09 ` Anders Roxell
2026-02-19 8:29 ` Jan Stancek via ltp
2026-02-05 12:15 ` [LTP] [PATCH v2 4/6] pan: Remove Petr Vorel
2026-02-17 9:34 ` Cyril Hrubis
2026-02-05 12:15 ` [LTP] [PATCH v2 5/6] tools: Remove tools used by runltp Petr Vorel
2026-02-17 9:46 ` Cyril Hrubis
2026-02-05 12:15 ` [LTP] [PATCH v2 6/6] kirk: Remove runltp-ng symlink Petr Vorel
2026-02-17 9:50 ` Cyril Hrubis
[not found] ` <29BA2651-45AB-4A29-973D-AAE15C887ACB@gmail.com>
2026-02-18 21:10 ` Anders Roxell
2026-02-11 9:17 ` [LTP] [PATCH v2 0/6] Remove runltp Andrea Cervesato via ltp
2026-02-11 9:20 ` Petr Vorel
2026-02-20 11:55 ` Andrea Cervesato via ltp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox