diff options
author | Joffrey F <f.joffrey@gmail.com> | 2018-02-26 10:42:59 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-26 10:42:59 -0800 |
commit | ec0de7eb68967b5bacf9398dd473b89905dc5a86 (patch) | |
tree | 7983db97939fa2ec218ab6a273e41c5d6145eb29 /tests/acceptance/cli_test.py | |
parent | 6659e99aff206f88202ad465de6846d3a7d362ed (diff) | |
parent | 51076b5e1280aa316b4a3eaf7ab636357ed467e1 (diff) |
Merge pull request #5684 from docker/compat_mode
Compatibility mode
Diffstat (limited to 'tests/acceptance/cli_test.py')
-rw-r--r-- | tests/acceptance/cli_test.py | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/tests/acceptance/cli_test.py b/tests/acceptance/cli_test.py index 79686157..42b487aa 100644 --- a/tests/acceptance/cli_test.py +++ b/tests/acceptance/cli_test.py @@ -395,7 +395,7 @@ class CLITestCase(DockerClientTestCase): result = self.dispatch(['config']) assert yaml.load(result.stdout) == { - 'version': '3.2', + 'version': '3.5', 'volumes': { 'foobar': { 'labels': { @@ -419,22 +419,25 @@ class CLITestCase(DockerClientTestCase): }, 'resources': { 'limits': { - 'cpus': '0.001', + 'cpus': '0.05', 'memory': '50M', }, 'reservations': { - 'cpus': '0.0001', + 'cpus': '0.01', 'memory': '20M', }, }, 'restart_policy': { - 'condition': 'on_failure', + 'condition': 'on-failure', 'delay': '5s', 'max_attempts': 3, 'window': '120s', }, 'placement': { - 'constraints': ['node=foo'], + 'constraints': [ + 'node.hostname==foo', 'node.role != manager' + ], + 'preferences': [{'spread': 'node.labels.datacenter'}] }, }, @@ -464,6 +467,27 @@ class CLITestCase(DockerClientTestCase): }, } + def test_config_compatibility_mode(self): + self.base_dir = 'tests/fixtures/compatibility-mode' + result = self.dispatch(['--compatibility', 'config']) + + assert yaml.load(result.stdout) == { + 'version': '2.3', + 'volumes': {'foo': {'driver': 'default'}}, + 'services': { + 'foo': { + 'command': '/bin/true', + 'image': 'alpine:3.7', + 'scale': 3, + 'restart': 'always:7', + 'mem_limit': '300M', + 'mem_reservation': '100M', + 'cpus': 0.7, + 'volumes': ['foo:/bar:rw'] + } + } + } + def test_ps(self): self.project.get_service('simple').create_container() result = self.dispatch(['ps']) |