Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
Jupyter Docker Stacks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Jupyter Docker Stacks
Commits
803dc0c7
Commit
803dc0c7
authored
Dec 01, 2017
by
Peter Parente
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bogus assert, add mount test
parent
463490fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
base-notebook/test/test_container_options.py
base-notebook/test/test_container_options.py
+24
-13
No files found.
base-notebook/test/test_container_options.py
View file @
803dc0c7
...
@@ -71,31 +71,42 @@ def test_sudo(container):
...
@@ -71,31 +71,42 @@ def test_sudo(container):
assert
rv
==
0
assert
rv
==
0
assert
'uid=0(root)'
in
c
.
logs
(
stdout
=
True
)
.
decode
(
'utf-8'
)
assert
'uid=0(root)'
in
c
.
logs
(
stdout
=
True
)
.
decode
(
'utf-8'
)
@
pytest
.
mark
.
dev
def
test_group_add
(
container
):
def
test_group_add
(
container
,
tmpdir
):
"""Container should run with the specified uid, gid, and secondary
"""Container should run with the specified uid, gid, and secondary
group
, but retain unprivileged access to the conda path
.
group.
"""
"""
c
=
container
.
run
(
c
=
container
.
run
(
user
=
'1010:1010'
,
user
=
'1010:1010'
,
group_add
=
[
'users'
],
group_add
=
[
'users'
],
command
=
[
'start.sh'
,
'
bash'
,
'-c'
,
'id && touch /opt/conda/test-file
'
]
command
=
[
'start.sh'
,
'
id
'
]
)
)
rv
=
c
.
wait
(
timeout
=
5
)
rv
=
c
.
wait
(
timeout
=
5
)
assert
rv
==
0
assert
rv
==
0
assert
'uid=1010 gid=1010 groups=1010,100(users)'
in
c
.
logs
(
stdout
=
True
)
.
decode
(
'utf-8'
)
assert
'uid=1010 gid=1010 groups=1010,100(users)'
in
c
.
logs
(
stdout
=
True
)
.
decode
(
'utf-8'
)
@
pytest
.
mark
.
dev
@
pytest
.
mark
.
skip
(
'placeholder'
)
def
test_host_mount
(
container
,
tmpdir
):
def
test_host_mount
(
container
):
"""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.
"""
"""
pass
path
=
tmpdir
.
mkdir
(
'home'
)
.
join
(
'test.sh'
)
path
.
write
(
'''
\
#!/bin/bash
echo "test content" > test.txt
cat test.txt
'''
)
path
.
chmod
(
0o755
)
@
pytest
.
mark
.
skip
(
'placeholder'
)
c
=
container
.
run
(
def
test_alt_command
():
volumes
=
{
"""Container should launch an alternative command."""
path
.
dirname
:
{
'bind'
:
'/home/jovyan'
,
'mode'
:
'rw'
},
pass
},
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment