Commit f4bb5cda authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[test][docker] Add test for workdir property

parent 79915517
......@@ -39,7 +39,10 @@ import time
import requests
import nose
from tempfile import TemporaryDirectory
from ..dock import Host
from . import tmp_prefix
from .utils import slow
from .utils import skipif
......@@ -136,6 +139,31 @@ class EnvironmentVariableTest(NoDiscoveryTests):
self.assertTrue('DOCKER_TEST=good' in
class WorkdirTest(NoDiscoveryTests):
def test_workdir(self):
"""Test that the workdir property is correctly used.
with TemporaryDirectory() as tmp_folder:
test_file = "test.txt"
container ='debian:8.4', ["cp", "/etc/debian_version", test_file])
container.add_volume(tmp_folder, '/test_workdir', read_only=False)
status =
if status != 0:
self.assertEqual(status, 0)
with open(os.path.join(tmp_folder, test_file), "rt") as file:
content =
self.assertEqual(content, "8.4\n")
class AsyncTest(NoDiscoveryTests):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment