aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric B Munson <ebmunson@us.ibm.com>2009-05-13 10:35:53 +0100
committerEric B Munson <ebmunson@us.ibm.com>2009-05-13 15:34:45 +0100
commit6673da41773f28675a12ffa994170be8fa798a1f (patch)
treebb81f53f9e1b3205ac11eb883bc33896696061a7
parentb8d8bd39075e772da64bd7d5e75167c1b9eb6767 (diff)
downloadlibhugetlbfs-6673da41773f28675a12ffa994170be8fa798a1f.tar.gz
Wrapping tests to prevent machine hangs
The readahead, madvise, and the fadvise tests can all hang the running machine if the kernel bug they are testing is present. This patch wraps these tests so that they fail without running if the kernel version is less than 2.6.30. Signed-off-by: Eric B Munson <ebmunson@us.ibm.com> Acked-by: Mel Gorman <mel@csn.ul.ie>
-rw-r--r--tests/Makefile3
-rwxr-xr-xtests/fadvise_reserve.sh14
-rwxr-xr-xtests/madvise_reserve.sh14
-rwxr-xr-xtests/readahead_reserve.sh14
-rwxr-xr-xtests/run_tests.py6
5 files changed, 47 insertions, 4 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 7e7dd99..3e0a832 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -17,7 +17,8 @@ LDSCRIPT_TESTS = zero_filesize_segment
HUGELINK_TESTS = linkhuge linkhuge_nofd linkshare
HUGELINK_RW_TESTS = linkhuge_rw
STRESS_TESTS = mmap-gettest mmap-cow shm-gettest shm-getraw shm-fork
-WRAPPERS = quota shm-fork shm-getraw counters
+WRAPPERS = quota shm-fork shm-getraw counters madvise_reserve fadvise_reserve \
+ readahead_reserve
HELPERS = get_hugetlbfs_path compare_kvers
HELPER_LIBS = libheapshrink.so
BADTOOLCHAIN = bad-toolchain.sh
diff --git a/tests/fadvise_reserve.sh b/tests/fadvise_reserve.sh
new file mode 100755
index 0000000..a62f9e9
--- /dev/null
+++ b/tests/fadvise_reserve.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+. wrapper-utils.sh
+
+# fadvise is known broken before 2.6.30
+compare_kvers `uname -r` "2.6.30"
+if [ $? -eq 1 ]; then
+ echo "FAIL kernel bug"
+ exit $RC_FAIL
+else
+ EXP_RC=$RC_PASS
+ exec_and_check $EXP_RC quota "$@"
+fi
+
diff --git a/tests/madvise_reserve.sh b/tests/madvise_reserve.sh
new file mode 100755
index 0000000..64eb229
--- /dev/null
+++ b/tests/madvise_reserve.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+. wrapper-utils.sh
+
+# madvise is known broken before 2.6.30
+compare_kvers `uname -r` "2.6.30"
+if [ $? -eq 1 ]; then
+ echo "FAIL kernel bug"
+ exit $RC_FAIL
+else
+ EXP_RC=$RC_PASS
+ exec_and_check $EXP_RC quota "$@"
+fi
+
diff --git a/tests/readahead_reserve.sh b/tests/readahead_reserve.sh
new file mode 100755
index 0000000..8dc0ad1
--- /dev/null
+++ b/tests/readahead_reserve.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+. wrapper-utils.sh
+
+# readahead is known broken before 2.6.30
+compare_kvers `uname -r` "2.6.30"
+if [ $? -eq 1 ]; then
+ echo "FAIL kernel bug"
+ exit $RC_FAIL
+else
+ EXP_RC=$RC_PASS
+ exec_and_check $EXP_RC quota "$@"
+fi
+
diff --git a/tests/run_tests.py b/tests/run_tests.py
index ed246fc..871ae7c 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -479,9 +479,9 @@ def functional_tests():
do_test("brk_near_huge")
do_test("task-size-overrun")
do_test("stack_grow_into_huge")
- do_test("readahead_reserve")
- do_test("madvise_reserve")
- do_test("fadvise_reserve")
+ do_test("readahead_reserve.sh")
+ do_test("madvise_reserve.sh")
+ do_test("fadvise_reserve.sh")
# Tests requiring an active mount and hugepage COW
do_test("private")