commit f65af3782f39e966197ad2e911f39a36d2e2d2d2
Author: Damian Johnson <[email protected]>
Date:   Wed Nov 25 07:59:24 2015 -0800

    Drop tor man page workarounds
    
    Nick's merged our man page fixes so we can now drop our workarounds - yay! 
\o/
    
      https://trac.torproject.org/projects/tor/ticket/17666
    
    I'm dropping our assertions on exact counts of configuration options since
    they'll break with every man page update and aren't really helpful. Instead
    just checking that the categories themselves still exist and that we 
recognize
    all the categories.
---
 stem/settings.cfg    |   14 +++++++-------
 test/integ/manual.py |   52 +++++++++-----------------------------------------
 2 files changed, 16 insertions(+), 50 deletions(-)

diff --git a/stem/settings.cfg b/stem/settings.cfg
index d770dfc..78bf014 100644
--- a/stem/settings.cfg
+++ b/stem/settings.cfg
@@ -22,7 +22,7 @@ manual.important User
 manual.important Bridge
 manual.important ExcludeNodes
 manual.important MaxCircuitDirtiness
-manual.important SOCKSPort
+manual.important SocksPort
 manual.important UseBridges
 
 manual.important BridgeRelay
@@ -148,8 +148,8 @@ manual.summary.MaxCircuitDirtiness Duration for reusing 
constructed circuits
 manual.summary.MaxClientCircuitsPending Number of circuits that can be in 
construction at once
 manual.summary.NodeFamily Define relays as belonging to a family
 manual.summary.EnforceDistinctSubnets Prevent use of multiple relays from the 
same subnet on a circuit
-manual.summary.SOCKSPort Port for using tor as a Socks proxy
-manual.summary.SOCKSListenAddress Address from which Socks connections can be 
made
+manual.summary.SocksPort Port for using tor as a Socks proxy
+manual.summary.SocksListenAddress Address from which Socks connections can be 
made
 manual.summary.SocksPolicy Access policy for the pocks port
 manual.summary.SocksTimeout Time until idle or unestablished socks connections 
are closed
 manual.summary.TokenBucketRefillInterval Frequency at which exhausted 
connections are checked for new traffic
@@ -259,7 +259,6 @@ manual.summary.OfflineMasterKey Don't generate the master 
secret key
 # Directory Server Options
 
 manual.summary.DirPortFrontPage Publish this html file on the DirPort
-manual.summary.HidServDirectoryV2 Toggles accepting version 2 hidden service 
descriptors
 manual.summary.DirPort Port for directory connections
 manual.summary.DirListenAddress Address the directory service is bound to
 manual.summary.DirPolicy Access policy for the DirPort
@@ -270,7 +269,7 @@ manual.summary.AuthoritativeDirectory Act as a directory 
authority
 manual.summary.V3AuthoritativeDirectory Generates a version 3 consensus
 manual.summary.VersioningAuthoritativeDirectory Provides opinions on 
recommended versions of tor
 manual.summary.RecommendedVersions Suggested versions of tor
-manual.summary.RecommendedPackageVersions Suggested versions of applications 
other than tor
+manual.summary.RecommendedPackages Suggested versions of applications other 
than tor
 manual.summary.RecommendedClientVersions Tor versions believed to be safe for 
clients
 manual.summary.BridgeAuthoritativeDir Acts as a bridge authority
 manual.summary.MinUptimeHidServDirectoryV2 Required uptime before accepting 
hidden service directory
@@ -297,7 +296,6 @@ manual.summary.V3AuthNIntervalsValid Number of voting 
intervals a consensus is v
 manual.summary.V3BandwidthsFile Path to a file containing measured relay 
bandwidths
 manual.summary.V3AuthUseLegacyKey Signs consensus with both the current and 
legacy keys
 manual.summary.RephistTrackTime Discards old, unchanged reliability information
-manual.summary.VoteOnHidServDirectoriesV2 Determines if the authority votes on 
hidden service directories
 manual.summary.AuthDirHasIPv6Connectivity Descriptors can be retrieved over 
the authority's IPv6 ORPort
 manual.summary.MinMeasuredBWsForAuthToIgnoreAdvertised Total measured value 
before advertised bandwidths are treated as unreliable
 
@@ -348,5 +346,7 @@ manual.summary.TestingEnableTbEmptyEvent Allow controllers 
to request TB_EMPTY e
 manual.summary.TestingMinExitFlagThreshold Lower bound for assigning the Exit 
flag
 manual.summary.TestingLinkCertLifetime Duration of our ed25519 certificate
 manual.summary.TestingAuthKeyLifetime Duration for our ed25519 signing key
-manual.summary.TestingLinkKeySlop Time before expiration that we replace our 
ed25519 key
+manual.summary.TestingLinkKeySlop Time before expiration that we replace our 
ed25519 link key
+manual.summary.TestingAuthKeySlop Time before expiration that we replace our 
ed25519 authentication key
+manual.summary.TestingSigningKeySlop Time before expiration that we replace 
our ed25519 signing key
 
diff --git a/test/integ/manual.py b/test/integ/manual.py
index 72410d2..6a01526 100644
--- a/test/integ/manual.py
+++ b/test/integ/manual.py
@@ -37,17 +37,6 @@ EXPECTED_CATEGORIES = set([
 EXPECTED_CLI_OPTIONS = set(['-h, -help', '-f FILE', '--allow-missing-torrc', 
'--defaults-torrc FILE', '--ignore-missing-torrc', '--hash-password PASSWORD', 
'--list-fingerprint', '--verify-config', '--service install [--options 
command-line options]', '--service remove|start|stop', '--nt-service', 
'--list-torrc-options', '--version', '--quiet|--hush'])
 EXPECTED_SIGNALS = set(['SIGTERM', 'SIGINT', 'SIGHUP', 'SIGUSR1', 'SIGUSR2', 
'SIGCHLD', 'SIGPIPE', 'SIGXFSZ'])
 
-EXPECTED_OPTION_COUNTS = {
-  Category.GENERAL: 74,
-  Category.CLIENT: 86,
-  Category.RELAY: 47,
-  Category.DIRECTORY: 5,
-  Category.AUTHORITY: 34,
-  Category.HIDDEN_SERVICE: 11,
-  Category.TESTING: 32,
-  Category.UNKNOWN: 0,
-}
-
 EXPECTED_DESCRIPTION = """
 Tor is a connection-oriented anonymizing communication service. Users choose a 
source-routed path through a set of nodes, and negotiate a "virtual circuit" 
through the network, in which each node knows its predecessor and successor, 
but no others. Traffic flowing down the circuit is unwrapped by a symmetric key 
at each node, which reveals the downstream node.
 
@@ -181,8 +170,14 @@ class TestManual(unittest.TestCase):
     assert_equal('number of files', 31, len(manual.files))
     assert_equal('lib path description', 'The tor process stores keys and 
other data here.', manual.files['@LOCALSTATEDIR@/lib/tor/'])
 
-    for category, expected_count in EXPECTED_OPTION_COUNTS.items():
-      assert_equal('number of %s category entries' % category, expected_count, 
len([entry for entry in manual.config_options.values() if entry.category == 
category]))
+    for category in Category:
+      if len([entry for entry in manual.config_options.values() if 
entry.category == category]) == 0 and category != Category.UNKNOWN:
+        self.fail('We had an empty %s section, did we intentionally drop it?' 
% category)
+
+    unknown_options = [entry for entry in manual.config_options.values() if 
entry.category == Category.UNKNOWN]
+
+    if unknown_options:
+      self.fail("We don't recognize the category for the %s options. Maybe a 
new man page section? If so then please update the Category enum in 
stem/manual.py." % ', '.join(unknown_options))
 
     option = manual.config_options['BandwidthRate']
     self.assertEqual(Category.GENERAL, option.category)
@@ -230,15 +225,7 @@ class TestManual(unittest.TestCase):
     present = set(manual.config_options.keys())
     expected = set([key[15:] for key in stem.manual._config(lowercase = False) 
if key.startswith('manual.summary.')])
 
-    # TODO: Typo in man page (s/TestingLinkCertifetime/TestingLinkCertLifetime)
-
-    present.remove('TestingLinkCertifetime')
-    present.add('TestingLinkCertLifetime')
-
-    # TODO: The 'Recognized' config name is due to our man page being slightly
-    # malformed. Sending a tor patch later to fix it.
-
-    missing_options = 
present.difference(expected).difference(set(['Recognized']))
+    missing_options = present.difference(expected)
     extra_options = expected.difference(present)
 
     if missing_options:
@@ -268,27 +255,6 @@ class TestManual(unittest.TestCase):
       if 'HiddenServiceOptions' in config_options_in_tor:
         config_options_in_tor.remove('HiddenServiceOptions')
 
-      # TODO: Addressing some errors in the man page I'll be sending fixes for.
-
-      config_options_in_tor.remove('SocksPort')
-      config_options_in_tor.add('SOCKSPort')
-
-      config_options_in_tor.remove('SocksListenAddress')
-      config_options_in_tor.add('SOCKSListenAddress')
-
-      config_options_in_tor.remove('TestingLinkCertLifetime')
-      config_options_in_tor.add('TestingLinkCertifetime')
-
-      config_options_in_tor.remove('TestingSigningKeySlop')
-      config_options_in_tor.remove('TestingAuthKeySlop')
-
-      config_options_in_tor.remove('RecommendedPackages')
-      config_options_in_tor.add('RecommendedPackageVersions')
-
-      config_options_in_tor.add('Recognized')
-      config_options_in_tor.add('VoteOnHidServDirectoriesV2')
-      config_options_in_tor.add('HidServDirectoryV2')
-
       # TODO: Looks like options we should remove from tor...
       #
       # https://trac.torproject.org/projects/tor/ticket/17665



_______________________________________________
tor-commits mailing list
[email protected]
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits

Reply via email to