
commit 887d50f9b24151e87e010f8d9c6c12d1bb45bd8d Author: Damian Johnson <atagar@torproject.org> Date: Sat Dec 13 14:00:34 2014 -0800 Revert removal of connection resolvers on Gentoo Reverting our earlier change to drop connection resolvers due to tests failing under Gentoo with grsecurity... https://trac.torproject.org/projects/tor/ticket/13904#comment:30 --- stem/util/connection.py | 4 +--- test/integ/util/proc.py | 4 ++-- test/unit/util/connection.py | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/stem/util/connection.py b/stem/util/connection.py index ac4bf27..181d148 100644 --- a/stem/util/connection.py +++ b/stem/util/connection.py @@ -258,8 +258,6 @@ def system_resolvers(system = None): resolvers = [] elif system in ('Darwin', 'OpenBSD'): resolvers = [Resolver.LSOF] - elif system == 'Gentoo': - resolvers = [] elif system == 'FreeBSD': # Netstat is available, but lacks a '-p' equivilant so we can't associate # the results to processes. The platform also has a ss command, but it @@ -277,7 +275,7 @@ def system_resolvers(system = None): # proc resolution, by far, outperforms the others so defaults to this is able - if stem.util.proc.is_available() and os.access('/proc/net/tcp', os.R_OK) and os.access('/proc/net/udp', os.R_OK) and system != 'Gentoo': + if stem.util.proc.is_available() and os.access('/proc/net/tcp', os.R_OK) and os.access('/proc/net/udp', os.R_OK): resolvers = [Resolver.PROC] + resolvers return resolvers diff --git a/test/integ/util/proc.py b/test/integ/util/proc.py index 3fac9eb..1047912 100644 --- a/test/integ/util/proc.py +++ b/test/integ/util/proc.py @@ -8,7 +8,7 @@ import unittest import test.runner -from stem.util import proc, system +from stem.util import proc class TestProc(unittest.TestCase): @@ -90,7 +90,7 @@ class TestProc(unittest.TestCase): elif not test.runner.get_runner().is_ptraceable(): test.runner.skip(self, '(DisableDebuggerAttachment is set)') return - elif not os.access('/proc/net/tcp', os.R_OK) or not os.access('/proc/net/udp', os.R_OK) or system.is_gentoo(): + elif not os.access('/proc/net/tcp', os.R_OK) or not os.access('/proc/net/udp', os.R_OK): test.runner.skip(self, '(proc lacks read permissions)') return diff --git a/test/unit/util/connection.py b/test/unit/util/connection.py index 179ebdf..f0359eb 100644 --- a/test/unit/util/connection.py +++ b/test/unit/util/connection.py @@ -117,7 +117,6 @@ class TestConnection(unittest.TestCase): self.assertEqual([], stem.util.connection.system_resolvers('Windows')) self.assertEqual([Resolver.LSOF], stem.util.connection.system_resolvers('Darwin')) - self.assertEqual([], stem.util.connection.system_resolvers('Gentoo')) self.assertEqual([Resolver.LSOF], stem.util.connection.system_resolvers('OpenBSD')) self.assertEqual([Resolver.BSD_SOCKSTAT, Resolver.BSD_PROCSTAT, Resolver.LSOF], stem.util.connection.system_resolvers('FreeBSD')) self.assertEqual([Resolver.NETSTAT, Resolver.SOCKSTAT, Resolver.LSOF, Resolver.SS], stem.util.connection.system_resolvers('Linux'))