Commit 167a0cb0 authored by Peter Parente's avatar Peter Parente

Fix mount test on CI

parent 803dc0c7
...@@ -90,23 +90,25 @@ def test_host_mount(container, tmpdir): ...@@ -90,23 +90,25 @@ def test_host_mount(container, tmpdir):
"""Container should start the notebook server properly when """Container should start the notebook server properly when
the user home directory is host mounted. the user home directory is host mounted.
""" """
path = tmpdir.mkdir('home').join('test.sh') home = tmpdir.mkdir('home')
path.write('''\ home.chmod(0o777)
script = home.join('test.sh')
script.write('''\
#!/bin/bash #!/bin/bash
echo "test content" > test.txt echo "test content" > test.txt
cat test.txt cat test.txt
''') ''')
path.chmod(0o755) script.chmod(0o755)
c = container.run( c = container.run(
volumes={ volumes={
path.dirname: {'bind': '/home/jovyan', 'mode': 'rw'}, home.strpath: {'bind': '/home/jovyan', 'mode': 'rw'},
}, },
command=['start.sh', '/home/jovyan/test.sh'] command=['start.sh', '/home/jovyan/test.sh']
) )
rv = c.wait(timeout=5) rv = c.wait(timeout=5)
stdout = c.logs(stdout=True).decode('utf-8') stdout = c.logs(stdout=True).decode('utf-8')
print(stdout)
assert rv == 0 assert rv == 0
assert 'test content' in stdout assert 'test content' in stdout
Markdown is supported
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