diff options
author | Chunrong Guo <B40290@freescale.com> | 2013-10-12 09:06:42 +0000 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2013-10-15 13:43:53 +0200 |
commit | 0e2a691f78669e27a44c03b8a79bd0d0b2dfed0a (patch) | |
tree | 0f0cfd36237db29e6a2f9b8005064eda2a35188b | |
parent | 90cd9eab6622f72a25b60e7510e76b59378767b8 (diff) | |
download | meta-openembedded-0e2a691f78669e27a44c03b8a79bd0d0b2dfed0a.tar.gz |
libhugetlbfs: not use hard coded path in run_tests.py
*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: Chunrong Guo <B40290@freescale.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r-- | meta-oe/recipes-benchmark/libhugetlbfs/files/0001-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch | 43 | ||||
-rw-r--r-- | meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 1 |
2 files changed, 44 insertions, 0 deletions
diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/files/0001-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch b/meta-oe/recipes-benchmark/libhugetlbfs/files/0001-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch new file mode 100644 index 000000000..3082d7ef5 --- /dev/null +++ b/meta-oe/recipes-benchmark/libhugetlbfs/files/0001-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From a85fc43243f8bfad12d306a4a0e230fb8b3e828a 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 | tests/run_tests.py | 12 +++++++++++- | ||
14 | 1 files changed, 11 insertions(+), 1 deletions(-) | ||
15 | |||
16 | diff --git a/tests/run_tests.py b/tests/run_tests.py | ||
17 | index d9a6b35..a9bab8f 100755 | ||
18 | --- a/tests/run_tests.py | ||
19 | +++ b/tests/run_tests.py | ||
20 | @@ -232,9 +232,19 @@ def get_pagesizes(): | ||
21 | Use libhugetlbfs' hugeadm utility to get a list of page sizes that have | ||
22 | active mount points and at least one huge page allocated to the pool. | ||
23 | """ | ||
24 | + local_env = os.environ.copy() | ||
25 | + local_env["PATH"] = "../obj:%s" % local_env.get("PATH", "") | ||
26 | sizes = set() | ||
27 | out = "" | ||
28 | - (rc, out) = bash("../obj/hugeadm --page-sizes") | ||
29 | + try: | ||
30 | + p = subprocess.Popen("hugeadm --page-sizes", shell=True, env=local_env, stdout=subprocess.PIPE) | ||
31 | + rc = p.wait() | ||
32 | + except KeyboardInterrupt: | ||
33 | + return sizes | ||
34 | + except OSError: | ||
35 | + return sizes | ||
36 | + out = p.stdout.read().strip() | ||
37 | + | ||
38 | if rc != 0 or out == "": return sizes | ||
39 | |||
40 | for size in out.split("\n"): sizes.add(int(size)) | ||
41 | -- | ||
42 | 1.7.3.4 | ||
43 | |||
diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb index 475c502c6..5b871e988 100644 --- a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +++ b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | |||
@@ -14,6 +14,7 @@ SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \ | |||
14 | file://libhugetlbfs-avoid-search-host-library-path-for-cros.patch \ | 14 | file://libhugetlbfs-avoid-search-host-library-path-for-cros.patch \ |
15 | file://fix-lib64-can-not-be-shiped-in-64bit-target.patch \ | 15 | file://fix-lib64-can-not-be-shiped-in-64bit-target.patch \ |
16 | file://tests-Makefile-install-static-4G-edge-testcases.patch \ | 16 | file://tests-Makefile-install-static-4G-edge-testcases.patch \ |
17 | file://0001-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch \ | ||
17 | " | 18 | " |
18 | 19 | ||
19 | S = "${WORKDIR}/git" | 20 | S = "${WORKDIR}/git" |