File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,10 @@ else
199199 rm /tmp/passwd
200200
201201 _log " Added new ${NB_USER} user ($( id -u) :$( id -g) ). Fixed UID!"
202+
203+ if [[ " ${NB_USER} " != " jovyan" ]]; then
204+ _log " WARNING: user is ${NB_USER} but home is /home/jovyan. You must run as root to rename the home directory!"
205+ fi
202206 else
203207 _log " WARNING: unable to fix missing /etc/passwd entry because we don't have write permission. Try setting gid=0 with \" --user=$( id -u) :0\" ."
204208 fi
Original file line number Diff line number Diff line change @@ -286,8 +286,12 @@ def test_set_uid_and_nb_user(container):
286286 assert rv == 0 or rv ["StatusCode" ] == 0
287287 logs = c .logs (stdout = True ).decode ("utf-8" )
288288 assert "ERROR" not in logs
289- assert "WARNING" not in logs
290289 assert "uid=1010(kitten) gid=0(root)" in logs
290+ warnings = [
291+ warning for warning in logs .split ("\n " ) if warning .startswith ("WARNING" )
292+ ]
293+ assert len (warnings ) == 1
294+ assert "user is kitten but home is /home/jovyan" in warnings [0 ]
291295
292296
293297def test_container_not_delete_bind_mount (container , tmp_path ):
You can’t perform that action at this time.
0 commit comments