[Devel] [PATCH hci-8.1 v2 2/7] selftests/memfd: fail run_hugetlbfs_test.sh when a test fails
Eva Kurchatova
eva.kurchatova at virtuozzo.com
Tue Oct 27 18:51:28 MSK 2026
The script runs memfd_test and the fuse test on hugetlbfs, puts the
huge page count back and exits with the status of whatever ran last,
so a test that failed or aborted was reported as passed. The hugetlbfs
F_SEAL_EXEC bug went unnoticed that way until the abort was seen by eye.
Exit with a failure when either test did.
https://virtuozzo.atlassian.net/browse/VSTOR-134205
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
---
tools/testing/selftests/memfd/run_hugetlbfs_test.sh | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/memfd/run_hugetlbfs_test.sh b/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
index fb633eeb0290..083bd72d9d41 100755
--- a/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
+++ b/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
@@ -57,8 +57,9 @@ fi
#
# Run the hugetlbfs test
#
-./memfd_test hugetlbfs
-./run_fuse_test.sh hugetlbfs
+ret=0
+./memfd_test hugetlbfs || ret=1
+./run_fuse_test.sh hugetlbfs || ret=1
#
# Give back any huge pages allocated for the test
@@ -66,3 +67,5 @@ fi
if [ -n "$nr_hugepgs" ]; then
echo $nr_hugepgs > /proc/sys/vm/nr_hugepages
fi
+
+exit $ret
--
2.56.0
More information about the Devel
mailing list