diff options
Diffstat (limited to 'meta-oe/recipes-benchmark/libhugetlbfs/files/0004-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch')
| -rw-r--r-- | meta-oe/recipes-benchmark/libhugetlbfs/files/0004-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/files/0004-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch b/meta-oe/recipes-benchmark/libhugetlbfs/files/0004-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch new file mode 100644 index 0000000000..6b010365a0 --- /dev/null +++ b/meta-oe/recipes-benchmark/libhugetlbfs/files/0004-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | From 86d3ebfc4da5ccbc82fdee4abaf2cbf758d82403 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ting Liu <b28495@freescale.com> | ||
| 3 | Date: Wed, 21 Aug 2013 15:44:57 +0800 | ||
| 4 | Subject: [PATCH] run_test.py: not use hard coded path ../obj/hugeadm | ||
| 5 | |||
| 6 | Hard coded path makes the script impossible to run out of source tree. | ||
| 7 | After 'make install', we can use hugeadm utility under DESTDIR. | ||
| 8 | |||
| 9 | Upstream-Status: Submitted | ||
| 10 | |||
| 11 | Signed-off-by: Ting Liu <b28495@freescale.com> | ||
| 12 | |||
| 13 | Update for 2.22. | ||
| 14 | Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com> | ||
| 15 | |||
| 16 | Update to work for python3 | ||
| 17 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 18 | --- | ||
| 19 | tests/run_tests.py | 12 +++++++++++- | ||
| 20 | 1 file changed, 11 insertions(+), 1 deletion(-) | ||
| 21 | |||
| 22 | diff --git a/tests/run_tests.py b/tests/run_tests.py | ||
| 23 | index 4793262..6cd0241 100755 | ||
| 24 | --- a/tests/run_tests.py | ||
| 25 | +++ b/tests/run_tests.py | ||
| 26 | @@ -250,9 +250,19 @@ def get_pagesizes(): | ||
| 27 | Use libhugetlbfs' hugeadm utility to get a list of page sizes that have | ||
| 28 | active mount points and at least one huge page allocated to the pool. | ||
| 29 | """ | ||
| 30 | + local_env = os.environ.copy() | ||
| 31 | + local_env["PATH"] = "../obj:%s" % local_env.get("PATH", "") | ||
| 32 | sizes = set() | ||
| 33 | out = "" | ||
| 34 | - (rc, out) = bash("../obj/hugeadm --page-sizes") | ||
| 35 | + try: | ||
| 36 | + p = subprocess.Popen("hugeadm --page-sizes", shell=True, env=local_env, stdout=subprocess.PIPE) | ||
| 37 | + rc = p.wait() | ||
| 38 | + except KeyboardInterrupt: | ||
| 39 | + return sizes | ||
| 40 | + except OSError: | ||
| 41 | + return sizes | ||
| 42 | + out = p.stdout.read().decode().strip() | ||
| 43 | + | ||
| 44 | if rc != 0 or out == "": | ||
| 45 | return sizes | ||
| 46 | |||
| 47 | -- | ||
| 48 | 2.25.1 | ||
| 49 | |||
