This commit is contained in:
Milas Bowman 2025-01-23 10:16:45 +00:00 committed by GitHub
commit cb0d6198c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 6 deletions

View File

@ -23,9 +23,12 @@ class LogConfigTypesEnum:
'journald',
'gelf',
'fluentd',
'awslogs',
'splunk',
'etwlogs',
'none'
)
JSON, SYSLOG, JOURNALD, GELF, FLUENTD, NONE = _values
JSON, SYSLOG, JOURNALD, GELF, FLUENTD, AWS, SPLUNK, ETW, NONE = _values
class LogConfig(DictType):

View File

@ -269,9 +269,13 @@ class UlimitTest(unittest.TestCase):
Ulimit(name='hello', hard='456')
class LogConfigTest(unittest.TestCase):
def test_create_host_config_dict_logconfig(self):
dct = {'type': LogConfig.types.SYSLOG, 'config': {'key1': 'val1'}}
@pytest.mark.parametrize(
"log_config_type",
[LogConfig.types.SYSLOG, LogConfig.types.AWS]
)
class LogConfigTest:
def test_create_host_config_dict_logconfig(self, log_config_type):
dct = {'type': log_config_type, 'config': {'key1': 'val1'}}
config = create_host_config(
version=DEFAULT_DOCKER_API_VERSION, log_config=dct
)
@ -279,8 +283,8 @@ class LogConfigTest(unittest.TestCase):
assert isinstance(config['LogConfig'], LogConfig)
assert dct['type'] == config['LogConfig'].type
def test_create_host_config_obj_logconfig(self):
obj = LogConfig(type=LogConfig.types.SYSLOG, config={'key1': 'val1'})
def test_create_host_config_obj_logconfig(self, log_config_type):
obj = LogConfig(type=log_config_type, config={'key1': 'val1'})
config = create_host_config(
version=DEFAULT_DOCKER_API_VERSION, log_config=obj
)