From: Ting Liu <b28...@freescale.com>

Hard coded path makes the script impossible to run out of source tree.
After 'make install', we can use hugeadm utility under DESTDIR.

Signed-off-by: Ting Liu <b28...@freescale.com>
---
 tests/run_tests.py |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/tests/run_tests.py b/tests/run_tests.py
index d9a6b35..a9bab8f 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -232,9 +232,19 @@ def get_pagesizes():
     Use libhugetlbfs' hugeadm utility to get a list of page sizes that have
     active mount points and at least one huge page allocated to the pool.
     """
+    local_env = os.environ.copy()
+    local_env["PATH"] = "../obj:%s" % local_env.get("PATH", "")
     sizes = set()
     out = ""
-    (rc, out) = bash("../obj/hugeadm --page-sizes")
+    try:
+        p = subprocess.Popen("hugeadm --page-sizes", shell=True, 
env=local_env, stdout=subprocess.PIPE)
+        rc = p.wait()
+    except KeyboardInterrupt:
+        return sizes
+    except OSError:
+        return sizes
+    out = p.stdout.read().strip()
+
     if rc != 0 or out == "": return sizes
 
     for size in out.split("\n"): sizes.add(int(size))
-- 
1.7.3.4



------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to