Skip to contentSkip to conversation

runltp: Enable POSIX regex support for SKIPFILE (-S)

PATCH In review Jan Polensky 3 participants 3 messages May 27, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runltp: Enable POSIX regex support for SKIPFILE (-S)

Enhance the SKIPFILE (-S) option to support POSIX regular expressions, allowing users to skip groups of tests using concise patterns instead of listing each test individually.

Previous usage:
cat > skip_file <<-EOF
oom01 # reason foo
oom03 # reason foo
oom04 # reason foo
oom05 # reason foo
special_a # reason bar
special_b # reason bar
EOF

New usage:
echo > skip_file <<-EOF
oom0[13-5] # reason foo
spe.* # reason bar
EOF

Note: The previous behavior remains fully supported for backward compatibility.

---
 runltp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
runltp +3 -3
index 0d9062569141..c535775f2568 100755
@@ -166,7 +166,7 @@ usage()
     -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
+    -S SKIPFILE     Skip tests matching PATTERNs listed in SKIPFILE.
     -t DURATION     Execute the testsuite for given duration. Examples:
                       -t 60s = 60 seconds
                       -t 45m = 45 minutes
@@ -648,9 +648,9 @@ EOF
 
     # Blacklist or skip tests if a SKIPFILE was specified with -S
     if [ -n "${SKIPFILE}" ]; then
-        for test_name in $(awk '{print $1}' "${SKIPFILE}"); do
+        for test_name in $(awk '{gsub(/\./, "[^[:space:]]", $1); print $1}' "${SKIPFILE}"); do
             case "${test_name}" in \#*) continue;; esac
-            sed -i "/\<${test_name}\>/c\\${test_name} exit 32;" alltests
+            sed -i "s#\<\(${test_name}\)\>.*#\1 exit 32;#" alltests
         done
     fi
 

--
2.49.0

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi Jan,

Quoted 5 lines

Hi!
The runltp script is going to be removed soon, please switch to kirk that is going to replace it.

https://github.com/linux-test-project/kirk

I'll also vote not to touch runltp any more.

kirk is mature enough and therefore we want to kill this old shell script.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp