Merge pull request #5709 from mnottale/exec-workdir

Add '--workdir' option to 'exec'.
This commit is contained in:
Joffrey F 2018-03-02 15:28:07 -08:00 • committed by GitHub
commit 38f7fdfe89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View file

@ -1559,6 +1559,16 @@ class CLITestCase(DockerClientTestCase):
assert stdout == "operator\n"
assert stderr == ""
@v3_only()
def test_exec_workdir(self):
self.base_dir = 'tests/fixtures/links-composefile'
os.environ['COMPOSE_API_VERSION'] = '1.35'
self.dispatch(['up', '-d', 'console'])
assert len(self.project.containers()) == 1
stdout, stderr = self.dispatch(['exec', '-T', '--workdir', '/etc', 'console', 'ls'])
assert 'passwd' in stdout
@v2_2_only()
def test_exec_service_with_environment_overridden(self):
name = 'service'