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] 996036acd7
[2] a2e25bc743
[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
This commit is contained in:
Hervé Beraud 2022-02-11 14:51:38 +01:00
parent cb118d04ce
commit d75020b335

View File

@ -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',