"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/test_cli.py" between
keystone-17.0.0.tar.gz and keystone-18.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Victoria" series (latest release).

test_cli.py  (keystone-17.0.0):test_cli.py  (keystone-18.0.0)
skipping to change at line 945 skipping to change at line 945
self.config_fixture.config(group='cache', self.config_fixture.config(group='cache',
backend='dogpile.cache.memory') backend='dogpile.cache.memory')
self.assertFalse(caching.symptom_caching_enabled_without_a_backend()) self.assertFalse(caching.symptom_caching_enabled_without_a_backend())
# Failure Case 3: Caching enabled and backend configured # Failure Case 3: Caching enabled and backend configured
self.config_fixture.config(group='cache', enabled=True) self.config_fixture.config(group='cache', enabled=True)
self.config_fixture.config(group='cache', self.config_fixture.config(group='cache',
backend='dogpile.cache.memory') backend='dogpile.cache.memory')
self.assertFalse(caching.symptom_caching_enabled_without_a_backend()) self.assertFalse(caching.symptom_caching_enabled_without_a_backend())
@mock.patch('keystone.cmd.doctor.caching.cache.CACHE_REGION')
def test_symptom_connection_to_memcached(self, cache_mock):
self.config_fixture.config(group='cache', enabled=True)
self.config_fixture.config(
group='cache',
memcache_servers=['alpha.com:11211', 'beta.com:11211']
)
self.config_fixture.config(
group='cache', backend='dogpile.cache.memcached'
)
# No symptom detected: Caching driver can connect to both memcached
# servers
cache_mock.actual_backend.client.get_stats.return_value = (
[('alpha.com', {}), ('beta.com', {})]
)
self.assertFalse(caching.symptom_connection_to_memcached())
# Symptom detected: Caching driver can't connect to either memcached
# server
cache_mock.actual_backend.client.get_stats.return_value = []
self.assertTrue(caching.symptom_connection_to_memcached())
# Symptom detected: Caching driver can't connect to one memcached
# server
cache_mock.actual_backend.client.get_stats.return_value = [
('alpha.com', {})
]
self.assertTrue(caching.symptom_connection_to_memcached())
self.config_fixture.config(
group='cache',
memcache_servers=['alpha.com:11211', 'beta.com:11211']
)
self.config_fixture.config(
group='cache', backend='oslo_cache.memcache_pool'
)
# No symptom detected: Caching driver can connect to both memcached
# servers
cache_mock.actual_backend.client.get_stats.return_value = (
[('alpha.com', {}), ('beta.com', {})]
)
self.assertFalse(caching.symptom_connection_to_memcached())
# Symptom detected: Caching driver can't connect to either memcached
# server
cache_mock.actual_backend.client.get_stats.return_value = []
self.assertTrue(caching.symptom_connection_to_memcached())
# Symptom detected: Caching driver can't connect to one memcached
# server
cache_mock.actual_backend.client.get_stats.return_value = [
('alpha.com', {})
]
self.assertTrue(caching.symptom_connection_to_memcached())
class CredentialDoctorTests(unit.TestCase): class CredentialDoctorTests(unit.TestCase):
def test_credential_and_fernet_key_repositories_match(self): def test_credential_and_fernet_key_repositories_match(self):
# Symptom Detected: Key repository paths are not unique # Symptom Detected: Key repository paths are not unique
directory = self.useFixture(fixtures.TempDir()).path directory = self.useFixture(fixtures.TempDir()).path
self.config_fixture.config(group='credential', self.config_fixture.config(group='credential',
key_repository=directory) key_repository=directory)
self.config_fixture.config(group='fernet_tokens', self.config_fixture.config(group='fernet_tokens',
key_repository=directory) key_repository=directory)
self.assertTrue(credential.symptom_unique_key_repositories()) self.assertTrue(credential.symptom_unique_key_repositories())
skipping to change at line 1296 skipping to change at line 1353
# No Symptom Detected: when minimum_password_age's default value is 0 # No Symptom Detected: when minimum_password_age's default value is 0
# and password_expires_days' default value is None # and password_expires_days' default value is None
self.assertFalse( self.assertFalse(
security_compliance. security_compliance.
symptom_minimum_password_age_greater_than_expires_days()) symptom_minimum_password_age_greater_than_expires_days())
def test_invalid_password_regular_expression(self): def test_invalid_password_regular_expression(self):
# Symptom Detected: Regular expression is invalid # Symptom Detected: Regular expression is invalid
self.config_fixture.config( self.config_fixture.config(
group='security_compliance', group='security_compliance',
password_regex='^^(??=.*\d)$') password_regex=r'^^(??=.*\d)$')
self.assertTrue( self.assertTrue(
security_compliance.symptom_invalid_password_regular_expression()) security_compliance.symptom_invalid_password_regular_expression())
def test_valid_password_regular_expression(self): def test_valid_password_regular_expression(self):
# No Symptom Detected: Regular expression is valid # No Symptom Detected: Regular expression is valid
self.config_fixture.config( self.config_fixture.config(
group='security_compliance', group='security_compliance',
password_regex='^(?=.*\d)(?=.*[a-zA-Z]).{7,}$') password_regex=r'^(?=.*\d)(?=.*[a-zA-Z]).{7,}$')
self.assertFalse( self.assertFalse(
security_compliance.symptom_invalid_password_regular_expression()) security_compliance.symptom_invalid_password_regular_expression())
def test_password_regular_expression_deactivated(self): def test_password_regular_expression_deactivated(self):
# No Symptom Detected: Regular expression deactivated to None # No Symptom Detected: Regular expression deactivated to None
self.config_fixture.config( self.config_fixture.config(
group='security_compliance', group='security_compliance',
password_regex=None) password_regex=None)
self.assertFalse( self.assertFalse(
security_compliance.symptom_invalid_password_regular_expression()) security_compliance.symptom_invalid_password_regular_expression())
def test_password_regular_expression_description_not_set(self): def test_password_regular_expression_description_not_set(self):
# Symptom Detected: Regular expression is set but description is not # Symptom Detected: Regular expression is set but description is not
self.config_fixture.config( self.config_fixture.config(
group='security_compliance', group='security_compliance',
password_regex='^(?=.*\d)(?=.*[a-zA-Z]).{7,}$') password_regex=r'^(?=.*\d)(?=.*[a-zA-Z]).{7,}$')
self.config_fixture.config( self.config_fixture.config(
group='security_compliance', group='security_compliance',
password_regex_description=None) password_regex_description=None)
self.assertTrue( self.assertTrue(
security_compliance. security_compliance.
symptom_password_regular_expression_description_not_set()) symptom_password_regular_expression_description_not_set())
def test_password_regular_expression_description_set(self): def test_password_regular_expression_description_set(self):
# No Symptom Detected: Regular expression and description are set # No Symptom Detected: Regular expression and description are set
desc = '1 letter, 1 digit, and a minimum length of 7 is required' desc = '1 letter, 1 digit, and a minimum length of 7 is required'
self.config_fixture.config( self.config_fixture.config(
group='security_compliance', group='security_compliance',
password_regex='^(?=.*\d)(?=.*[a-zA-Z]).{7,}$') password_regex=r'^(?=.*\d)(?=.*[a-zA-Z]).{7,}$')
self.config_fixture.config( self.config_fixture.config(
group='security_compliance', group='security_compliance',
password_regex_description=desc) password_regex_description=desc)
self.assertFalse( self.assertFalse(
security_compliance. security_compliance.
symptom_password_regular_expression_description_not_set()) symptom_password_regular_expression_description_not_set())
def test_password_regular_expression_description_deactivated(self): def test_password_regular_expression_description_deactivated(self):
# No Symptom Detected: Regular expression and description are # No Symptom Detected: Regular expression and description are
# deactivated to None # deactivated to None
 End of changes. 5 change blocks. 
4 lines changed or deleted 61 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)