mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-10 11:32:57 +00:00
Fix mount test on CI
This commit is contained in:
@@ -90,23 +90,25 @@ def test_host_mount(container, tmpdir):
|
||||
"""Container should start the notebook server properly when
|
||||
the user home directory is host mounted.
|
||||
"""
|
||||
path = tmpdir.mkdir('home').join('test.sh')
|
||||
path.write('''\
|
||||
home = tmpdir.mkdir('home')
|
||||
home.chmod(0o777)
|
||||
|
||||
script = home.join('test.sh')
|
||||
script.write('''\
|
||||
#!/bin/bash
|
||||
echo "test content" > test.txt
|
||||
cat test.txt
|
||||
''')
|
||||
path.chmod(0o755)
|
||||
script.chmod(0o755)
|
||||
|
||||
c = container.run(
|
||||
volumes={
|
||||
path.dirname: {'bind': '/home/jovyan', 'mode': 'rw'},
|
||||
home.strpath: {'bind': '/home/jovyan', 'mode': 'rw'},
|
||||
},
|
||||
command=['start.sh', '/home/jovyan/test.sh']
|
||||
)
|
||||
rv = c.wait(timeout=5)
|
||||
stdout = c.logs(stdout=True).decode('utf-8')
|
||||
print(stdout)
|
||||
assert rv == 0
|
||||
assert 'test content' in stdout
|
||||
|
||||
|
Reference in New Issue
Block a user