Skip to content

Commit e29f669

Browse files
committed
Added CHOWN_EXTRA test.
Signed-off-by: Brett Randall <[email protected]>
1 parent 2d9aa71 commit e29f669

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

base-notebook/test/test_container_options.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,23 @@ def test_gid_change(container):
6161
assert 'groups=110(jovyan),100(users)' in logs
6262

6363

64+
def test_chown_extra(container):
65+
"""Container should change the UID/GID of CHOWN_EXTRA."""
66+
c = container.run(
67+
tty=True,
68+
user='root',
69+
environment=['NB_UID=1010',
70+
'NB_GID=101',
71+
'CHOWN_EXTRA=/opt/conda',
72+
'CHOWN_EXTRA_OPTS=-R',
73+
],
74+
command=['start.sh', 'bash', '-c', 'stat -c \'%n:%u:%g\' /opt/conda/LICENSE.txt']
75+
)
76+
# chown is slow so give it some time
77+
c.wait(timeout=120)
78+
assert '/opt/conda/LICENSE.txt:1010:101' in c.logs(stdout=True).decode('utf-8')
79+
80+
6481
def test_sudo(container):
6582
"""Container should grant passwordless sudo to the default user."""
6683
c = container.run(

0 commit comments

Comments
 (0)