summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamian Johnson <atagar@torproject.org>2014-12-13 14:00:34 -0800
committerDamian Johnson <atagar@torproject.org>2014-12-13 14:02:57 -0800
commit887d50f9b24151e87e010f8d9c6c12d1bb45bd8d (patch)
tree4065fa0ee6c209d2dd6c9d05046a7376e2976710
parenta63e4eeba44be24f258547c93be23263b8c95ddd (diff)
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
-rw-r--r--stem/util/connection.py4
-rw-r--r--test/integ/util/proc.py4
-rw-r--r--test/unit/util/connection.py1
3 files changed, 3 insertions, 6 deletions
diff --git a/stem/util/connection.py b/stem/util/connection.py
index ac4bf27e..181d1483 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 3fac9eb1..10479128 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 179ebdfa..f0359eb0 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'))