diff options
author | Eric B Munson <ebmunson@us.ibm.com> | 2009-02-16 11:16:43 +0000 |
---|---|---|
committer | Eric B Munson <ebmunson@us.ibm.com> | 2009-02-19 09:25:07 +0000 |
commit | 3ad451ecd4b5a7edf83502a64dbadedfe3887e7d (patch) | |
tree | 68859d0e8710d1eb74e1aa703406bc57fd8f751f | |
parent | b3c7f5efa0b298c8ed2bda77656f273f793b46ce (diff) | |
download | libhugetlbfs-3ad451ecd4b5a7edf83502a64dbadedfe3887e7d.tar.gz |
Add error checking if there is no hugetlbfs mount or huge pages available
This patch makes the test harness print a nicer message if there are no
available pagesizes.
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
-rwxr-xr-x | tests/run_tests.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py index 5822473..404e5fe 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -208,8 +208,9 @@ def get_pagesizes(): active mount points and at least one huge page allocated to the pool. """ sizes = set() + out = "" (rc, out) = bash(cmd_env('') + "hugeadm --page-sizes") - if rc != 0: return sizes + if rc != 0 or out == "": return sizes for size in out.split("\n"): sizes.add(int(size)) return sizes @@ -599,6 +600,11 @@ def main(): if len(wordsizes) == 0: wordsizes = set([32, 64]) if len(pagesizes) == 0: pagesizes = get_pagesizes() + if len(pagesizes) == 0: + print "Unable to find available page sizes, are you sure hugetlbfs" + print "is mounted and there are available huge pages?" + return 1 + setup_env(env_override, env_defaults) init_results() check_hugetlbfs_path() |