From 9830e5b597ffbfae1781eb486c8cd8b0ba3c5dc7 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Thu, 10 May 2018 11:39:55 +1200 Subject: cadir -> confdir We store a lot more than just the CAs in our configuration directory. Clarify the option name. --- test/mitmproxy/net/test_tcp.py | 2 +- test/mitmproxy/proxy/protocol/test_http2.py | 2 +- test/mitmproxy/proxy/protocol/test_websocket.py | 2 +- test/mitmproxy/proxy/test_config.py | 4 ++-- test/mitmproxy/proxy/test_server.py | 6 +++--- test/mitmproxy/tservers.py | 6 +++--- test/mitmproxy/utils/test_arg_check.py | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) (limited to 'test') diff --git a/test/mitmproxy/net/test_tcp.py b/test/mitmproxy/net/test_tcp.py index db8dff05..b6bb7cc1 100644 --- a/test/mitmproxy/net/test_tcp.py +++ b/test/mitmproxy/net/test_tcp.py @@ -338,7 +338,7 @@ class TestSSLUpstreamCertVerificationWValidCertChain(tservers.ServerTestBase): c.wfile.flush() assert c.rfile.readline() == testval - def test_mode_strict_w_cadir_should_pass(self, tdata): + def test_mode_strict_w_confdir_should_pass(self, tdata): c = tcp.TCPClient(("127.0.0.1", self.port)) with c.connect(): c.convert_to_tls( diff --git a/test/mitmproxy/proxy/protocol/test_http2.py b/test/mitmproxy/proxy/protocol/test_http2.py index 13f28728..b5f21413 100644 --- a/test/mitmproxy/proxy/protocol/test_http2.py +++ b/test/mitmproxy/proxy/protocol/test_http2.py @@ -103,7 +103,7 @@ class _Http2TestBase: upstream_cert=True, ssl_insecure=True ) - opts.cadir = os.path.join(tempfile.gettempdir(), "mitmproxy") + opts.confdir = os.path.join(tempfile.gettempdir(), "mitmproxy") return opts @property diff --git a/test/mitmproxy/proxy/protocol/test_websocket.py b/test/mitmproxy/proxy/protocol/test_websocket.py index 3ce1436a..1f4e2bca 100644 --- a/test/mitmproxy/proxy/protocol/test_websocket.py +++ b/test/mitmproxy/proxy/protocol/test_websocket.py @@ -67,7 +67,7 @@ class _WebSocketTestBase: ssl_insecure=True, websocket=True, ) - opts.cadir = os.path.join(tempfile.gettempdir(), "mitmproxy") + opts.confdir = os.path.join(tempfile.gettempdir(), "mitmproxy") return opts @property diff --git a/test/mitmproxy/proxy/test_config.py b/test/mitmproxy/proxy/test_config.py index a2fd8f37..1da031c6 100644 --- a/test/mitmproxy/proxy/test_config.py +++ b/test/mitmproxy/proxy/test_config.py @@ -6,9 +6,9 @@ from mitmproxy.proxy.config import ProxyConfig class TestProxyConfig: - def test_invalid_cadir(self): + def test_invalid_confdir(self): opts = options.Options() - opts.cadir = "foo" + opts.confdir = "foo" with pytest.raises(exceptions.OptionsError, match="parent directory does not exist"): ProxyConfig(opts) diff --git a/test/mitmproxy/proxy/test_server.py b/test/mitmproxy/proxy/test_server.py index 914f9184..52970c9b 100644 --- a/test/mitmproxy/proxy/test_server.py +++ b/test/mitmproxy/proxy/test_server.py @@ -309,10 +309,10 @@ class TestHTTPSUpstreamServerVerificationWTrustedCert(tservers.HTTPProxyTest): with p.connect(): return p.request("get:/p/242") - def test_verification_w_cadir(self, tdata): + def test_verification_w_confdir(self, tdata): self.options.update( ssl_insecure=False, - ssl_verify_upstream_trusted_cadir=tdata.path( + ssl_verify_upstream_trusted_confdir=tdata.path( "mitmproxy/data/servercert/" ), ssl_verify_upstream_trusted_ca=None, @@ -322,7 +322,7 @@ class TestHTTPSUpstreamServerVerificationWTrustedCert(tservers.HTTPProxyTest): def test_verification_w_pemfile(self, tdata): self.options.update( ssl_insecure=False, - ssl_verify_upstream_trusted_cadir=None, + ssl_verify_upstream_trusted_confdir=None, ssl_verify_upstream_trusted_ca=tdata.path( "mitmproxy/data/servercert/trusted-root.pem" ), diff --git a/test/mitmproxy/tservers.py b/test/mitmproxy/tservers.py index 6f528ec2..ab400396 100644 --- a/test/mitmproxy/tservers.py +++ b/test/mitmproxy/tservers.py @@ -151,7 +151,7 @@ class ProxyTestBase: def teardown_class(cls): # perf: we want to run tests in parallel # should this ever cause an error, travis should catch it. - # shutil.rmtree(cls.cadir) + # shutil.rmtree(cls.confdir) cls.proxy.shutdown() cls.server.shutdown() cls.server2.shutdown() @@ -175,10 +175,10 @@ class ProxyTestBase: @classmethod def get_options(cls): - cls.cadir = os.path.join(tempfile.gettempdir(), "mitmproxy") + cls.confdir = os.path.join(tempfile.gettempdir(), "mitmproxy") return options.Options( listen_port=0, - cadir=cls.cadir, + confdir=cls.confdir, add_upstream_certs_to_client_chain=cls.add_upstream_certs_to_client_chain, ssl_insecure=True, ) diff --git a/test/mitmproxy/utils/test_arg_check.py b/test/mitmproxy/utils/test_arg_check.py index 72913955..0a5edd51 100644 --- a/test/mitmproxy/utils/test_arg_check.py +++ b/test/mitmproxy/utils/test_arg_check.py @@ -10,8 +10,8 @@ from mitmproxy.utils import arg_check @pytest.mark.parametrize('arg, output', [ (["-T"], "-T is deprecated, please use --mode transparent instead"), (["-U"], "-U is deprecated, please use --mode upstream:SPEC instead"), - (["--cadir"], "--cadir is deprecated.\n" - "Please use `--set cadir=value` instead.\n" + (["--confdir"], "--confdir is deprecated.\n" + "Please use `--set confdir=value` instead.\n" "To show all options and their default values use --options"), (["--palette"], "--palette is deprecated.\n" "Please use `--set console_palette=value` instead.\n" -- cgit v1.2.3