mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:45:22 +02:00
Uncomment simplehttp/dvsni port check
This commit is contained in:
@@ -7,6 +7,7 @@ import zope.interface
|
||||
from acme import challenges
|
||||
|
||||
from letsencrypt import constants
|
||||
from letsencrypt import errors
|
||||
from letsencrypt import interfaces
|
||||
|
||||
|
||||
@@ -36,11 +37,10 @@ class NamespaceConfig(object):
|
||||
def __init__(self, namespace):
|
||||
self.namespace = namespace
|
||||
|
||||
# XXX: breaks renewer in some bizarre way
|
||||
#if self.simple_http_port == self.dvsni_port:
|
||||
# raise errors.Error(
|
||||
# "Trying to run SimpleHTTP non-TLS and DVSNI "
|
||||
# "on the same port ({0})".format(self.dvsni_port))
|
||||
if self.simple_http_port == self.dvsni_port:
|
||||
raise errors.Error(
|
||||
"Trying to run SimpleHTTP and DVSNI "
|
||||
"on the same port ({0})".format(self.dvsni_port))
|
||||
|
||||
def __getattr__(self, name):
|
||||
return getattr(self.namespace, name)
|
||||
|
||||
@@ -4,6 +4,8 @@ import unittest
|
||||
|
||||
import mock
|
||||
|
||||
from letsencrypt import errors
|
||||
|
||||
|
||||
class NamespaceConfigTest(unittest.TestCase):
|
||||
"""Tests for letsencrypt.configuration.NamespaceConfig."""
|
||||
@@ -12,10 +14,15 @@ class NamespaceConfigTest(unittest.TestCase):
|
||||
self.namespace = mock.MagicMock(
|
||||
config_dir='/tmp/config', work_dir='/tmp/foo', foo='bar',
|
||||
server='https://acme-server.org:443/new',
|
||||
dvsni_port='1234', simple_http_port=4321)
|
||||
dvsni_port=1234, simple_http_port=4321)
|
||||
from letsencrypt.configuration import NamespaceConfig
|
||||
self.config = NamespaceConfig(self.namespace)
|
||||
|
||||
def test_init_same_ports(self):
|
||||
self.namespace.dvsni_port = 4321
|
||||
from letsencrypt.configuration import NamespaceConfig
|
||||
self.assertRaises(errors.Error, NamespaceConfig, self.namespace)
|
||||
|
||||
def test_proxy_getattr(self):
|
||||
self.assertEqual(self.config.foo, 'bar')
|
||||
self.assertEqual(self.config.work_dir, '/tmp/foo')
|
||||
|
||||
Reference in New Issue
Block a user