diff options
author | Joffrey F <joffrey@docker.com> | 2018-03-08 18:03:54 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2018-03-08 18:03:54 -0800 |
commit | 7e3bbef4369d0bcb9ed1e64a13ddbbb2961874a4 (patch) | |
tree | 058f887e7ae87efa47fc99029bf07613a137ef4c /tests/unit/config/config_test.py | |
parent | 331f86c7ce49aad64899f1d320d2085feabf9b42 (diff) |
Preserve security_opt values in extends
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/unit/config/config_test.py')
-rw-r--r-- | tests/unit/config/config_test.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/unit/config/config_test.py b/tests/unit/config/config_test.py index e0329822..7a9bb944 100644 --- a/tests/unit/config/config_test.py +++ b/tests/unit/config/config_test.py @@ -4508,6 +4508,29 @@ class ExtendsTest(unittest.TestCase): for svc in services: assert svc['ports'] == [types.ServicePort('80', None, None, None, None)] + def test_extends_with_security_opt(self): + tmpdir = py.test.ensuretemp('test_extends_with_ports') + self.addCleanup(tmpdir.remove) + tmpdir.join('docker-compose.yml').write(""" + version: '2' + + services: + a: + image: nginx + security_opt: + - apparmor:unconfined + - seccomp:unconfined + + b: + extends: + service: a + """) + services = load_from_filename(str(tmpdir.join('docker-compose.yml'))) + assert len(services) == 2 + for svc in services: + assert types.SecurityOpt.parse('apparmor:unconfined') in svc['security_opt'] + assert types.SecurityOpt.parse('seccomp:unconfined') in svc['security_opt'] + @pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason='paths use slash') class ExpandPathTest(unittest.TestCase): |