diff options
author | Manuel Rüger <mrueg@gentoo.org> | 2017-06-30 17:41:52 +0200 |
---|---|---|
committer | Manuel Rüger <mrueg@gentoo.org> | 2017-06-30 17:41:52 +0200 |
commit | eb0f9c2b43bf998b5dd48066fe146a0c974294a7 (patch) | |
tree | b6819cef59c5c12a2ff9aba4e2868389e0f14e16 /dev-python/python-afl | |
parent | dev-util/drone-cli: Update snapshot (diff) | |
download | gentoo-eb0f9c2b43bf998b5dd48066fe146a0c974294a7.tar.gz gentoo-eb0f9c2b43bf998b5dd48066fe146a0c974294a7.tar.bz2 gentoo-eb0f9c2b43bf998b5dd48066fe146a0c974294a7.zip |
dev-python/python-afl: Apply patch to fix test, thanks to Jakub Wilk
Package-Manager: Portage-2.3.6, Repoman-2.3.2
Diffstat (limited to 'dev-python/python-afl')
-rw-r--r-- | dev-python/python-afl/files/python-afl-0.6-fix-test.patch | 41 | ||||
-rw-r--r-- | dev-python/python-afl/python-afl-0.6.ebuild | 6 |
2 files changed, 42 insertions, 5 deletions
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 new file mode 100644 index 000000000000..1243385b8119 --- /dev/null +++ b/dev-python/python-afl/files/python-afl-0.6-fix-test.patch @@ -0,0 +1,41 @@ +From 4c138687008a3d212906367a315ea79b6f6727c9 Mon Sep 17 00:00:00 2001 +From: Jakub Wilk <jwilk@jwilk.net> +Date: Thu, 29 Jun 2017 20:54:08 +0200 +Subject: [PATCH] tests/tools: fake $PWD so that is starts with ///. + +This is needed to skip overzealous /tmp checks in afl-cmap. + +Fixes: + + ====================================================================== + ERROR: tests.test_cmin.test + ---------------------------------------------------------------------- + Traceback (most recent call last): + File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest + self.test(*self.arg) + File "/tmp/.../tests/test_cmin.py", line 68, in test + b'1', + File "/tmp/.../tests/test_cmin.py", line 51, in run_afl_cmin + run(cmdline) + File "/tmp/.../tests/tools.py", line 148, in run + raise ipc.CalledProcessError(child.returncode, cmd[0]) + CalledProcessError: Command 'py-afl-cmin' returned non-zero exit status 1 + -------------------- >> begin captured stdout << --------------------- + ... + [-] Error: do not use this script in /tmp or /var/tmp. +--- + tests/tools.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tests/tools.py b/tests/tools.py +index 0c9240c..f3ebab1 100644 +--- a/tests/tools.py ++++ b/tests/tools.py +@@ -131,6 +131,7 @@ def clean_environ(): + os.environ['AFL_SKIP_CPUFREQ'] = '1' + os.environ['AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES'] = '1' + os.environ['AFL_NO_AFFINITY'] = '1' ++ os.environ['PWD'] = '//' + os.getcwd() + + def run(cmd, stdin='', xstatus=0): + child = ipc.Popen( diff --git a/dev-python/python-afl/python-afl-0.6.ebuild b/dev-python/python-afl/python-afl-0.6.ebuild index cb3375a8e445..7bfa986eb622 100644 --- a/dev-python/python-afl/python-afl-0.6.ebuild +++ b/dev-python/python-afl/python-afl-0.6.ebuild @@ -19,11 +19,7 @@ RDEPEND="app-forensics/afl" DEPEND=">=dev-python/cython-0.19[${PYTHON_USEDEP}] test? ( dev-python/nose[${PYTHON_USEDEP}] )" -python_prepare_all() { - # afl-cmin errors with: "Error: do not use this script in /tmp or /var/tmp" - rm tests/test_cmin.py || die - distutils-r1_python_prepare_all -} +PATCHES=( "${FILESDIR}"/${P}-fix-test.patch ) python_test() { PATH="${PATH}:." nosetests --verbose || die |