Gentoo Archives: gentoo-commits

From: "Manuel Rüger" <mrueg@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/python-afl/, dev-python/python-afl/files/
Date: Fri, 30 Jun 2017 15:42:13
Message-Id: 1498837312.eb0f9c2b43bf998b5dd48066fe146a0c974294a7.mrueg@gentoo
1 commit: eb0f9c2b43bf998b5dd48066fe146a0c974294a7
2 Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 30 15:41:52 2017 +0000
4 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 30 15:41:52 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb0f9c2b
7
8 dev-python/python-afl: Apply patch to fix test, thanks to Jakub Wilk
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 .../python-afl/files/python-afl-0.6-fix-test.patch | 41 ++++++++++++++++++++++
13 dev-python/python-afl/python-afl-0.6.ebuild | 6 +---
14 2 files changed, 42 insertions(+), 5 deletions(-)
15
16 diff --git a/dev-python/python-afl/files/python-afl-0.6-fix-test.patch b/dev-python/python-afl/files/python-afl-0.6-fix-test.patch
17 new file mode 100644
18 index 00000000000..1243385b811
19 --- /dev/null
20 +++ b/dev-python/python-afl/files/python-afl-0.6-fix-test.patch
21 @@ -0,0 +1,41 @@
22 +From 4c138687008a3d212906367a315ea79b6f6727c9 Mon Sep 17 00:00:00 2001
23 +From: Jakub Wilk <jwilk@×××××.net>
24 +Date: Thu, 29 Jun 2017 20:54:08 +0200
25 +Subject: [PATCH] tests/tools: fake $PWD so that is starts with ///.
26 +
27 +This is needed to skip overzealous /tmp checks in afl-cmap.
28 +
29 +Fixes:
30 +
31 + ======================================================================
32 + ERROR: tests.test_cmin.test
33 + ----------------------------------------------------------------------
34 + Traceback (most recent call last):
35 + File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
36 + self.test(*self.arg)
37 + File "/tmp/.../tests/test_cmin.py", line 68, in test
38 + b'1',
39 + File "/tmp/.../tests/test_cmin.py", line 51, in run_afl_cmin
40 + run(cmdline)
41 + File "/tmp/.../tests/tools.py", line 148, in run
42 + raise ipc.CalledProcessError(child.returncode, cmd[0])
43 + CalledProcessError: Command 'py-afl-cmin' returned non-zero exit status 1
44 + -------------------- >> begin captured stdout << ---------------------
45 + ...
46 + [-] Error: do not use this script in /tmp or /var/tmp.
47 +---
48 + tests/tools.py | 1 +
49 + 1 file changed, 1 insertion(+)
50 +
51 +diff --git a/tests/tools.py b/tests/tools.py
52 +index 0c9240c..f3ebab1 100644
53 +--- a/tests/tools.py
54 ++++ b/tests/tools.py
55 +@@ -131,6 +131,7 @@ def clean_environ():
56 + os.environ['AFL_SKIP_CPUFREQ'] = '1'
57 + os.environ['AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES'] = '1'
58 + os.environ['AFL_NO_AFFINITY'] = '1'
59 ++ os.environ['PWD'] = '//' + os.getcwd()
60 +
61 + def run(cmd, stdin='', xstatus=0):
62 + child = ipc.Popen(
63
64 diff --git a/dev-python/python-afl/python-afl-0.6.ebuild b/dev-python/python-afl/python-afl-0.6.ebuild
65 index cb3375a8e44..7bfa986eb62 100644
66 --- a/dev-python/python-afl/python-afl-0.6.ebuild
67 +++ b/dev-python/python-afl/python-afl-0.6.ebuild
68 @@ -19,11 +19,7 @@ RDEPEND="app-forensics/afl"
69 DEPEND=">=dev-python/cython-0.19[${PYTHON_USEDEP}]
70 test? ( dev-python/nose[${PYTHON_USEDEP}] )"
71
72 -python_prepare_all() {
73 - # afl-cmin errors with: "Error: do not use this script in /tmp or /var/tmp"
74 - rm tests/test_cmin.py || die
75 - distutils-r1_python_prepare_all
76 -}
77 +PATCHES=( "${FILESDIR}"/${P}-fix-test.patch )
78
79 python_test() {
80 PATH="${PATH}:." nosetests --verbose || die