Skip to content

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

Merged
vdemeester merged 3 commits into
docker:18.09from
thaJeztah:18.09_backport_e2e_handle_alpine_bump
Mar 12, 2019
Merged

[18.09 backport] Fixes for e2e testing after Alpine bump#1729
vdemeester merged 3 commits into
docker:18.09from
thaJeztah:18.09_backport_e2e_handle_alpine_bump

Conversation

@thaJeztah

Copy link
Copy Markdown
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 <ijc@docker.com>
(cherry picked from commit 5de2d9e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
... for improved readability
Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit e854a9c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit 0b0c578)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@codecov-io

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
MemberAuthor

ping @vdemeester@silvin-lubecki PTAL 🤗

@silvin-lubeckisilvin-lubecki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@vdemeestervdemeester left a comment

Copy link
Copy Markdown
Collaborator

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.09Mar 12, 2019
@thaJeztah
thaJeztah deleted the 18.09_backport_e2e_handle_alpine_bump branch March 12, 2019 12:10
Sign up for freeto 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

@thaJeztah@codecov-io@vdemeester@silvin-lubecki@GordonTheTurtle