Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.09 backport] Fixes for e2e testing after Alpine bump #1729

Merged

Conversation

thaJeztah
Copy link
Member

backport of #1728 for 18.09


Somewhere between Thursday and Friday last week the docker:test-dind image was updated from an alpine 3.9.0 base to 3.9.2. This broke the use of chsh in e2e/testdata/Dockerfile.connhelper-ssh:

Step 1/6 : FROM docker:test-dind
test-dind: Pulling from library/docker
Digest: sha256:ec353956a21300964a7eb2b620a742c2730f618f4df35f60609b30969cd83ce8
Status: Downloaded newer image for docker:test-dind
 ---> 85e924caedbd
Step 2/6 : RUN apk --no-cache add shadow openssh-server &&   groupadd -f docker &&   useradd -m penguin &&   usermod -aG docker penguin &&   usermod -p $(head -c32 /dev/urandom | base64) penguin &&   chsh -s /bin/sh penguin &&   ssh-keygen -A
 ---> Running in 35e0398d93bd
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/5) Installing openssh-keygen (7.9_p1-r4)
(2/5) Installing openssh-server-common (7.9_p1-r4)
(3/5) Installing openssh-server (7.9_p1-r4)
(4/5) Installing linux-pam (1.3.0-r0)
(5/5) Installing shadow (4.5-r0)
Executing busybox-1.29.3-r10.trigger
OK: 22 MiB in 44 packages
�[91mCreating mailbox file: No such file or directory
�[0m�[91mPassword: �[0m�[91mchsh: PAM: Authentication token manipulation error
�[0mService 'engine' failed to build: The command '/bin/sh -c apk --no-cache add shadow openssh-server &&   groupadd -f docker &&   useradd -m penguin &&   usermod -aG docker penguin &&   usermod -p $(head -c32 /dev/urandom | base64) penguin &&   chsh -s /bin/sh penguin &&   ssh-keygen -A' returned a non-zero code: 1
docker.Makefile:152: recipe for target 'test-e2e-connhelper-ssh' failed
make: *** [test-e2e-connhelper-ssh] Error 1

(this seems to relate to root's entry in /etc/shadow changing from root:::0:::::\nbin:!::0::::: to root:!::0:::::\nbin:!::0:::::).

Avoid this by just using the --shell option to useradd instead.

Also simplify things by using --password instead of usermod -p (even though this was not broken) and also spell out -m in full as --create-home for clarity.

Ian Campbell added 3 commits March 12, 2019 10:35
... in preference to `chsh`, since in recent alpine 3.9.2 images that can fail
with:

    Password: chsh: PAM: Authentication token manipulation error

Which seems to relate to the use of `!` as the password for `root` in `/etc/shadow`gq

Signed-off-by: Ian Campbell <[email protected]>
(cherry picked from commit 5de2d9e)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
... for improved readability

Signed-off-by: Ian Campbell <[email protected]>
(cherry picked from commit e854a9c)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Ian Campbell <[email protected]>
(cherry picked from commit 0b0c578)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@codecov-io
Copy link

Codecov Report

Merging #1729 into 18.09 will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##            18.09    #1729   +/-   ##
=======================================
  Coverage   54.09%   54.09%           
=======================================
  Files         290      290           
  Lines       19406    19406           
=======================================
  Hits        10498    10498           
  Misses       8236     8236           
  Partials      672      672

1 similar comment
@codecov-io
Copy link

Codecov Report

Merging #1729 into 18.09 will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##            18.09    #1729   +/-   ##
=======================================
  Coverage   54.09%   54.09%           
=======================================
  Files         290      290           
  Lines       19406    19406           
=======================================
  Hits        10498    10498           
  Misses       8236     8236           
  Partials      672      672

@thaJeztah
Copy link
Member Author

ping @vdemeester @silvin-lubecki PTAL 🤗

Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯

@vdemeester vdemeester merged commit 890e29d into docker:18.09 Mar 12, 2019
@thaJeztah thaJeztah deleted the 18.09_backport_e2e_handle_alpine_bump branch March 12, 2019 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants