Supported group_add

Signed-off-by: George Lester <glester491@gmail.com>
This commit is contained in:
George Lester 2016-07-08 00:29:13 -07:00
commit dada36f732
6 changed files with 53 additions and 1 deletions

View file

@ -867,6 +867,14 @@ class ServiceTest(DockerClientTestCase):
container = create_and_start_container(service)
self.assertEqual(container.get('HostConfig.OomScoreAdj'), 500)
def test_group_add_value(self):
service = self.create_service('web', group_add=["root", "1"])
container = create_and_start_container(service)
host_container_groupadd = container.get('HostConfig.GroupAdd')
self.assertTrue("root" in host_container_groupadd)
self.assertTrue("1" in host_container_groupadd)
def test_restart_on_failure_value(self):
service = self.create_service('web', restart={
'Name': 'on-failure',

View file

@ -1289,6 +1289,26 @@ class ConfigTest(unittest.TestCase):
}
]
def test_group_add_option(self):
actual = config.load(build_config_details({
'version': '2',
'services': {
'web': {
'image': 'alpine',
'group_add': ["docker", 777]
}
}
}))
assert actual.services == [
{
'name': 'web',
'image': 'alpine',
'group_add': ["docker", 777]
}
]
def test_merge_service_dicts_from_files_with_extends_in_base(self):
base = {
'volumes': ['.:/app'],