aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEric B Munson <ebmunson@us.ibm.com>2009-02-18 17:19:42 +0000
committerEric B Munson <ebmunson@us.ibm.com>2009-02-25 17:19:08 -0700
commit1dc271d2fb5e3d44c15c992e986ec6372ee11ad1 (patch)
tree94c12065183d360cb64878ba7be49a755a813b4f /tests
parent79c37ec62902b4f8a6caa1701de1212178caa94e (diff)
downloadlibhugetlbfs-1dc271d2fb5e3d44c15c992e986ec6372ee11ad1.tar.gz
Wrapping counters test for expected failure
The counters test depends on huge page overcommit which was not available until 2.6.24. This patch wraps the test to make runs on earlier kernels expected failures. Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile2
-rwxr-xr-xtests/counters.sh13
-rwxr-xr-xtests/run_tests.py2
3 files changed, 15 insertions, 2 deletions
diff --git a/tests/Makefile b/tests/Makefile
index bc4e16c..31b1b3b 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -16,7 +16,7 @@ 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
+WRAPPERS = quota shm-fork shm-getraw counters
HELPERS = get_hugetlbfs_path compare_kvers
HELPER_LIBS = libheapshrink.so
BADTOOLCHAIN = bad-toolchain.sh
diff --git a/tests/counters.sh b/tests/counters.sh
new file mode 100755
index 0000000..e3ffabe
--- /dev/null
+++ b/tests/counters.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+. wrapper-utils.sh
+
+# Huge page overcommit was not available until 2.6.24
+compare_kvers `uname -r` "2.6.24"
+if [ $? -eq 1 ]; then
+ EXP_RC=$RC_FAIL
+else
+ EXP_RC=$RC_PASS
+fi
+
+exec_and_check $EXP_RC counters "$@"
diff --git a/tests/run_tests.py b/tests/run_tests.py
index 404e5fe..042d427 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -536,7 +536,7 @@ def functional_tests():
# Test accounting of HugePages_{Total|Free|Resv|Surp}
# Alters the size of the hugepage pool so should probably be run last
- do_test("counters")
+ do_test("counters.sh")
def stress_tests():
"""