From d75020b33541ade07c8c9415e29992042896ef19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Fri, 11 Feb 2022 14:51:38 +0100 Subject: [PATCH] Use the right backend for TLS tests The TLS features were introduced to be consummed by the dogpile.cache.pymemcache backend [1][2], however, the tests modified by this commit do not instantiate the dogpile.cache.pymemcache backend but rather the oslo_cache.dict backend which won't consumme the TLS arguments. These tests do not really reflects the thing they were made for. The oslo.cache.dict backend do not expect TLS options [3] whereas the dogpile.cache.memcached module (and backend) expect TLS context [4]. This patch propose to switch to the right backend. [1] https://opendev.org/openstack/oslo.cache/commit/996036acd7b1376f0a378a407697afa28e5b2861 [2] https://github.com/sqlalchemy/dogpile.cache/commit/a2e25bc743a48d91705d944e52aa667ebff10943 [3] https://opendev.org/openstack/oslo.cache/src/branch/master/oslo_cache/backends/dictionary.py [4] https://github.com/sqlalchemy/dogpile.cache/search?q=tls_context Change-Id: Ia28ce314044f5790372e6a75dd5d6ae0407bec74 --- oslo_cache/tests/unit/test_cache_basics.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oslo_cache/tests/unit/test_cache_basics.py b/oslo_cache/tests/unit/test_cache_basics.py index ba3a3d1a..bb8d48b7 100644 --- a/oslo_cache/tests/unit/test_cache_basics.py +++ b/oslo_cache/tests/unit/test_cache_basics.py @@ -281,7 +281,7 @@ class CacheRegionTest(test_cache.BaseTestCase): self.config_fixture.config(group='cache', enabled=True, config_prefix='test_prefix', - backend='oslo_cache.dict', + backend='dogpile.cache.pymemcache', tls_cafile='path_to_ca_file', tls_keyfile='path_to_key_file', tls_certfile='path_to_cert_file', @@ -299,7 +299,7 @@ class CacheRegionTest(test_cache.BaseTestCase): self.config_fixture.config(group='cache', enabled=True, config_prefix='test_prefix', - backend='oslo_cache.dict', + backend='dogpile.cache.pymemcache', tls_enabled=True) fake_context = mock.Mock() @@ -323,7 +323,7 @@ class CacheRegionTest(test_cache.BaseTestCase): self.config_fixture.config(group='cache', enabled=True, config_prefix='test_prefix', - backend='oslo_cache.dict', + backend='dogpile.cache.pymemcache', tls_enabled=True, tls_cafile='path_to_ca_file', tls_keyfile='path_to_key_file',