The new test suite tries to run all tests with all available page sizes.
This will be a problem with the shm-fork and shm-getraw tests as the shmget
interface will only work with the default page, this patch wraps the tests
to make the runs with pages sizes other than the default expected failures.

Signed-off-by: Eric B Munson <ebmun...@us.ibm.com>
---
 tests/Makefile      |    2 +-
 tests/run_tests.py  |    6 +++---
 tests/shm-fork.sh   |   18 ++++++++++++++++++
 tests/shm-getraw.sh |   18 ++++++++++++++++++
 4 files changed, 40 insertions(+), 4 deletions(-)
 create mode 100755 tests/shm-fork.sh
 create mode 100755 tests/shm-getraw.sh

diff --git a/tests/Makefile b/tests/Makefile
index 4313084..bc4e16c 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
+WRAPPERS = quota shm-fork shm-getraw
 HELPERS = get_hugetlbfs_path compare_kvers
 HELPER_LIBS = libheapshrink.so
 BADTOOLCHAIN = bad-toolchain.sh
diff --git a/tests/run_tests.py b/tests/run_tests.py
index c9d4502..5822473 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -561,10 +561,10 @@ def stress_tests():
     # This is to catch off-by-ones or races in the kernel allocated that
     # can make allocating all hugepages a problem
     if nr_pages > 1:
-        do_test("shm-fork %i %i" % (threads, nr_pages / 2))
-    do_test("shm-fork %i %i" % (threads, nr_pages))
+        do_test("shm-fork.sh %i %i" % (threads, nr_pages / 2))
+    do_test("shm-fork.sh %i %i" % (threads, nr_pages))
 
-    do_test("shm-getraw %i %s" % (nr_pages, "/dev/full"))
+    do_test("shm-getraw.sh %i %s" % (nr_pages, "/dev/full"))
     restore_shm_sysctl(sysctls)
 
 
diff --git a/tests/shm-fork.sh b/tests/shm-fork.sh
new file mode 100755
index 0000000..174c543
--- /dev/null
+++ b/tests/shm-fork.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+. wrapper-utils.sh
+
+#shm-fork will fail if the hugepage size is different from the system default
+
+def_hpage_size=`grep 'Hugepagesize:' /proc/meminfo | awk '{print $2}'`
+let "def_hpage_size *= 1024"
+
+if [ -z "$HUGETLB_DEFAULT_PAGE_SIZE" ]; then
+       EXP_RC=$RC_PASS
+elif [ "$def_hpage_size" -eq "$HUGETLB_DEFAULT_PAGE_SIZE" ]; then
+       EXP_RC=$RC_PASS
+else
+       EXP_RC=$RC_FAIL
+fi
+
+exec_and_check $EXP_RC shm-fork "$@"
diff --git a/tests/shm-getraw.sh b/tests/shm-getraw.sh
new file mode 100755
index 0000000..fb4f917
--- /dev/null
+++ b/tests/shm-getraw.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+. wrapper-utils.sh
+
+#shm-getraw will fail if the hugepage size is different from the system default
+
+def_hpage_size=`grep 'Hugepagesize:' /proc/meminfo | awk '{print $2}'`
+let "def_hpage_size *= 1024"
+
+if [ -z "$HUGETLB_DEFAULT_PAGE_SIZE" ]; then
+       EXP_RC=$RC_PASS
+elif [ "$def_hpage_size" -eq "$HUGETLB_DEFAULT_PAGE_SIZE" ]; then
+       EXP_RC=$RC_PASS
+else
+       EXP_RC=$RC_FAIL
+fi
+
+exec_and_check $EXP_RC shm-getraw "$@"
-- 
1.6.1.2


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to